Commit 39a84903 authored by Robert Knight's avatar Robert Knight

Fix tab-specific actions (eg. Copy, Paste) not appearing in Configure Shortcuts dialog.

Add action collection for current controller to dialog before showing and reload UI
for other controllers after the dialog is accepted.

There is a known bug at the moment where changing a shortcut from a custom value to
the default shortcut only updates the current tab and tabs created after the change.
This is a kdelibs issue being looked into.

BUG: 161021
BACKPORT: 4.1

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=837726
parent 8f5f8051
......@@ -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)
......
......@@ -67,6 +67,7 @@ using namespace Konsole;
KIcon SessionController::_activityIcon;
KIcon SessionController::_silenceIcon;
QSet<SessionController*> SessionController::_allControllers;
QPointer<SearchHistoryThread> 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)
{
......
......@@ -91,7 +91,6 @@ public:
*/
SessionController(Session* session , TerminalDisplay* view, QObject* parent);
~SessionController();
/** Returns the session associated with this controller */
QPointer<Session> 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<SessionController*> 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> _session;
QPointer<TerminalDisplay> _view;
SessionGroup* _copyToGroup;
......@@ -257,7 +257,10 @@ private:
bool _listenForScreenWindowUpdates;
bool _preventClose;
static QSet<SessionController*> _allControllers;
static int _lastControllerId;
static KIcon _activityIcon;
static KIcon _silenceIcon;
};
inline bool SessionController::isValid() const
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment