diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-08-24 20:13:27 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-08-24 20:13:27 +0200 |
commit | 1fcbe65981295f11d8a09b61a09736ba2a1b44b7 (patch) | |
tree | e441005f59280464331b6e24b1eb95d9eaca7c33 /src/widgets | |
parent | AStyle pass (diff) | |
download | smolbote-1fcbe65981295f11d8a09b61a09736ba2a1b44b7.tar.xz |
Implemented Print to PDF action
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/mainwindowmenubar.cpp | 31 | ||||
-rw-r--r-- | src/widgets/mainwindowmenubar.h | 4 |
2 files changed, 22 insertions, 13 deletions
diff --git a/src/widgets/mainwindowmenubar.cpp b/src/widgets/mainwindowmenubar.cpp index ba28607..8dd7fe6 100644 --- a/src/widgets/mainwindowmenubar.cpp +++ b/src/widgets/mainwindowmenubar.cpp @@ -54,16 +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!"); - } + // Plugins +// 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); @@ -73,10 +74,14 @@ MainWindowMenuBar::MainWindowMenuBar(MainWindow *parent) : // Page menu QMenu *pageMenu = new QMenu(tr("Page"), this); addMenu(pageMenu); - pageMenu->addAction(tr("Print")); - pageMenu->addAction(tr("Print to PDF")); - pageMenu->addAction(tr("Zoom")); + pageMenu->addAction(tr("Print"))->setEnabled(false); + m_printAction = pageMenu->addAction(tr("Print to PDF")); + pageMenu->addAction(tr("Zoom"))->setEnabled(false); +} +QAction *MainWindowMenuBar::printAction() +{ + return m_printAction; } void MainWindowMenuBar::handleLoadProfile() diff --git a/src/widgets/mainwindowmenubar.h b/src/widgets/mainwindowmenubar.h index a6c6dc4..43c786b 100644 --- a/src/widgets/mainwindowmenubar.h +++ b/src/widgets/mainwindowmenubar.h @@ -30,11 +30,15 @@ class MainWindowMenuBar : public QMenuBar public: explicit MainWindowMenuBar(MainWindow *parent = nullptr); + QAction *printAction(); + private slots: void handleLoadProfile(); private: MainWindow *m_parentWindow; + + QAction *m_printAction; }; #endif // MAINWINDOWMENUBAR_H |