[prev in list] [next in list] [prev in thread] [next in thread] 

List:       konsole-devel
Subject:    Re: [Konsole-devel] [PATCH] Shortcuts with hidden menu bar
From:       Robin Stocker <robin () nibor ! org>
Date:       2007-07-26 23:16:03
Message-ID: 46A92B33.9010200 () nibor ! org
[Download RAW message or body]

Robert Knight schrieb:
> Hi Robin,
> 
> Thanks for patch, it is greatly appreciated.    I have checked and committed it.
> This behaviour affects other KDE applications which also provide the
> option to hide the menu
> bar, Konqueror for example.
> 
> I am not sure about the action classes in kdelibs, I am CCing
> kde-core-devel in the hope that someone might have suggestions.

Hi Robert,

As this has been resolved in kdelibs by removing the line which set the
shortcut context, here's a new patch. It just sets the main window as
the associated widget.

  Robin

["shortcuts-with-hidden-menubar-2.diff" (text/plain)]

Index: src/SessionController.cpp
===================================================================
--- src/SessionController.cpp	(revision 693062)
+++ src/SessionController.cpp	(working copy)
@@ -85,18 +85,13 @@
 
     // handle user interface related to session (menus etc.)
     setXMLFile("konsole/sessionui.rc");
-    setupActions();
 
     // add all actions to this window, so that the keyboard shortcuts can be
     // used even when the main window's menu is hidden
-    //
-    // TODO: The Qt-4 behaviour of shortcuts not working when the menu bar is hidden
-    // affects other KDE applications as well.  A kdelibs fix might be possible.
-    //
-    // See discussion:  
-    // http://lists.kde.org/?l=konsole-devel&m=118529209602516&w=2
-    view->addActions(actionCollection()->actions());
+    actionCollection()->setAssociatedWidget(view);
 
+    setupActions();
+
     setIdentifier(_session->sessionId());
     sessionTitleChanged();
     
Index: src/MainWindow.cpp
===================================================================
--- src/MainWindow.cpp	(revision 693062)
+++ src/MainWindow.cpp	(working copy)
@@ -59,6 +59,11 @@
     // the directory ('konsole') is included in the path here so that the XML
     // file can be found when this code is being used in the Konsole part.
     setXMLFile("konsole/konsoleui.rc");
+
+    // add all actions to this window, so that the keyboard shortcuts can be
+    // used even when the menu is hidden
+    actionCollection()->setAssociatedWidget(this);
+
     setupActions();
 
     // create view manager
@@ -81,13 +86,6 @@
     // replace standard shortcuts which cannot be used in a terminal
     // (as they are reserved for use by terminal programs)
     correctShortcuts();
-
-    // add all actions to this window, so that the keyboard shortcuts can be
-    // used even when the menu is hidden
-    //
-    // See comments in SessionController constructor about Qt 4 behaviour with
-    // hidden menu bars and shortcuts
-    addActions(actionCollection()->actions());
 }
 
 void MainWindow::correctShortcuts()


_______________________________________________
konsole-devel mailing list
konsole-devel@kde.org
https://mail.kde.org/mailman/listinfo/konsole-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic