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

List:       konsole-devel
Subject:    Re: [Konsole-devel] Review Request: The context menu should contain the "Show Menubar" action when t
From:       "Jekyll Wu" <adaptee () gmail ! com>
Date:       2012-10-17 23:43:56
Message-ID: 20121017234356.9089.59471 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
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


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/104193/">http://git.reviewboard.kde.org/r/104193/</a>
  </td>
    </tr>
   </table>
   <br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Konsole.</div>
<div>By Jekyll Wu.</div>


<p style="color: grey;"><i>Updated Oct. 17, 2012, 11:43 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">rebase against master code re-increase version number of sessionui.rc
add the &quot;show menubar&quot; in its old place within the context menu</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description  \
(updated)</h1>  <table width="100%" bgcolor="#ffffff" cellspacing="0" \
cellpadding="10" style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">The cause of that bug is &quot;show-menubar&quot; is contained in both \
konsoleui.rc(used by MainWindow) and sessionui.rc(used by SessionController). In \
MainWindow::showShortcutsDialog(), the following code adds that \
&#39;show-menubar&#39; action twice since it is contained in the \
&#39;actionCollection()&#39; of both MainWindow and SessionController.

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

The patch removes &quot;show-menubar&quot; 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 \
&quot;Show Menubar&quot; action only when the menubar is hidden.

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

And I&#39;m not sure appending the &quot;Show Menubar&quot; 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.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">seems fine in stand-alone konsole and hosts of konsolepart.</pre>  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=214493">214493</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> \
(updated)</h1> <ul style="margin-left: 3em; padding-left: 0;">

 <li>desktop/sessionui.rc <span style="color: grey">(0140a08)</span></li>

 <li>src/SessionController.h <span style="color: grey">(b41cc8e)</span></li>

 <li>src/SessionController.cpp <span style="color: grey">(9ee8899)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/104193/diff/" style="margin-left: \
3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Screenshots \
(updated)</h1>

<div>

 <a href="http://git.reviewboard.kde.org/r/104193/s/452/"><img \
src="http://git.reviewboard.kde.org/media/uploaded/images/2012/03/08/when-menubar-is-visible_400x100.png" \
style="border: 1px black solid;" alt="when menubar is visible" /></a>

 <a href="http://git.reviewboard.kde.org/r/104193/s/786/"><img \
src="http://git.reviewboard.kde.org/media/uploaded/images/2012/10/17/when-menubar-is-hidden_400x100.png" \
style="border: 1px black solid;" alt="when menubar is hidden" /></a>

</div>


  </td>
 </tr>
</table>




  </div>
 </body>
</html>



_______________________________________________
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