[Kst] branches/work/kst/1.5/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Mon Jun 25 22:40:25 CEST 2007


SVN commit 680291 by arwalker:

BUG:147217 Enable Apply button after moving curves up or down in the displayed objects list

 M  +2 -2      kst2dplot.cpp  
 M  +18 -3     kst2dplotwidget_i.cpp  
 M  +2 -0      kst2dplotwidget_i.h  
 M  +1 -1      labelrenderer.cpp  


--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplot.cpp #680290:680291
@@ -1953,7 +1953,7 @@
   tp.labels.clear();
   tp.oppLabels.clear();
   tp.delta = false;
-  
+
   if (isLog && isInterpreted) {
     setTicks(tp.tick, tp.org, Max + log10(range) + log10(scale), Min + log10(range) + log10(scale), isLog, logBase, isX, base);
     tp.org -= log10(range) + log10(scale);
@@ -1962,7 +1962,7 @@
     tp.tick /= range*scale;
     tp.org  /= range*scale;
   }
-    
+
   tp.iLo = int((Min-tp.org)/tp.tick);
   tp.iHi = int((Max-tp.org)/tp.tick)+1;
   iShort = tp.iLo;
--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplotwidget_i.cpp #680290:680291
@@ -94,8 +94,8 @@
   connect(AvailableCurveList, SIGNAL(selectionChanged()), this, SLOT(updateButtons()));
   connect(_remove, SIGNAL(clicked()), this, SLOT(removeDisplayedCurve()));
   connect(_add, SIGNAL(clicked()), this, SLOT(addDisplayedCurve()));
-  connect(_up, SIGNAL(clicked()), DisplayedCurveList, SLOT(up()));
-  connect(_down, SIGNAL(clicked()), DisplayedCurveList, SLOT(down()));
+  connect(_up, SIGNAL(clicked()), this, SLOT(upDisplayedCurve()));
+  connect(_down, SIGNAL(clicked()), this, SLOT(downDisplayedCurve()));
 
   connect(AutoLabel, SIGNAL(clicked()), this, SLOT(generateDefaultLabels()));
 
@@ -315,8 +315,8 @@
       if (DisplayedCurveList->isSelected(i)) {
         AvailableCurveList->insertItem(DisplayedCurveList->text(i));
         DisplayedCurveList->removeItem(i);
+      }
     }
-    }
     updateButtons();
     emit changed();
   }
@@ -324,7 +324,22 @@
 }
 
 
+void Kst2dPlotWidget::upDisplayedCurve()
+{
+  if (DisplayedCurveList->up()) {
+    emit changed();
+  }
+}
 
+
+void Kst2dPlotWidget::downDisplayedCurve()
+{
+  if (DisplayedCurveList->down()) {
+    emit changed();
+  }
+}
+
+
 void Kst2dPlotWidget::fillMarkerLineCombo() {
   QRect rect = _comboMarkerLineStyle->style().querySubControlMetrics(QStyle::CC_ComboBox, _comboMarkerLineStyle, QStyle::SC_ComboBoxEditField);
   rect.setLeft(rect.left() + 2);
--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplotwidget_i.h #680290:680291
@@ -35,6 +35,8 @@
   public slots:
     void generateDefaultLabels();
     void updateButtons();
+    void upDisplayedCurve();
+    void downDisplayedCurve();
     void addDisplayedCurve();
     void removeDisplayedCurve();
     void fillMarkerLineCombo();
--- branches/work/kst/1.5/kst/src/libkstapp/labelrenderer.cpp #680290:680291
@@ -63,7 +63,7 @@
       // not an object reference
       continue;
     }
-    
+
 //    kstdWarning() << "Label references unknown object [" << fi->text << "]." << endl;
     return false;
   }


More information about the Kst mailing list