diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-08-18 10:40:39 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-08-18 10:40:39 +0200 |
commit | 54daf59a18612100ad0d9b9e051164dd6334e51a (patch) | |
tree | d57cb8dc838e0bd23ea9c0dbdf49c651f6894fa7 | |
parent | Merge commit 'refs/merge-requests/172' of git://gitorious.org/rekonq/mainline... (diff) | |
download | rekonq-54daf59a18612100ad0d9b9e051164dd6334e51a.tar.xz |
Fix tools & bookmarks shortcuts behavior
Patch (and implementation) by Glad Deschrijver. Thanks!
-rw-r--r-- | src/mainwindow.cpp | 39 | ||||
-rw-r--r-- | src/mainwindow.h | 4 |
2 files changed, 30 insertions, 13 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index cbef274a..73779627 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -211,19 +211,7 @@ void MainWindow::setupToolbars() void MainWindow::postLaunch() { - KToolBar *mainBar = toolBar("mainToolBar"); - - QToolButton *bookmarksButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); - if(bookmarksButton) - { - connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); - } - - QToolButton *toolsButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("rekonq_tools") ))); - if(toolsButton) - { - connect(actionByName(QL1S("rekonq_tools")), SIGNAL(triggered()), toolsButton, SLOT(showMenu())); - } + setupBookmarksAndToolsShortcuts(); // setting popup notification m_popup->setAutoDelete(false); @@ -1343,3 +1331,28 @@ bool MainWindow::queryClose() } return true; } + + +void MainWindow::saveNewToolbarConfig() +{ + KXmlGuiWindow::saveNewToolbarConfig(); + setupBookmarksAndToolsShortcuts(); +} + + +void MainWindow::setupBookmarksAndToolsShortcuts() +{ + KToolBar *mainBar = toolBar("mainToolBar"); + + QToolButton *bookmarksButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); + if(bookmarksButton) + { + connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); + } + + QToolButton *toolsButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("rekonq_tools") ))); + if(toolsButton) + { + connect(actionByName(QL1S("rekonq_tools")), SIGNAL(triggered()), toolsButton, SLOT(showMenu())); + } +} diff --git a/src/mainwindow.h b/src/mainwindow.h index e5a43649..50c73b4b 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -81,6 +81,7 @@ public: void setWidgetsVisible(bool makeFullScreen); private: + void setupBookmarksAndToolsShortcuts(); void setupActions(); void setupTools(); void setupToolbars(); @@ -108,6 +109,9 @@ signals: void ctrlTabPressed(); void shiftCtrlTabPressed(); +protected slots: + void saveNewToolbarConfig(); + protected: /** * Filters (SHIFT + ) CTRL + TAB events and emit (shift)ctrlTabPressed() |