aboutsummaryrefslogtreecommitdiff
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/mainwindowmenubar.cpp45
-rw-r--r--src/widgets/mainwindowmenubar.h4
2 files changed, 23 insertions, 26 deletions
diff --git a/src/widgets/mainwindowmenubar.cpp b/src/widgets/mainwindowmenubar.cpp
index c233d29..992163e 100644
--- a/src/widgets/mainwindowmenubar.cpp
+++ b/src/widgets/mainwindowmenubar.cpp
@@ -59,33 +59,16 @@ MainWindowMenuBar::MainWindowMenuBar(std::shared_ptr<Configuration> config, Main
// Tools menu
QMenu *toolsMenu = new QMenu(tr("Tools"), this);
addMenu(toolsMenu);
- QAction *downloadsAction = toolsMenu->addAction(tr("Downloads"));
- downloadsAction->setParent(parent);
- //downloadsAction->setShortcut(QKeySequence::fromString(browser->settings()->value("downloads.dialogShortcut").toString()));
- //connect(downloadsAction, &QAction::triggered, this, [&]() {
- // m_parentWindow->addTabbedDock(Qt::RightDockWidgetArea, browser->downloads());
- //});
-
- QAction *bookmarksAction = toolsMenu->addAction(tr("Bookmarks"));
- bookmarksAction->setParent(parent);
- //bookmarksAction->setShortcut(QKeySequence(browser->settings()->value("bookmarks.dialogShortcut").toString()));
- //connect(bookmarksAction, &QAction::triggered, this, [&]() {
- // m_parentWindow->addTabbedDock(Qt::RightDockWidgetArea, browser->bookmarks());
- //});
- toolsMenu->addSeparator();
- //toolsMenu->addAction(tr("Filter"), browser->blocklists(), SLOT(show()), QKeySequence::fromString(browser->settings()->value("blocker.shortcut").toString()));
- // 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!");
-// }
+ m_downloadsAction = toolsMenu->addAction(tr("Downloads"));
+ m_downloadsAction->setParent(parent);
+ m_downloadsAction->setShortcut(QKeySequence(config->value<std::string>("downloads.shortcut").value().c_str()));
+
+ m_bookmarksAction = toolsMenu->addAction(tr("Bookmarks"));
+ m_bookmarksAction->setParent(parent);
+ m_bookmarksAction->setShortcut(QKeySequence(config->value<std::string>("bookmarks.shortcut").value().c_str()));
+
+ //toolsMenu->addAction(tr("Filter"), browser->blocklists(), SLOT(show()), QKeySequence::fromString(browser->settings()->value("blocker.shortcut").toString()));
// Profile menu
QMenu *profileMenu = new QMenu(tr("Profile"), this);
@@ -100,6 +83,16 @@ MainWindowMenuBar::MainWindowMenuBar(std::shared_ptr<Configuration> config, Main
pageMenu->addAction(tr("Zoom"))->setEnabled(false);
}
+QAction *MainWindowMenuBar::bookmarksAction()
+{
+ return m_bookmarksAction;
+}
+
+QAction *MainWindowMenuBar::downloadsAction()
+{
+ return m_downloadsAction;
+}
+
QAction *MainWindowMenuBar::printAction()
{
return m_printAction;
diff --git a/src/widgets/mainwindowmenubar.h b/src/widgets/mainwindowmenubar.h
index e5e5f38..bbfc3fc 100644
--- a/src/widgets/mainwindowmenubar.h
+++ b/src/widgets/mainwindowmenubar.h
@@ -32,12 +32,16 @@ class MainWindowMenuBar : public QMenuBar
public:
explicit MainWindowMenuBar(std::shared_ptr<Configuration> config, MainWindow *parent = nullptr);
+ QAction *bookmarksAction();
+ QAction *downloadsAction();
QAction *printAction();
private slots:
void handleLoadProfile(MainWindow *window);
private:
+ QAction *m_bookmarksAction;
+ QAction *m_downloadsAction;
QAction *m_printAction;
};