diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-06-03 17:22:50 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-06-03 17:22:50 +0200 |
commit | 8917ca1cfb8a77a84fea06f6a9c00558f5a21e88 (patch) | |
tree | 2e03ed197f38e93764a3926776888636b22e8e21 /src/widgets | |
parent | Test plugin loading (diff) | |
download | smolbote-8917ca1cfb8a77a84fea06f6a9c00558f5a21e88.tar.xz |
Adding plugin action to the menu bar
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/mainwindowmenubar.cpp | 13 |
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); |