Bug 111114 - Ability to apply only settings that were changed in plot dialog
Summary: Ability to apply only settings that were changed in plot dialog
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: LO wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-19 20:16 UTC by Matthew Truch
Modified: 2007-06-26 23:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2005-08-19 20:16:50 UTC
Version:           1.2.0_devel (using KDE KDE 3.4.0)
OS:                Linux

The "Apply to all plots" feature is excellent.  However, sometimes it would be nice to be able to apply only certain (usually just the changed) settings to all the plots.

Example: You have several plots, some have legends, and some don't.  You don't want to change any of the legends, but want to change the font size of all the axis label text to be larger.  

If you want to use the apply to all feature, you either have to turn on or off legends on all plots; otherwise you have to edit each plot separatly.  (The above example is merely an example; there are other similar situations).  

It would be nice if there was the option to only apply settings that were changed in that instance of the dialog, or perhaps some other way of indicating only which settings you want applied to all.
Comment 1 Andrew Walker 2005-10-20 00:49:23 UTC
My proposal would be to do the following:

For the Window selector add an entry that reads <All Windows>
For the Plot selector and an entry that reads <All Plots>

If <All Windows> is selected then <All Plots> is automatically selected.

If either <All Windows> or <All Plots> is selected the properties would all be set to an indeterminate state (similar to the Edit Multiple for Curves, Histograms, etc.) Only those properties which had been set to a definite value would be updated for the relevant plots when the user hits the Apply button.
Comment 2 Andrew Walker 2005-10-20 19:10:26 UTC
Another alternative would be to handle this as we do editing of multiple curves, histograms, etc. My only concern with this would be that the user is probably totally oblivious to the names that get attached to their plots, so when confornted with a list of plot names would not know which ones to select.

Comments?
Comment 3 Nicolas Brisset 2005-10-21 10:02:03 UTC
That last option is clearly more flexible (e.g. you could edit only 3 of the plots in a window with 4 plots in just one shot) and is probably more consistent with the approach taken elsewhere (multiple curve/vector/etc edits).

I don't think plot names is a problem that should be handled here: there will be a 'select all' button as in the other cases (actually rather "All plots in this window" and "All plots in all windows"), which is then equivalent to the "All plots" entry in the first option. If plot names are not always easy to correlate with the contents, I'd suggest chaning the naming scheme. That is actually a good idea (I find myself constantly looking for the right plot name when using the plot dialog), and I'll submit a separate feature request for that.
Comment 4 George Staikos 2005-10-22 04:31:54 UTC
On Wednesday 19 October 2005 18:49, Andrew Walker wrote:
> ------- My proposal would be to do the following:
>
> For the Window selector add an entry that reads <All Windows>
> For the Plot selector and an entry that reads <All Plots>
>
> If <All Windows> is selected then <All Plots> is automatically selected.
>
> If either <All Windows> or <All Plots> is selected the properties would all
> be set to an indeterminate state (similar to the Edit Multiple for Curves,
> Histograms, etc.) Only those properties which had been set to a definite
> value would be updated for the relevant plots when the user hits the Apply
> button. 


  Sounds fine to me.  The only thing I don't like is the whole concept of 
intermediate state in this dialog.  It's annoying and error-prone to 
maintain.  I'd rather have users who want to change things in batches use 
KstScript instead.
Comment 5 Netterfield 2005-10-22 05:21:12 UTC
The data object dialogs (vectors, curves...) work very well for this for the 
other objects, and are very useful.   Given this, for consistency, we could 
just make the plot dialog work the same as the object dialogs - eliminate the 
'all windows' and 'all plots' buttons, and add an edit 'multiple button'.

Scripting is a great addional method, but won't be that common, I guess.
Comment 6 Nicolas Brisset 2005-10-24 08:52:06 UTC
I agree: it will be difficult to convince users to learn scripting. Some will, others won't ! For something as common as changing a couple of basic plot properties, there should be a point-and-click way...
Comment 7 George Staikos 2005-10-24 14:47:06 UTC
On Monday 24 October 2005 02:52, Nicolas Brisset wrote:
> 08:52 ------- I agree: it will be difficult to convince users to learn
> scripting. Some will, others won't ! For something as common as changing a
> couple of basic plot properties, there should be a point-and-click way...


  The point is more not that users must learn scripting.  It's that the UI is 
starting to get very complicated from a user point of view, -and- from a 
development point of view, and it's getting very hard to test all of our 
options.  Each one we add compounds the problem.  Scripting, is quite easy to 
automate testing of.  However it's best to avoid too many frivolous options 
in any case.

  I've already seen many cases of users being confused by the various options, 
and the plot dialog is particularly overwhelming.
Comment 8 Netterfield 2005-10-29 17:55:11 UTC
This bug should be solved by regularizing the plot dialog's UI to the UI for the data objects.

The plot dialog can be overwhelming because there are a lot of things that people may legitimately want to change about their plots.  Burying the options in script documentation does not make the problem easier for the user.

Comment 9 George Staikos 2005-10-29 18:10:33 UTC
On Saturday 29 October 2005 11:55, netterfield@astro.utoronto.ca wrote:
> This bug should be solved by regularizing the plot dialog's
> UI to the UI for the data objects.
>
> The plot dialog can be overwhelming because there are a lot of things that
> people may legitimately want to change about their plots.  


   Another approach is to use a property-editor style interface for some of 
the less-common actions.  Then the UI is very condensed and the 
implementation is simplified.

> Burying the 
> options in script documentation does not make the problem easier for the
> user.


   It wouldn't quite be like that.  Objects are introspectable, for instance.  
Anyway, it was just one of many alternatives.
Comment 10 Andrew Walker 2006-01-26 19:44:34 UTC
Should be fixed for 1.2.1 release
Comment 11 Andrew Walker 2007-05-24 19:27:23 UTC
One problem with Barth's suggestion is that a plot is actually a view object rather than a data object. The first step might be to add the "Edit Multiple >>" button to view objects and then regularize the plot dialog to that of the other view object dialogs.
Comment 12 Andrew Walker 2007-05-25 00:12:27 UTC
SVN commit 668045 by arwalker:

CCBUG:111114 Add edit multiple functionality for the base view objects. Not yet supported for labels and plots.

 M  +132 -32   editviewobjectdialog.ui  
 M  +202 -35   ksteditviewobjectdialog_i.cpp  
 M  +12 -5     ksteditviewobjectdialog_i.h  
 M  +16 -0     kstviewobject.cpp  
 M  +1 -0      kstviewobject.h  
Comment 13 Andrew Walker 2007-05-25 23:31:23 UTC
SVN commit 668291 by arwalker:

CCBUG:111114 allow multiple editing of labels and legends

 M  +30 -21    ksteditviewobjectdialog_i.cpp  
 M  +1 -0      ksteditviewobjectdialog_i.h  
 M  +120 -52   kstviewlabel.cpp  
 M  +4 -3      kstviewlabel.h  
 M  +109 -48   kstviewlegend.cpp  
 M  +6 -5      kstviewlegend.h  
 M  +8 -3      kstviewobject.cpp  
 M  +6 -5      kstviewobject.h  
 M  +6 -0      viewlabelwidget.ui  
 M  +13 -0     viewlabelwidget.ui.h  
 M  +12 -65    viewlegendwidget.ui  
 M  +10 -2     viewlegendwidget.ui.h  
Comment 14 Andrew Walker 2007-06-19 02:45:15 UTC
SVN commit 677360 by arwalker:

CCBUG:111114 Allow basic multiple editing of plots. Fix typos.

 M  +26 -55    kst2dplot.cpp  
 M  +9 -9      kst2dplot.h  
 M  +0 -1      ksteditviewobjectdialog_i.cpp  
 M  +11 -322   view2dplotwidget.ui  
 M  +184 -268  view2dplotwidget.ui.h  
Comment 15 Andrew Walker 2007-06-19 18:23:54 UTC
SVN commit 677646 by arwalker:

CCBUG:111114 Continue support for multiple editing of plots

 M  +1 -0      Makefile.am  
 D             datawizard.ui.h  
 M  +17 -5     kst2dplot.cpp  
 M  +1 -0      kst2dplot.h  
 M  +0 -31     view2dplotwidget.ui  
 D             view2dplotwidget.ui.h  


--- branches/work/kst/1.5/kst/src/libkstapp/Makefile.am #677645:677646
@@ -43,6 +43,7 @@
 	kstviewlabel.cpp \
 	kstplotlabel.cpp \
 	kst2dplot.cpp \
+	kst2dplotwidget_i.cpp \
 	kstviewlegend.cpp \
 	kstviewbox.cpp \
 	kstviewline.cpp \
--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplot.cpp #677645:677646
@@ -72,7 +72,7 @@
 #include "kstviewlegend.h"
 #include "kstviewobjectfactory.h"
 #include "plotmimesource.h"
-#include "view2dplotwidget.h"
+#include "kst2dplotwidget_i.h"
 #include "plotlistbox.h"
 #include "vectorselector.h"
 #include "kstgfx2dplotmousehandler.h"
@@ -6964,13 +6964,25 @@
   }
 }
 
+/** prepare the custom widget for multiple edit */
+/** Unlike most viewObject dialogs, here we let the dialog prepare itself,
+    rather than having kst2dplot prepare it - kst2dplot is already too big! */
+void Kst2DPlot::populateEditMultiple(QWidget *w) {
+  Kst2dPlotWidget *widget = dynamic_cast<Kst2dPlotWidget*>(w);
+  if (!widget) {
+    return;
+  }
+
+  widget->populateEditMultiple(this);
+}
+
 /** fill the custom widget with current properties */
 /** Unlike most viewObject dialogs, here we let the dialog fill itself,
     rather than having kst2dplot fill it - kst2dplot is already too big! */
 bool Kst2DPlot::fillConfigWidget(QWidget *w, bool isNew) const {
   Q_UNUSED(isNew)
 
-  View2DPlotWidget *widget = dynamic_cast<View2DPlotWidget*>(w);
+  Kst2dPlotWidget *widget = dynamic_cast<Kst2dPlotWidget*>(w);
   if (!widget) {
     return false;
   }
@@ -6986,7 +6998,7 @@
 bool Kst2DPlot::readConfigWidget(QWidget *w, bool editMultipleMode) {
   Q_UNUSED(editMultipleMode)
 
-  View2DPlotWidget *widget = dynamic_cast<View2DPlotWidget*>(w);
+  Kst2dPlotWidget *widget = dynamic_cast<Kst2dPlotWidget*>(w);
   if (!widget) {
     return false;
   }
@@ -6997,7 +7009,7 @@
 }
 
 void Kst2DPlot::connectConfigWidget(QWidget *parent, QWidget *w) const {
-  View2DPlotWidget *widget = dynamic_cast<View2DPlotWidget*>(w);
+  Kst2dPlotWidget *widget = dynamic_cast<Kst2dPlotWidget*>(w);
   if (!widget) {
     return;
   }
@@ -7165,7 +7177,7 @@
 }
 
 QWidget *Kst2DPlot::configWidget(QWidget *parent) {
-  return new View2DPlotWidget(parent, "custom");
+  return new Kst2dPlotWidget(parent, "custom");
 }
 
 namespace {
--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplot.h #677645:677646
@@ -102,6 +102,7 @@
   bool fillConfigWidget(QWidget *w, bool isNew) const;
   bool readConfigWidget(QWidget *w, bool editMultipleMode);
   void connectConfigWidget(QWidget *parent, QWidget *w) const;
+  void populateEditMultiple(QWidget *w);
 
   static Kst2DPlotList globalPlotList();
   static Kst2DPlotPtr findPlotByName(const QString& name);
--- branches/work/kst/1.5/kst/src/libkstapp/view2dplotwidget.ui #677645:677646
@@ -2925,54 +2925,23 @@
     <include location="local" impldecl="in implementation">kstplotlabel.h</include>
     <include location="local" impldecl="in implementation">kstdebug.h</include>
     <include location="local" impldecl="in implementation">kstdefaultnames.h</include>
-    <include location="local" impldecl="in implementation">view2dplotwidget.ui.h</include>
 </includes>
 <variables>
-    <variable access="private">Kst2DPlotPtr _plot;</variable>
-    <variable access="private">QLineEdit *ScalarDest;</variable>
 </variables>
 <signals>
-    <signal>changed()</signal>
 </signals>
 <slots>
-    <slot>generateDefaultLabels()</slot>
-    <slot>updateButtons()</slot>
-    <slot>addDisplayedCurve()</slot>
-    <slot>removeDisplayedCurve()</slot>
-    <slot>fillMarkerLineCombo()</slot>
-    <slot>updateAxesButtons()</slot>
-    <slot>updateScalarCombo()</slot>
-    <slot>updatePlotMarkers( const Kst2DPlot * plot )</slot>
-    <slot>fillWidget( const Kst2DPlot * plot )</slot>
-    <slot>applyAppearance( Kst2DPlotPtr plot )</slot>
-    <slot>applyXAxis( Kst2DPlotPtr plot )</slot>
-    <slot>applyYAxis( Kst2DPlotPtr plot )</slot>
-    <slot>applyRange( Kst2DPlotPtr plot )</slot>
-    <slot>addPlotMarker()</slot>
-    <slot>removePlotMarker()</slot>
-    <slot>removeAllPlotMarkers()</slot>
-    <slot>applyPlotMarkers( Kst2DPlotPtr plot )</slot>
-    <slot>fillPlot( Kst2DPlotPtr plot )</slot>
-    <slot>insertCurrentScalar()</slot>
-    <slot>setScalarDestXLabel()</slot>
-    <slot>setScalarDestYLabel()</slot>
-    <slot>setScalarDestTopLabel()</slot>
-    <slot>editLegend()</slot>
 </slots>
 <functions>
-    <function access="private" specifier="non virtual">init()</function>
 </functions>
 <layoutdefaults spacing="6" margin="11"/>
 <includehints>
     <includehint>plotlistbox.h</includehint>
-    <includehint>plotlistbox.h</includehint>
     <includehint>kdualcolorbutton.h</includehint>
     <includehint>kcolorbutton.h</includehint>
-    <includehint>kcolorbutton.h</includehint>
     <includehint>kfontcombo.h</includehint>
     <includehint>klineedit.h</includehint>
     <includehint>kcombobox.h</includehint>
-    <includehint>kcolorbutton.h</includehint>
     <includehint>vectorselector.h</includehint>
     <includehint>kstcombobox.h</includehint>
 </includehints>
Comment 16 Andrew Walker 2007-06-19 20:12:05 UTC
SVN commit 677685 by arwalker:

CCBUG:111114 Continue with multiple editing of plots

 M  +8 -10     kst2dplot.cpp  
 A             kst2dplotwidget_i.cpp   [License: GPL (v2+)]
 A             kst2dplotwidget_i.h   [License: GPL (v2+)]
 M  +4 -4      ksteditviewobjectdialog_i.cpp  


--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplot.cpp #677684:677685
@@ -5934,7 +5934,6 @@
       tpx.labels.pop_front();
     }
 
-    // FIXME: inefficient.  We keep reparsing and re-rendering tpx.labels[.]
     for (i = tpx.iLo; i < tpx.iHi; i++) {
       double xTickPos = x_orig_px + (double)i * xtick_px;
       if (_xReversed) {
@@ -5943,16 +5942,16 @@
 
       p.save();
       _xTickLabel->setText(tpx.labels[i - tpx.iLo]);
-      if (_xTickLabel->rotation() == 0) {
+      if (_xTickLabel->rotation() == 0.0) {
         if (!((_suppressLeft  && d2i(xTickPos) - _xTickLabel->size().width() / 2 < xleft_bdr_px ) ||
               (_suppressRight && d2i(xTickPos) - _xTickLabel->size().width() / 2 > x_px - xright_bdr_px ) ) ) {
           p.translate(d2i(xTickPos) - _xTickLabel->size().width() / 2, yTickPos);
           _xTickLabel->paint(p);
         }
-      } else if (_xTickLabel->rotation() > 0) {
+      } else if (_xTickLabel->rotation() > 0.0) {
         p.translate(xTickPos-0.5*_xTickLabel->lineSpacing()*sin(_xTickLabel->rotation()*M_PI/180.0), yTickPos);
         _xTickLabel->paint(p);
-      } else if (_xTickLabel->rotation() < 0) {
+      } else if (_xTickLabel->rotation() < 0.0) {
         p.translate(xTickPos - _xTickLabel->size().width()-0.5*_xTickLabel->lineSpacing()*sin(_xTickLabel->rotation()*M_PI/180.0), yTickPos);
         _xTickLabel->paint(p);
       }
@@ -5961,7 +5960,6 @@
   }
 
   // if top axis is transformed, plot top axis numbers as well
-  // FIXME: inefficient.  We keep reparsing and re-rendering tpx.oppLabels[.]
   if (_xTransformed && !_suppressTop) {
     int yTopTickPos = d2i(ytop_bdr_px);
     if (xTicksOutPlot()) {
@@ -6003,7 +6001,7 @@
     if (yTicksOutPlot()) {
       xTickPos -= d2i(2.0 * ytick_len_px);
     }
-    // FIXME: inefficient.  We keep reparsing and re-rendering tpy.labels[.]
+
     for (i = tpy.iLo; i < tpy.iHi; i++) {
       double yTickPos = y_orig_px - (double)i * ytick_px;
       if (_yReversed) {
@@ -6012,16 +6010,16 @@
       _yTickLabel->setText(tpy.labels[i - tpy.iLo]);
 
       p.save();
-      if (_yTickLabel->rotation() == 0 || _yTickLabel->rotation() <-89 || _yTickLabel->rotation() > 89) {
+      if (_yTickLabel->rotation() == 0.0 || fabs(_yTickLabel->rotation()) > 89.0) {
         if (!((_suppressBottom && d2i(yTickPos) + _yTickLabel->size().height() / 2 > y_px - ybot_bdr_px ) ||
               (_suppressTop    && d2i(yTickPos) - _yTickLabel->size().height() / 2 < ytop_bdr_px ) ) ) {
           p.translate(d2i(xTickPos) - _yTickLabel->size().width(), d2i(yTickPos) - _yTickLabel->size().height() / 2);
           _yTickLabel->paint(p);
         }
-      } else if (_yTickLabel->rotation() < 0) {
+      } else if (_yTickLabel->rotation() < 0.0) {
         p.translate(d2i(xTickPos) - _yTickLabel->size().width(), d2i(yTickPos) - _yTickLabel->lineSpacing()/2);
         _yTickLabel->paint(p);
-      } else if (_yTickLabel->rotation() > 0) {
+      } else if (_yTickLabel->rotation() > 0.0) {
         p.translate(d2i(xTickPos) - _yTickLabel->size().width(), d2i(yTickPos) - _yTickLabel->size().height() + _yTickLabel->lineSpacing()/2);
         _yTickLabel->paint(p);
       }
@@ -6035,7 +6033,7 @@
     if (yTicksOutPlot()) {
       xTopTickPos += d2i(2.0 * ytick_len_px);
     }
-    // FIXME: inefficient.  We keep reparsing and re-rendering tpy.oppLabels[.]
+
     for (i = tpy.iLo; i < tpy.iHi; i++) {
       double yTickPos = y_orig_px - (double)i * ytick_px;
       if (_yReversed) {
--- branches/work/kst/1.5/kst/src/libkstapp/ksteditviewobjectdialog_i.cpp #677684:677685
@@ -522,8 +522,10 @@
     applySettings(_viewObject);
   }
 
-  _apply->setDisabled(true);
-  KstApp::inst()->paintAll(KstPainter::P_PAINT);
+  if (applied) {
+    _apply->setDisabled(true);
+    KstApp::inst()->paintAll(KstPainter::P_PAINT);
+  }
 
   return applied;
 }
@@ -537,8 +539,6 @@
 void KstEditViewObjectDialogI::okClicked() {
   if (_viewObject && apply()) {
     QDialog::accept();
-  } else {
-    QDialog::reject();
   }
 }
 
Comment 17 Andrew Walker 2007-06-19 23:15:49 UTC
SVN commit 677766 by arwalker:

CCBUG:111114 Continue on editing of multiple plots

 M  +6 -8      libkstapp/kst2dplot.cpp  
 M  +296 -132  libkstapp/kst2dplotwidget_i.cpp  
 M  +5 -0      libkstapp/kst2dplotwidget_i.h  
 M  +14 -2     libkstmath/kstplotdefines.h  
Comment 18 Andrew Walker 2007-06-21 23:56:02 UTC
SVN commit 678648 by arwalker:

CCBUG:111114 Continue with multiple editing for plots

 M  +150 -116  kst2dplotwidget_i.cpp  
 M  +1 -0      kstviewlabel.cpp  
 M  +8 -3      kstviewlegend.cpp  
 M  +2 -3      kstviewobject.h  
Comment 19 Andrew Walker 2007-06-26 23:44:34 UTC
SVN commit 680684 by arwalker:

BUG:111114 All now seems well

 M  +8 -4      kst2dplotwidget_i.cpp  


--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplotwidget_i.cpp #680683:680684
@@ -1052,7 +1052,8 @@
   bool isXAxisInterpreted;
 
   plot->getXAxisInterpretation(isXAxisInterpreted, xAxisInterpretation, xAxisDisplay);
-  if (_checkBoxXInterpret->state() == QButton::On || isXAxisInterpreted) {
+  if (_checkBoxXInterpret->state() == QButton::On || 
+      (_checkBoxXInterpret->state() == QButton::NoChange && isXAxisInterpreted)) {
     if (_comboBoxXInterpret->currentText().compare(QString(" ")) != 0) {
       xAxisInterpretation = AxisInterpretations[_comboBoxXInterpret->currentItem()].type;
     }
@@ -1107,7 +1108,8 @@
     plot->setSuppressBottom(false);
   }
 
-  if (_xTransformTop->state() == QButton::On || !plot->xTransformedExp().isNull()) {
+  if (_xTransformTop->state() == QButton::On || 
+      (_xTransformTop->state() == QButton::NoChange && !plot->xTransformedExp().isNull())) {
     if (_xTransformTopExp->text() != QString(" ")) {
       plot->setXTransformedExp(_xTransformTopExp->text());
     }
@@ -1136,7 +1138,8 @@
   bool isYAxisInterpreted;
 
   plot->getYAxisInterpretation(isYAxisInterpreted, yAxisInterpretation, yAxisDisplay);
-  if (_checkBoxYInterpret->state() == QButton::On || isYAxisInterpreted) {
+  if (_checkBoxYInterpret->state() == QButton::On ||
+      (_checkBoxYInterpret->state() == QButton::NoChange && isYAxisInterpreted)) {
     if (_comboBoxYInterpret->currentText().compare(QString(" ")) != 0) {
       yAxisInterpretation = AxisInterpretations[_comboBoxYInterpret->currentItem()].type;
     }
@@ -1192,7 +1195,8 @@
     plot->setSuppressRight(false);
   }
 
-  if (_yTransformRight->state() == QButton::On || !plot->yTransformedExp().isNull()) {
+  if (_yTransformRight->state() == QButton::On || 
+      (_yTransformRight->state() == QButton::NoChange && !plot->yTransformedExp().isNull())) {
     if (_yTransformRightExp->text() != QString(" ")) {
       plot->setYTransformedExp(_yTransformRightExp->text());
     }