Commit 147dfaec authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add popup menu

parent 3fa7835e
Pipeline #68653 passed with stage
in 53 minutes and 51 seconds
......@@ -7,6 +7,7 @@
#include "confirmbeforedeletingwidget.h"
#include "confirmbeforedeletingcreateruledialog.h"
#include <KLocalizedString>
#include <QMenu>
#include <QTreeWidget>
#include <QVBoxLayout>
......@@ -33,4 +34,23 @@ ConfirmBeforeDeletingWidget::~ConfirmBeforeDeletingWidget()
void ConfirmBeforeDeletingWidget::slotCustomContextMenuRequested(const QPoint &p)
{
QTreeWidgetItem *item = mTreeWidget->currentItem();
if (!item) {
return;
}
QMenu menu(this);
#if 0
menu.addAction(QIcon::fromTheme(QStringLiteral("document-open")), i18n("Open"), this, &ConfirmBeforeDeletingWidget::slotOpenItem);
if (filterValueIsNotEmpty) {
menu.addSeparator();
menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Remove filter"), this, &ConfirmBeforeDeletingWidget::slotRemoveRule);
}
#endif
menu.exec(QCursor::pos());
}
void ConfirmBeforeDeletingWidget::slotRemoveRule()
{
// TODO
}
......@@ -18,5 +18,6 @@ public:
private:
void slotCustomContextMenuRequested(const QPoint &p);
void slotRemoveRule();
QTreeWidget *const mTreeWidget;
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment