From 36b8989179a537ef7801e1f77d0ef7d35b470cf3 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 21 Nov 2011 11:04:45 +0100 Subject: [PATCH] Fix shortcut issue with panels The KAction instance of the panels is added to the menu instance now instead of the QDock-actions. It is assured that the state between the actions gets synchronized. Now it's possible for the user to apply custom shortcuts and the shortcuts are also shown in the menu as expected. CCMAIL: lueck@hube-lueck.de --- src/dolphinmainwindow.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 74d9674580..3fbeb781d0 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1872,14 +1872,15 @@ void DolphinMainWindow::setupDockWidgets() KActionMenu* panelsMenu = new KActionMenu(i18nc("@action:inmenu View", "Panels"), this); actionCollection()->addAction("panels", panelsMenu); panelsMenu->setDelayed(false); - panelsMenu->addAction(placesAction); - panelsMenu->addAction(infoAction); - panelsMenu->addAction(foldersAction); + const KActionCollection* ac = actionCollection(); + panelsMenu->addAction(ac->action("show_places_panel")); + panelsMenu->addAction(ac->action("show_information_panel")); + panelsMenu->addAction(ac->action("show_folders_panel")); #ifndef Q_OS_WIN - panelsMenu->addAction(terminalAction); + panelsMenu->addAction(ac->action("show_terminal_panel")); #endif #ifdef HAVE_NEPOMUK - panelsMenu->addAction(searchAction); + panelsMenu->addAction(ac->action("show_search_panel")); #endif panelsMenu->addSeparator(); panelsMenu->addAction(lockLayoutAction); @@ -2209,13 +2210,14 @@ void DolphinMainWindow::createPanelAction(const KIcon& icon, const QString& actionName) { KAction* panelAction = actionCollection()->addAction(actionName); + panelAction->setCheckable(true); + panelAction->setChecked(dockAction->isChecked()); panelAction->setText(dockAction->text()); panelAction->setIcon(icon); panelAction->setShortcut(shortcut); - dockAction->setIcon(icon); - dockAction->setShortcut(shortcut); connect(panelAction, SIGNAL(triggered()), dockAction, SLOT(trigger())); + connect(dockAction, SIGNAL(toggled(bool)), panelAction, SLOT(setChecked(bool))); } DolphinMainWindow::UndoUiInterface::UndoUiInterface() :