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

List:       koffice-devel
Subject:    Re: Review Request: Menu/toolbars not always built correctly
From:       "Dag Andersen" <danders () get2net ! dk>
Date:       2010-06-30 6:34:09
Message-ID: 20100630063409.7307.72719 () localhost
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On 2010-06-29 20:32:13, David Faure wrote:
> > The bug where all the empty menus would remain (go, games etc.) could \
> > be the one I just fixed in kdelibs r1144396, however it was only \
> > happening when the xmlfile wasn't found (and there would be a warning \
> > on stderr). 
> > Other than that, I'm a bit surprised by the complexity. Do I understand \
> > correctly that one of the issues is that a locally modified \
> > koffice_shell.rc would include a full copy of ui_standards.rc, \
> > therefore new versions of ui_standards.rc would be ignored? (Well, it's \
> > not like we change that one very often these days). 
> > To say it otherwise, I wonder why koffice would need all this extra \
> > code, when the theory is that it's just like an app whose rc file is \
> > koffice_shell.rc. There's no per-app file on top of that, all the e.g. \
> > KWord stuff still comes from a part, right? 
> > Ah the one difference is that for the standard kxmlguiclient code to \
> > work, it would need to be set up with a \
> > setComponentData(KComponentData("koffice")), basically, so that \
> > setXMLFile("koffice_shell.rc") finds koffice/koffice_shell.rc. This is \
> > worth a try, I think; or what do I miss?

"To say it otherwise, I wonder why koffice would need all this extra code, \
when the theory is that it's just like an app whose rc file is \
koffice_shell.rc." Maybe it is, I haven't compared koffice behavior to \
other apps. Let me try to be clearer on what I see:

1) Getting all ui_standards.rc menu entries into the menubar you just have \
to modify toolbar config to get a local koffice_shell.rc (version 23 atm) \
and then up the ui_standards.rc version > 23. I agree this is not likely to \
happen very soon, but still...

2) To loose the Help menu you get yourself a local koffice_shell.rc then up \
the revision of global koffice_shell.rc. Then ui_standards.rc is *not* \
loaded because your obsolete *local* koffice_shell.rc block loading it. \
Since the Help menu is defined in ui_standards.rc, it's lost. The reason \
for the "block" is that the findMostRecentXMLFile() (in \
KParts::MainWindow::createShellGUI) will compare the revisions of \
ui_standards.rc with your local koffice_shell.rc !! This is the main issue \
I'm trying to fix.

"There's no per-app file on top of that, all the e.g. KWord stuff still \
comes from a part, right?" Right, the stuff we are looking at here is the \
common-to-all menus: file, settings and help.

"Ah the one difference is that for the standard kxmlguiclient code to work, \
it would need to be set up with a \
setComponentData(KComponentData("koffice")), basically, so that \
setXMLFile("koffice_shell.rc") finds koffice/koffice_shell.rc." \
KoMainWindow c'tor does this:

QStringList allFiles = KGlobal::dirs()->findAllResources("data", \
"koffice/koffice_shell.rc"); setXMLFile(findMostRecentXMLFile(allFiles, \
doc)); setLocalXMLFile(KStandardDirs::locateLocal("data", \
                "koffice/koffice_shell.rc"));
...
createShellGUI()

Would your setComponentData(KComponentData("koffice")) make any difference?


- Dag


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


On 2010-06-29 11:47:42, Dag Andersen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/4492/
> -----------------------------------------------------------
> 
> (Updated 2010-06-29 11:47:42)
> 
> 
> Review request for KOffice and David Faure.
> 
> 
> Summary
> -------
> 
> There has been problems lately with getting the correct layout of menus \
> and toolbars. Sometimes the help menu is gone, other times empty menu \
> entries defined in ui_standars.rc is included (game, go, move, etc) \
> although no koffice app defines them. AFAICS this is because there is two \
> files (ui_standars.rc and koffice_shell.rc) in main window level that \
> defines the ui. Sometimes ui_standards.rc is not loaded when it should, \
> sometimes koffice_shell.rc is not loaded. The reason for this is that the \
> kde standard does not quite support this regime. The attached patch \
> reimplements createShellGUI(), to make sure that ui_standards.rc is \
> loaded when there is a new revision of ui_standard.rc or there is no \
> local koffice_shell.rc. This ensures that the help menu is created. Also \
> it handles revision control of ui_standards.rc separatly to avoid that \
> all the ui_standards.rc definitions accidentally ends up in the local \
> koffice_shell.rc 
> 
> Diffs
> -----
> 
> trunk/koffice/libs/main/KoMainWindow.h 1140071 
> trunk/koffice/libs/main/KoMainWindow.cpp 1140071 
> 
> Diff: http://reviewboard.kde.org/r/4492/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Dag
> 
> 


[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://reviewboard.kde.org/r/4492/">http://reviewboard.kde.org/r/4492/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; \
padding-left: 10px;">  <p style="margin-top: 0;">On June 29th, 2010, 8:32 \
p.m., <b>David Faure</b> wrote:</p>  <blockquote style="margin-left: 1em; \
border-left: 2px solid #d0d0d0; padding-left: 10px;">  <pre>The bug where \
all the empty menus would remain (go, games etc.) could be the one I just \
fixed in kdelibs r1144396, however it was only happening when the xmlfile \
wasn&#39;t found (and there would be a warning on stderr).

Other than that, I&#39;m a bit surprised by the complexity. Do I understand \
correctly that one of the issues is that a locally modified \
koffice_shell.rc would include a full copy of ui_standards.rc, therefore \
new versions of ui_standards.rc would be ignored? (Well, it&#39;s not like \
we change that one very often these days).

To say it otherwise, I wonder why koffice would need all this extra code, \
when the theory is that it&#39;s just like an app whose rc file is \
koffice_shell.rc. There&#39;s no per-app file on top of that, all the e.g. \
KWord stuff still comes from a part, right?

Ah the one difference is that for the standard kxmlguiclient code to work, \
it would need to be set up with a \
setComponentData(KComponentData(&quot;koffice&quot;)), basically, so that \
setXMLFile(&quot;koffice_shell.rc&quot;) finds koffice/koffice_shell.rc. \
This is worth a try, I think; or what do I miss?</pre>  </blockquote>







</blockquote>

<pre>&quot;To say it otherwise, I wonder why koffice would need all this \
extra code, when the theory is that it&#39;s just like an app whose rc file \
is koffice_shell.rc.&quot; Maybe it is, I haven&#39;t compared koffice \
behavior to other apps. Let me try to be clearer on what I see:

1) Getting all ui_standards.rc menu entries into the menubar you just have \
to modify toolbar config to get a local koffice_shell.rc (version 23 atm) \
and then up the ui_standards.rc version &gt; 23. I agree this is not likely \
to happen very soon, but still...

2) To loose the Help menu you get yourself a local koffice_shell.rc then up \
the revision of global koffice_shell.rc. Then ui_standards.rc is *not* \
loaded because your obsolete *local* koffice_shell.rc block loading it. \
Since the Help menu is defined in ui_standards.rc, it&#39;s lost. The \
reason for the &quot;block&quot; is that the findMostRecentXMLFile() (in \
KParts::MainWindow::createShellGUI) will compare the revisions of \
ui_standards.rc with your local koffice_shell.rc !! This is the main issue \
I&#39;m trying to fix.

&quot;There&#39;s no per-app file on top of that, all the e.g. KWord stuff \
still comes from a part, right?&quot; Right, the stuff we are looking at \
here is the common-to-all menus: file, settings and help.

&quot;Ah the one difference is that for the standard kxmlguiclient code to \
work, it would need to be set up with a \
setComponentData(KComponentData(&quot;koffice&quot;)), basically, so that \
setXMLFile(&quot;koffice_shell.rc&quot;) finds \
koffice/koffice_shell.rc.&quot; KoMainWindow c&#39;tor does this:

QStringList allFiles = \
KGlobal::dirs()-&gt;findAllResources(&quot;data&quot;, \
&quot;koffice/koffice_shell.rc&quot;); \
setXMLFile(findMostRecentXMLFile(allFiles, doc)); \
setLocalXMLFile(KStandardDirs::locateLocal(&quot;data&quot;, \
                &quot;koffice/koffice_shell.rc&quot;));
...
createShellGUI()

Would your setComponentData(KComponentData(&quot;koffice&quot;)) make any \
difference?</pre> <br />








<p>- Dag</p>


<br />
<p>On June 29th, 2010, 11:47 a.m., Dag Andersen wrote:</p>




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://reviewboard.kde.orgrb/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 KOffice and David Faure.</div>
<div>By Dag Andersen.</div>


<p style="color: grey;"><i>Updated 2010-06-29 11:47:42</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description \
</h1> <table width="100%" bgcolor="#ffffff" cellspacing="0" \
cellpadding="10" style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0;">There has been problems lately with \
getting the correct layout of menus and toolbars. Sometimes the help menu \
is gone, other times empty menu entries defined in ui_standars.rc is \
included (game, go, move, etc) although no koffice app defines them. AFAICS \
this is because there is two files (ui_standars.rc and koffice_shell.rc) in \
main window level that defines the ui. Sometimes ui_standards.rc is not \
loaded when it should, sometimes koffice_shell.rc is not loaded. The reason \
for this is that the kde standard does not quite support this regime. The \
attached patch reimplements createShellGUI(), to make sure that \
ui_standards.rc is loaded when there is a new revision of ui_standard.rc or \
there is no local koffice_shell.rc. This ensures that the help menu is \
created. Also it handles revision control of ui_standards.rc separatly to \
avoid that all the ui_standards.rc definitions accidentally ends up in the \
local koffice_shell.rc</pre>  </td>
 </tr>
</table>





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

 <li>trunk/koffice/libs/main/KoMainWindow.h <span style="color: \
grey">(1140071)</span></li>

 <li>trunk/koffice/libs/main/KoMainWindow.cpp <span style="color: \
grey">(1140071)</span></li>

</ul>

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




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








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



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


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

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