From 54daf59a18612100ad0d9b9e051164dd6334e51a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 18 Aug 2010 10:40:39 +0200 Subject: Fix tools & bookmarks shortcuts behavior Patch (and implementation) by Glad Deschrijver. Thanks! --- src/mainwindow.cpp | 39 ++++++++++++++++++++++++++------------- src/mainwindow.h | 4 ++++ 2 files changed, 30 insertions(+), 13 deletions(-) (limited to 'src') 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(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); - if(bookmarksButton) - { - connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); - } - - QToolButton *toolsButton = qobject_cast(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(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); + if(bookmarksButton) + { + connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); + } + + QToolButton *toolsButton = qobject_cast(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() -- cgit v1.2.1