[Konsole-devel] Review Request: The context menu should contain the "Show Menubar" action when the menubar is hidden

Jekyll Wu adaptee at gmail.com
Wed Oct 17 23:43:56 UTC 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104193/
-----------------------------------------------------------

(Updated Oct. 17, 2012, 11:43 p.m.)


Review request for Konsole.


Changes
-------

rebase against master code
re-increase version number of sessionui.rc
add the "show menubar" in its old place within the context menu


Description (updated)
-------

The cause of that bug is "show-menubar" is contained in both konsoleui.rc(used by MainWindow) and sessionui.rc(used by SessionController). In MainWindow::showShortcutsDialog(), the following code adds that 'show-menubar' action twice since it is contained in the 'actionCollection()' of both MainWindow and SessionController.

    foreach(KXMLGUIClient * client, guiFactory()->clients()) {
        dialog.addCollection(client->actionCollection());
    }

The patch removes "show-menubar" from sessionui.rc. Instead, it adds or removes that action into/from context menu dynamically depending upon whether the window currently has menubar or not. The result is the content menu contains that "Show Menubar" action only when the menubar is hidden.

I feel this is not an ideal solution. Is there some way to tell KShortcutsDialog: "If the same action is added twice, Just count it as one single action"? That would make the code easier . 

And I'm not sure appending the "Show Menubar" action is nice or ugly. Should a separator be added before it?

I originally think a separator should also be appended to mirror the previous layout, but maybe it is just not worth it to write the extra code.


This addresses bug 214493.
    http://bugs.kde.org/show_bug.cgi?id=214493


Diffs (updated)
-----

  desktop/sessionui.rc 0140a08 
  src/SessionController.h b41cc8e 
  src/SessionController.cpp 9ee8899 

Diff: http://git.reviewboard.kde.org/r/104193/diff/


Testing
-------

seems fine in stand-alone konsole and hosts of konsolepart.


Screenshots (updated)
-----------

when menubar is visible
  http://git.reviewboard.kde.org/r/104193/s/452/
when menubar is hidden
  http://git.reviewboard.kde.org/r/104193/s/786/


Thanks,

Jekyll Wu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20121017/6b0c8b0a/attachment.html>


More information about the konsole-devel mailing list