diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index a3d959f43..00ae5513d 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -375,8 +375,21 @@ bool MainWindow::queryClose() void MainWindow::showShortcutsDialog() { - KShortcutsDialog::configure( actionCollection() , - KShortcutsEditor::LetterShortcutsDisallowed, this ); + KShortcutsDialog dialog(KShortcutsEditor::AllActions, KShortcutsEditor::LetterShortcutsDisallowed, this); + + // add actions from this window and the current session controller + foreach(KXMLGUIClient* client, guiFactory()->clients()) + dialog.addCollection(client->actionCollection()); + + if (dialog.configure()) + { + // reload session actions (defined in "sessionui.rc") in other session controllers + foreach(SessionController* controller, SessionController::allControllers()) + { + if (controller != _pluggedController) + controller->reloadXML(); + } + } } void MainWindow::newFromProfile(Profile::Ptr profile) diff --git a/src/SessionController.cpp b/src/SessionController.cpp index c37af7a53..bd8b6fd5f 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -67,6 +67,7 @@ using namespace Konsole; KIcon SessionController::_activityIcon; KIcon SessionController::_silenceIcon; +QSet SessionController::_allControllers; QPointer SearchHistoryTask::_thread; int SessionController::_lastControllerId; @@ -89,6 +90,8 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q , _listenForScreenWindowUpdates(false) , _preventClose(false) { + _allControllers.insert(this); + Q_ASSERT( session ); Q_ASSERT( view ); @@ -170,6 +173,8 @@ SessionController::~SessionController() { if ( _view ) _view->setScreenWindow(0); + + _allControllers.remove(this); } void SessionController::trackOutput(QKeyEvent* event) { diff --git a/src/SessionController.h b/src/SessionController.h index 23e4bcc05..9f9c015b8 100644 --- a/src/SessionController.h +++ b/src/SessionController.h @@ -91,7 +91,6 @@ public: */ SessionController(Session* session , TerminalDisplay* view, QObject* parent); ~SessionController(); - /** Returns the session associated with this controller */ QPointer session() { return _session; } @@ -134,6 +133,10 @@ public: // Reimplemented to watch for events happening to the view virtual bool eventFilter(QObject* watched , QEvent* event); + /** Returns the set of all controllers that exist. */ + static QSet allControllers() + { return _allControllers; } + signals: /** * Emitted when the view associated with the controller is focused. @@ -225,9 +228,6 @@ private: void listenForScreenWindowUpdates(); private: - static KIcon _activityIcon; - static KIcon _silenceIcon; - QPointer _session; QPointer _view; SessionGroup* _copyToGroup; @@ -257,7 +257,10 @@ private: bool _listenForScreenWindowUpdates; bool _preventClose; + static QSet _allControllers; static int _lastControllerId; + static KIcon _activityIcon; + static KIcon _silenceIcon; }; inline bool SessionController::isValid() const {