Commit d88ad64a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to create action here.

parent 0c30f2e4
Pipeline #75828 passed with stage
in 53 minutes and 13 seconds
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
#include "confirmbeforedeletingmessageboxdialog.h" #include "confirmbeforedeletingmessageboxdialog.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <KMessageBox> #include <KMessageBox>
#include <QAction>
#include <QIcon>
#include <QMenu>
#include <QPointer> #include <QPointer>
ConfirmBeforeDeletingInterface::ConfirmBeforeDeletingInterface(QObject *parent) ConfirmBeforeDeletingInterface::ConfirmBeforeDeletingInterface(QObject *parent)
...@@ -19,6 +22,25 @@ ConfirmBeforeDeletingInterface::~ConfirmBeforeDeletingInterface() ...@@ -19,6 +22,25 @@ ConfirmBeforeDeletingInterface::~ConfirmBeforeDeletingInterface()
{ {
} }
QList<QAction *> ConfirmBeforeDeletingInterface::actions() const
{
return mAction;
}
void ConfirmBeforeDeletingInterface::createActions(KActionCollection *ac)
{
// TODO
if (ac) {
auto mainMenu = new QAction(i18n("External Script"), this);
auto menu = new QMenu;
auto act = new QAction(QIcon::fromTheme(QStringLiteral("settings-configure")), i18n("Configure"), menu);
// TODO connect(act, &QAction::triggered, this, &ConfirmBeforeDeletingInterface::slotConfigure);
menu->addAction(act);
mainMenu->setMenu(menu);
mAction << mainMenu;
}
}
Akonadi::Item::List ConfirmBeforeDeletingInterface::exec(const Akonadi::Item::List &list) Akonadi::Item::List ConfirmBeforeDeletingInterface::exec(const Akonadi::Item::List &list)
{ {
Akonadi::Item::List lst; Akonadi::Item::List lst;
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
#include <MessageViewer/MessageViewerCheckBeforeDeletingInterface> #include <MessageViewer/MessageViewerCheckBeforeDeletingInterface>
#include <QObject> #include <QObject>
class QAction;
class KActionCollection;
class ConfirmBeforeDeletingInterface : public MessageViewer::MessageViewerCheckBeforeDeletingInterface class ConfirmBeforeDeletingInterface : public MessageViewer::MessageViewerCheckBeforeDeletingInterface
{ {
Q_OBJECT Q_OBJECT
...@@ -17,4 +18,9 @@ public: ...@@ -17,4 +18,9 @@ public:
~ConfirmBeforeDeletingInterface() override; ~ConfirmBeforeDeletingInterface() override;
Q_REQUIRED_RESULT Akonadi::Item::List exec(const Akonadi::Item::List &list) override; Q_REQUIRED_RESULT Akonadi::Item::List exec(const Akonadi::Item::List &list) override;
Q_REQUIRED_RESULT QList<QAction *> actions() const override;
private:
void createActions(KActionCollection *ac);
QList<QAction *> mAction;
}; };
Supports Markdown
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