aboutsummaryrefslogtreecommitdiff
path: root/src/widgets
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-06-03 17:22:50 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2017-06-03 17:22:50 +0200
commit8917ca1cfb8a77a84fea06f6a9c00558f5a21e88 (patch)
tree2e03ed197f38e93764a3926776888636b22e8e21 /src/widgets
parentTest plugin loading (diff)
downloadsmolbote-8917ca1cfb8a77a84fea06f6a9c00558f5a21e88.tar.xz
Adding plugin action to the menu bar
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/mainwindowmenubar.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/widgets/mainwindowmenubar.cpp b/src/widgets/mainwindowmenubar.cpp
index 0770a8d..cd27a98 100644
--- a/src/widgets/mainwindowmenubar.cpp
+++ b/src/widgets/mainwindowmenubar.cpp
@@ -24,6 +24,8 @@
#include <QInputDialog>
#include "forms/profilesdialog.h"
+#include "interfaces.h"
+
MainWindowMenuBar::MainWindowMenuBar(MainWindow *parent) :
QMenuBar(parent)
{
@@ -52,6 +54,17 @@ MainWindowMenuBar::MainWindowMenuBar(MainWindow *parent) :
toolsMenu->addSeparator();
toolsMenu->addAction(tr("Filter"), qApp->blocklists(), SLOT(show()), QKeySequence::fromString(sSettings->value("blocker.shortcut").toString()));
+ if(qApp->plugin()) {
+ GuiInterface *gui = qobject_cast<GuiInterface *>(qApp->plugin());
+ if(gui) {
+ toolsMenu->addAction(gui->action());
+ } else {
+ qDebug("Plugin doesn't gui");
+ }
+ } else {
+ qDebug("No plugin!");
+ }
+
// Profile menu
QMenu *profileMenu = new QMenu(tr("Profile"), this);
addMenu(profileMenu);