Review Request: Enable Shortcuts + Toolbar configuration in KmPlot

Albert Astals Cid tsdgeos at terra.es
Mon Sep 5 10:25:15 UTC 2011



> 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>&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>&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>&Settings</text>
> > +                <Menu name="settings">
> >                         <Action name="options_configure"/>
> >                 </Menu>
> >                 <Menu name="help"><text>&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>&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>&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
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20110905/882a4990/attachment-0001.html>


More information about the kde-edu mailing list