[Kst] [Bug 111405] Change Data Samples shouldn't clear vector list when apply is pressed.

netterfield@astro.utoronto.ca netterfield at astro.utoronto.ca
Sun Sep 4 06:22:55 CEST 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=111405         
netterfield astro utoronto ca changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From netterfield astro utoronto ca  2005-09-04 06:22 -------
SVN commit 456904 by netterfield:

BUG: 111405

Change pts dialog now remembers what vectors are selected.


 M  +16 -4     kstchangenptsdialog_i.cpp  
 M  +1 -1      kstchangenptsdialog_i.h  


--- trunk/extragear/graphics/kst/kst/kstchangenptsdialog_i.cpp #456903:456904
 @ -21,6 +21,7  @
 #include <qspinbox.h>
 
 #include <knuminput.h>
+#include <stdio.h>
 
 #include "datarangewidget.h"
 #include "kstchangenptsdialog_i.h"
 @ -49,22 +50,33  @
   CurveList->selectAll(true);
 }
 
-void KstChangeNptsDialogI::updateChangeNptsDialog() {
+bool KstChangeNptsDialogI::updateChangeNptsDialog() {
+  QStringList qsl;
+  
+  for (uint i_vector = 0; i_vector < CurveList->count(); i_vector++) {
+    if (CurveList->isSelected(i_vector)) {
+      qsl.append(CurveList->text(i_vector));
+    }
+  }
   CurveList->clear();
-
   KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
   /* insert vectors into ChangeNptsCurveList */
   for (uint i = 0; i < rvl.count(); i++) {
     rvl[i]->readLock();
     CurveList->insertItem(rvl[i]->tagName(), -1);
+    if (qsl.contains(rvl[i]->tagName())) {
+      CurveList->setSelected(i, true);
+    }
     rvl[i]->readUnlock();
   }
+  return qsl.count()>0;
 }
 
 void KstChangeNptsDialogI::showChangeNptsDialog() {
-  updateChangeNptsDialog();
+  bool some_slected = updateChangeNptsDialog();
   updateDefaults(0);
-  CurveList->selectAll(true);
+  if (!some_slected) 
+    CurveList->selectAll(true);
   show();
   raise();
 }
--- trunk/extragear/graphics/kst/kst/kstchangenptsdialog_i.h #456903:456904
 @ -31,7 +31,7  @
 
 public slots:
   /** update the entries in changenptsDialog to represent current vectors */
-  void updateChangeNptsDialog();
+  bool updateChangeNptsDialog();
 
   /** calls updateChangeNptsDialog(), then shows and raises changeNptsDialog */
   void showChangeNptsDialog();


More information about the Kst mailing list