Summary: | Plot dialog is inconsistent with other dialogs, and is therefore confusing | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Netterfield <netterfield> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | HI | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
patch to regularize the UI of the plot dialog
Updated patch |
Description
Netterfield
2006-06-17 05:12:32 UTC
For 7) the "Apply Settings To" radio group already apply only to the tab in which they are found. The latter part of the question still stands though. SVN commit 566646 by netterfield: CCBUG: 129283 Add a plot->new action to the menues to create a new plot in the current window. Addresses item 1 of 129283. M +1 -0 kst/kstui.rc M +2 -1 kst/pics/Makefile.am M +13 -0 libkstapp/kst.cpp M +5 -0 libkstapp/kst.h --- trunk/extragear/graphics/kst/src/kst/kstui.rc #566645:566646 @@ -49,6 +49,7 @@ </Menu> <Menu name="plots"><text>&Plots</text> <Action name="plotdialog_action"/> + <Action name="newplot_action"/> <Separator/> <Action name="zoomtie_action"/> <Separator/> --- trunk/extragear/graphics/kst/src/kst/pics/Makefile.am #566645:566646 @@ -13,7 +13,8 @@ kst_gfx_rectangle.png kst_gfx_rounded_rectangle.png \ kst_gfx_ellipse.png kst_gfx_polyline.png kst_gfx_polygon.png \ kst_gfx_arrow.png kst_gfx_picture.png kst_choosecolor.png \ - kst_csdnew.png kst_differentiatecurves.png kst_viewmanager.png + kst_csdnew.png kst_differentiatecurves.png kst_viewmanager.png \ + kst_newplot.png --- trunk/extragear/graphics/kst/src/libkstapp/kst.cpp #566645:566646 @@ -494,6 +494,13 @@ /************/ + NewPlotAction = new KAction(i18n("New Plot..."), "kst_newplot", 0, + this, SLOT(newPlot()), + actionCollection(), "newplot_action"); + NewPlotAction->setWhatsThis(i18n("Create a new plot in the\n" + "current window.")); + + /************/ PlotDialogAction = new KAction(i18n("Edit &Plot..."), "kst_editplots", 0, this, SLOT(showPlotDialog()), actionCollection(), "plotdialog_action"); @@ -1991,7 +1998,13 @@ } } +void KstApp::newPlot() { + KstViewWindow *w; + w = dynamic_cast<KstViewWindow*>(activeWindow()); + Kst2DPlotPtr p = kst_cast<Kst2DPlot>(w->view()->findChild(w->createObject<Kst2DPlot>(KST::suggestPlotName(), false))); +} + void KstApp::showPlotDialog(const QString& window, const QString& plot) { _plotDialog->show_I(window, plot); } --- trunk/extragear/graphics/kst/src/libkstapp/kst.h #566645:566646 @@ -298,6 +298,9 @@ void slotUpdateMemoryMsg(const QString &msg); void slotUpdateProgress(int total, int step, const QString &msg); + /** creates a new plot in the current window */ + void newPlot(); + /** just calls plotDialog->show_I(0) */ void showPlotDialog(); void showPlotDialog(const QString& strWindow, const QString& strPlot); @@ -485,6 +488,8 @@ KAction *MatrixDialogAction; /* Image Edit Action */ KAction *ImageDialogAction; + /* New Plot Action */ + KAction *NewPlotAction; /* Plot Edit Action */ KAction *PlotDialogAction; /* Vector Edit Action */ Created attachment 17145 [details]
patch to regularize the UI of the plot dialog
Attached is a diff which completes this bug. There were a lot of indentation changes (due to removed 'ifs') as the code was simplified. Basic Gist: -the plot dialog is now an OK/Apply/Cancel dialog. -It can only be called to edit a plot. -As this was the least invasive approach, it takes a Kst2DPlotPtr of the plot it is going to edit, unlike other view object dialogs (for view object dialogs, the object creates the dialog...) and more like the data object dialogs. Not sure how important it is to change this now. -It takes a qstring window name as well, which is used when applying to the current window. -It applies to all plots using Kst2DPlot::globalPlotList. Created attachment 17188 [details]
Updated patch
This is an update after the branch merges. It makes only minor changes but now
it applies cleanly to trunk. However, there are problems with this patch.
First, _plot will hold references to view objects. This means they won't go
away when they're deleted. We either have to destroy the dialog or clear the
_plot variable on close. It will also be hard to keep the dialog in sync with
the display in even a basic way if this variable exists.
In addition, we need a Kst2DPlot::findPlot(const QString& name) instead of
globalPlotList().find() for performance reasons.
OK. So this should be adapted to be a standard kstviewobject dialog. Yes I think that's best. Fixed a while ago... |