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

List:       kde-edu-devel
Subject:    Re: Review Request: Enable Shortcuts + Toolbar configuration in KmPlot
From:       "Albert Astals Cid" <tsdgeos () terra ! es>
Date:       2011-09-05 10:25:15
Message-ID: 20110905102515.7617.23555 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On July 12, 2011, 10:47 a.m., Albert Astals Cid wrote:
> > This is my suggested patch, it let's xmlgui do its magic without forcing any of \
> > the stuff and as far as i can see solves all your problems 
> > diff --git a/kmplot/kmplot_part.rc b/kmplot/kmplot_part.rc
> > index fc64866..91c225f 100644
> > --- a/kmplot/kmplot_part.rc
> > +++ b/kmplot/kmplot_part.rc
> > @@ -32,10 +32,7 @@
> > <Action name="maximumvalue"/>
> > <Action name="minimumvalue"/>
> > </Menu>
> > -                <Menu name="settings"><text>&amp;Settings</text>
> > -                        <Separator />
> > -                        <Action name="options_configure_keybinding"/>
> > -                        <Action name="options_configure_toolbars"/>
> > +                <Menu name="settings">
> > <Action name="options_configure"/>
> > </Menu>
> > <Menu name="help"><text>&amp;Help</text>
> > diff --git a/kmplot/kmplot_part_readonly.rc b/kmplot/kmplot_part_readonly.rc
> > index 8d83ec9..417d929 100644
> > --- a/kmplot/kmplot_part_readonly.rc
> > +++ b/kmplot/kmplot_part_readonly.rc
> > @@ -29,7 +29,7 @@
> > <Action name="maximumvalue"/>
> > <Action name="minimumvalue"/>
> > </Menu>
> > -                <Menu name="settings"><text>&amp;Settings</text>
> > +                <Menu name="settings">
> > <Action name="options_configure"/>
> > </Menu>
> > <Menu name="help"><text>&amp;Help</text>
> > diff --git a/kmplot/kmplot_shell.rc b/kmplot/kmplot_shell.rc
> > index 8c0824f..7f64cce 100644
> > --- a/kmplot/kmplot_shell.rc
> > +++ b/kmplot/kmplot_shell.rc
> > @@ -10,19 +10,6 @@
> > <Action name="file_quit"/>
> > </Menu>
> > <Merge/>
> > -                <Menu noMerge="1" name="settings"><text>&amp;Settings</text>
> > -                        <!--<Action name="options_show_toolbar"/>-->
> > -                        <Merge name="StandardToolBarMenuHandler" />
> > -                        <Action name="options_show_statusbar"/>
> > -                        <Separator/>
> > -                        <Action name="fullscreen" />
> > -                        <Merge/>
> > -<!--                        <Separator/>
> > -                        <Action name="options_configure_keybinding"/>
> > -                        <Action name="options_configure_toolbars"/>
> > -                        <Action name="options_configure"/>-->
> > -                        <Separator/>
> > -                </Menu>
> > <Menu name="help"><text>&amp;Help</text>
> > <DefineGroup name="names_group" />
> > </Menu>
> 
> Burkhard Lück wrote:
> Tried your patch, the rc files look much cleaner.
> 
> I get the same result than with my patch, all toolbar items are configurable, 
> one part of shortcuts only in kmplot app, the other part if used as kpart in \
> konqueror 
> Albert Astals Cid wrote:
> Which shortcuts are not configurable when running kmplot?
> 
> Burkhard Lück wrote:
> Running the application KmPlot the shortcut dialog has these 13 actions: 
> About KDE, About KmPlot, Configure Shortcuts, Configure Toolbars, Full Screen Mode, \
>  New, Open, Quit, Report Bug, Show Statusbar, Switch Application Language, 
> WhatsThis, KmPlot Handbook.
> 
> 
> Viewing a kmplot file in Konqueror the shortcut dialog has these 31 actions in \
> KmPlotPart: Animate Plot, Calculator, Cartesian Plot, Configure KmPlot, Configure \
> Shortcuts,  Configure Toolbars, Constants, Coordinate System, Differential Plot, \
> Edit, Export,  Find Maximum, Find Minimum, Fit Widget to Trigonometric Functions, \
> Hide, Implicit Plot,  Open Recent, Parametric Plot, Plot Area, Polar Plot, \
> Predefined Math Functions, Print,  Redo, Remove, Reset View, Save As, Save, Show \
> Slider, Undo, Zoom In, Zoom Out. 
> The actions Configure Shortcuts + Configure Toolbars are in both shortcut dialogs.
> 
> The action Show Toolbar is missing in both dialogs.

Oh, i see, kmplot is trying again to do things itself instead of leaving them up to \
the library, the fix for that (in addition to my other patch) is:

diff --git a/kmplot/kmplot.cpp b/kmplot/kmplot.cpp
index 239b19c..9d9563e 100644
--- a/kmplot/kmplot.cpp
+++ b/kmplot/kmplot.cpp
@@ -72,6 +72,7 @@ KmPlot::KmPlot( KCmdLineArgs* args)
 			setCentralWidget(m_part->widget());
 			//m_part->widget()->setFocus();
 			// and integrate the part's GUI with the shell's
+			setupGUI(Keys | ToolBar | Save);
 			createGUI(m_part);
 		}
 	}
@@ -159,9 +160,6 @@ void KmPlot::setupActions()
 	createStandardStatusBarAction();
 	setStandardToolBarMenuEnabled(true);
 
-	KStandardAction::keyBindings(this, SLOT(optionsConfigureKeys()), \
                actionCollection());
-	KStandardAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), \
                actionCollection());
-
 	m_fullScreen = KStandardAction::fullScreen( NULL, NULL, this, actionCollection());
 	actionCollection()->addAction("fullscreen", m_fullScreen);
 	connect( m_fullScreen, SIGNAL( toggled( bool )), this, SLOT( slotUpdateFullScreen( \
bool ))); @@ -178,23 +176,6 @@ void KmPlot::fileNew()
 		KToolInvocation::kdeinitExec("kmplot");
 }
 
-
-void KmPlot::optionsConfigureKeys()
-{
-	/// \todo check that configuring keys works
-// 	KShortcutsDialog::configure(actionCollection(), "kmplot_shell.rc");
-	KShortcutsDialog::configure( actionCollection() );
-}
-
-void KmPlot::optionsConfigureToolbars()
-{
-	saveMainWindowSettings( KGlobal::config()->group( QString() ));
-	// use the standard toolbar editor
-	KEditToolBar dlg(factory());
-	connect(&dlg, SIGNAL(newToolBarConfig()), this, SLOT(applyNewToolbarConfig()));
-	dlg.exec();
-}
-
 void KmPlot::applyNewToolbarConfig()
 {
 	applyMainWindowSettings(KGlobal::config()->group( QString() ));
diff --git a/kmplot/kmplot.h b/kmplot/kmplot.h
index df77341..62b2eb9 100644
--- a/kmplot/kmplot.h
+++ b/kmplot/kmplot.h
@@ -72,8 +72,6 @@ private slots:
 public Q_SLOTS:
     // DBus interface
     Q_SCRIPTABLE void fileOpen();
-    Q_SCRIPTABLE void optionsConfigureKeys();
-    Q_SCRIPTABLE void optionsConfigureToolbars();
     Q_SCRIPTABLE void setStatusBarText(const QString &, int id);
 	Q_SCRIPTABLE void openFileInNewWindow(const KUrl &url);
 	/**

Can you give it a try and see if it works for you too? 


- Albert


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


On July 12, 2011, 9:34 a.m., Burkhard Lück wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101927/
> -----------------------------------------------------------
> 
> (Updated July 12, 2011, 9:34 a.m.)
> 
> 
> Review request for KDE Edu, Anne-Marie Mahfouf and Christoph Feck.
> 
> 
> Summary
> -------
> 
> Since around kde 4.1/4.2 selecting the menu items Settings->Configure Shortcuts and \
> Settings->Configure Toolbars do not launch both configuration dialogs any more. So \
> it is impossible now to change shortcuts and toolbar items in kmplot. 
> With this patch the toolbars dialog with both toolbars is opened and the items can \
> be changed. The shortcuts dialog opens as well, but not all actions/shortcuts are \
> listed, only New, Open, Quit, Full Screen Mode, Handbook, WhatsThis, About KDE, \
> About KmPlot, Configure Shortcuts, Configure Toolbars, Report Bug, Show Statusbar \
> and Switch Languages. All other actions/shortcuts can only be configured using \
> kmplot_part_readonly in konqueror. That is the same behavior as in kde 3.9.
> 
> I don't understand all the magic behind shell/parts + menu/actions merging so I can \
> not fix the missing actions in the shortcuts dialog. 
> Strange is that kmplot has 3 rc files (kmplot_shell.rc, kmplot_part.rc and \
> kmplot_part_readonly.rc) whereas e.g okular/konsole (also usable as kparts in \
> konqueror) have only two rc files. 
> 
> This addresses bugs 177014 and 268445.
> http://bugs.kde.org/show_bug.cgi?id=177014
> http://bugs.kde.org/show_bug.cgi?id=268445
> 
> 
> Diffs
> -----
> 
> kmplot/kmplot_part.rc fc64866 
> kmplot/kmplot_shell.rc 8c0824f 
> 
> Diff: http://git.reviewboard.kde.org/r/101927/diff
> 
> 
> Testing
> -------
> 
> Works for me as described above.
> 
> 
> Thanks,
> 
> Burkhard
> 
> 


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





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On July 12th, 2011, 10:47 a.m., <b>Albert Astals \
Cid</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">This is my suggested patch, it let&#39;s xmlgui do its magic without \
forcing any of the stuff and as far as i can see solves all your problems

diff --git a/kmplot/kmplot_part.rc b/kmplot/kmplot_part.rc
index fc64866..91c225f 100644
--- a/kmplot/kmplot_part.rc
+++ b/kmplot/kmplot_part.rc
@@ -32,10 +32,7 @@
                        &lt;Action name=&quot;maximumvalue&quot;/&gt;
                        &lt;Action name=&quot;minimumvalue&quot;/&gt;
                &lt;/Menu&gt;
-                &lt;Menu \
                name=&quot;settings&quot;&gt;&lt;text&gt;&amp;amp;Settings&lt;/text&gt;
                
-                        &lt;Separator /&gt;
-                        &lt;Action \
                name=&quot;options_configure_keybinding&quot;/&gt;
-                        &lt;Action name=&quot;options_configure_toolbars&quot;/&gt;
+                &lt;Menu name=&quot;settings&quot;&gt;
                        &lt;Action name=&quot;options_configure&quot;/&gt;
                &lt;/Menu&gt;
                &lt;Menu \
                name=&quot;help&quot;&gt;&lt;text&gt;&amp;amp;Help&lt;/text&gt;
diff --git a/kmplot/kmplot_part_readonly.rc b/kmplot/kmplot_part_readonly.rc
index 8d83ec9..417d929 100644
--- a/kmplot/kmplot_part_readonly.rc
+++ b/kmplot/kmplot_part_readonly.rc
@@ -29,7 +29,7 @@
                        &lt;Action name=&quot;maximumvalue&quot;/&gt;
                        &lt;Action name=&quot;minimumvalue&quot;/&gt;
                &lt;/Menu&gt;
-                &lt;Menu \
name=&quot;settings&quot;&gt;&lt;text&gt;&amp;amp;Settings&lt;/text&gt; +             \
&lt;Menu name=&quot;settings&quot;&gt;  &lt;Action \
name=&quot;options_configure&quot;/&gt;  &lt;/Menu&gt;
                &lt;Menu \
                name=&quot;help&quot;&gt;&lt;text&gt;&amp;amp;Help&lt;/text&gt;
diff --git a/kmplot/kmplot_shell.rc b/kmplot/kmplot_shell.rc
index 8c0824f..7f64cce 100644
--- a/kmplot/kmplot_shell.rc
+++ b/kmplot/kmplot_shell.rc
@@ -10,19 +10,6 @@
                        &lt;Action name=&quot;file_quit&quot;/&gt;
                &lt;/Menu&gt;
                &lt;Merge/&gt;
-                &lt;Menu noMerge=&quot;1&quot; \
                name=&quot;settings&quot;&gt;&lt;text&gt;&amp;amp;Settings&lt;/text&gt;
                
-                        &lt;!--&lt;Action \
                name=&quot;options_show_toolbar&quot;/&gt;--&gt;
-                        &lt;Merge name=&quot;StandardToolBarMenuHandler&quot; /&gt;
-                        &lt;Action name=&quot;options_show_statusbar&quot;/&gt;
-                        &lt;Separator/&gt;
-                        &lt;Action name=&quot;fullscreen&quot; /&gt;
-                        &lt;Merge/&gt;
-&lt;!--                        &lt;Separator/&gt;
-                        &lt;Action \
                name=&quot;options_configure_keybinding&quot;/&gt;
-                        &lt;Action name=&quot;options_configure_toolbars&quot;/&gt;
-                        &lt;Action name=&quot;options_configure&quot;/&gt;--&gt;
-                        &lt;Separator/&gt;
-                &lt;/Menu&gt;
                &lt;Menu \
name=&quot;help&quot;&gt;&lt;text&gt;&amp;amp;Help&lt;/text&gt;  &lt;DefineGroup \
name=&quot;names_group&quot; /&gt;  &lt;/Menu&gt;</pre>
 </blockquote>




 <p>On July 12th, 2011, 7:54 p.m., <b>Burkhard Lück</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Tried your patch, the rc \
files look much cleaner.

I get the same result than with my patch, all toolbar items are configurable, 
one part of shortcuts only in kmplot app, the other part if used as kpart in \
konqueror</pre>  </blockquote>





 <p>On July 13th, 2011, 11:49 a.m., <b>Albert Astals Cid</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Which shortcuts are not \
configurable when running kmplot?</pre>  </blockquote>





 <p>On July 13th, 2011, 12:58 p.m., <b>Burkhard Lück</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Running the application \
KmPlot the shortcut dialog has these 13 actions:  About KDE, About KmPlot, Configure \
Shortcuts, Configure Toolbars, Full Screen Mode,  New, Open, Quit, Report Bug, Show \
Statusbar, Switch Application Language,  WhatsThis, KmPlot Handbook.


Viewing a kmplot file in Konqueror the shortcut dialog has these 31 actions in \
KmPlotPart: Animate Plot, Calculator, Cartesian Plot, Configure KmPlot, Configure \
Shortcuts,  Configure Toolbars, Constants, Coordinate System, Differential Plot, \
Edit, Export,  Find Maximum, Find Minimum, Fit Widget to Trigonometric Functions, \
Hide, Implicit Plot,  Open Recent, Parametric Plot, Plot Area, Polar Plot, Predefined \
Math Functions, Print,  Redo, Remove, Reset View, Save As, Save, Show Slider, Undo, \
Zoom In, Zoom Out.

The actions Configure Shortcuts + Configure Toolbars are in both shortcut dialogs.

The action Show Toolbar is missing in both dialogs.</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Oh, i see, kmplot is \
trying again to do things itself instead of leaving them up to the library, the fix \
for that (in addition to my other patch) is:

diff --git a/kmplot/kmplot.cpp b/kmplot/kmplot.cpp
index 239b19c..9d9563e 100644
--- a/kmplot/kmplot.cpp
+++ b/kmplot/kmplot.cpp
@@ -72,6 +72,7 @@ KmPlot::KmPlot( KCmdLineArgs* args)
 			setCentralWidget(m_part-&gt;widget());
 			//m_part-&gt;widget()-&gt;setFocus();
 			// and integrate the part&#39;s GUI with the shell&#39;s
+			setupGUI(Keys | ToolBar | Save);
 			createGUI(m_part);
 		}
 	}
@@ -159,9 +160,6 @@ void KmPlot::setupActions()
 	createStandardStatusBarAction();
 	setStandardToolBarMenuEnabled(true);
 
-	KStandardAction::keyBindings(this, SLOT(optionsConfigureKeys()), \
                actionCollection());
-	KStandardAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), \
                actionCollection());
-
 	m_fullScreen = KStandardAction::fullScreen( NULL, NULL, this, actionCollection());
 	actionCollection()-&gt;addAction(&quot;fullscreen&quot;, m_fullScreen);
 	connect( m_fullScreen, SIGNAL( toggled( bool )), this, SLOT( slotUpdateFullScreen( \
bool ))); @@ -178,23 +176,6 @@ void KmPlot::fileNew()
 		KToolInvocation::kdeinitExec(&quot;kmplot&quot;);
 }
 
-
-void KmPlot::optionsConfigureKeys()
-{
-	/// \todo check that configuring keys works
-// 	KShortcutsDialog::configure(actionCollection(), &quot;kmplot_shell.rc&quot;);
-	KShortcutsDialog::configure( actionCollection() );
-}
-
-void KmPlot::optionsConfigureToolbars()
-{
-	saveMainWindowSettings( KGlobal::config()-&gt;group( QString() ));
-	// use the standard toolbar editor
-	KEditToolBar dlg(factory());
-	connect(&amp;dlg, SIGNAL(newToolBarConfig()), this, SLOT(applyNewToolbarConfig()));
-	dlg.exec();
-}
-
 void KmPlot::applyNewToolbarConfig()
 {
 	applyMainWindowSettings(KGlobal::config()-&gt;group( QString() ));
diff --git a/kmplot/kmplot.h b/kmplot/kmplot.h
index df77341..62b2eb9 100644
--- a/kmplot/kmplot.h
+++ b/kmplot/kmplot.h
@@ -72,8 +72,6 @@ private slots:
 public Q_SLOTS:
     // DBus interface
     Q_SCRIPTABLE void fileOpen();
-    Q_SCRIPTABLE void optionsConfigureKeys();
-    Q_SCRIPTABLE void optionsConfigureToolbars();
     Q_SCRIPTABLE void setStatusBarText(const QString &amp;, int id);
 	Q_SCRIPTABLE void openFileInNewWindow(const KUrl &amp;url);
 	/**

Can you give it a try and see if it works for you too? </pre>
<br />








<p>- Albert</p>


<br />
<p>On July 12th, 2011, 9:34 a.m., Burkhard Lück wrote:</p>






<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 KDE Edu, Anne-Marie Mahfouf and Christoph Feck.</div>
<div>By Burkhard Lück.</div>


<p style="color: grey;"><i>Updated July 12, 2011, 9:34 a.m.</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; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Since around kde 4.1/4.2 selecting the menu items Settings-&gt;Configure \
Shortcuts and Settings-&gt;Configure Toolbars do not launch both configuration \
dialogs any more. So it is impossible now to change shortcuts and toolbar items in \
kmplot.

With this patch the toolbars dialog with both toolbars is opened and the items can be \
changed. The shortcuts dialog opens as well, but not all actions/shortcuts are \
listed, only New, Open, Quit, Full Screen Mode, Handbook, WhatsThis, About KDE, About \
KmPlot, Configure Shortcuts, Configure Toolbars, Report Bug, Show Statusbar and \
Switch Languages. All other actions/shortcuts can only be configured using \
kmplot_part_readonly in konqueror. That is the same behavior as in kde 3.9.

I don&#39;t understand all the magic behind shell/parts + menu/actions merging so I \
can not fix the missing actions in the shortcuts dialog.

Strange is that kmplot has 3 rc files (kmplot_shell.rc, kmplot_part.rc and \
kmplot_part_readonly.rc) whereas e.g okular/konsole (also usable as kparts in \
konqueror) have only two rc files.</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;">Works for me as described above.</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=177014">177014</a>, 

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


</div>


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

 <li>kmplot/kmplot_part.rc <span style="color: grey">(fc64866)</span></li>

 <li>kmplot/kmplot_shell.rc <span style="color: grey">(8c0824f)</span></li>

</ul>

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




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








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



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


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

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