[Kst] branches/work/kst/portto4/kst/src

Barth Netterfield netterfield at astro.utoronto.ca
Thu Feb 17 15:33:33 CET 2011


SVN commit 1221288 by netterfield:

Fix a minor error with psd labels, but they aren't done yet!

Fix labels with multiple curves all with the same axis.

Fix enabling 'apply' in plot dialog content tab.



 M  +2 -0      libkst/labelinfo.h  
 M  +2 -0      libkstapp/contenttab.cpp  
 M  +25 -0     libkstapp/plotrenderitem.cpp  
 U             libkstmath/psd.cpp  


--- branches/work/kst/portto4/kst/src/libkst/labelinfo.h #1221287:1221288
@@ -26,6 +26,8 @@
 struct LabelInfo
 {
   LabelInfo() : name(QString()), quantity(QString()), units(QString()) {}
+  bool operator==(const LabelInfo &l) const { return (l.name==name) && (l.quantity==quantity) && (l.units==units); }
+  bool operator!=(const LabelInfo &l) const { return !(*this==l); }
   QString name;
   QString quantity;
   QString units;
--- branches/work/kst/portto4/kst/src/libkstapp/contenttab.cpp #1221287:1221288
@@ -124,6 +124,7 @@
   if (item) {
     _availableRelationList->addItem(_displayedRelationList->takeItem(_displayedRelationList->row(item)));
     _availableRelationList->clearSelection();
+    emit modified();
     updateButtons();
   }
 }
@@ -142,6 +143,7 @@
   if (item) {
     _displayedRelationList->addItem(_availableRelationList->takeItem(_availableRelationList->row(item)));
     _displayedRelationList->clearSelection();
+    emit modified();
     updateButtons();
   }
 }
--- branches/work/kst/portto4/kst/src/libkstapp/plotrenderitem.cpp #1221287:1221288
@@ -350,10 +350,35 @@
   QString units;
   QString quantity;
   LabelInfo label_info;
+  LabelInfo first_label_info;
 
   units.clear();
   quantity.clear();
 
+  bool allSame = true;
+  int count;
+
+  count = relationList().size();
+  if (isX) {
+    first_label_info = relationList().at(0)->xLabelInfo();
+  } else {
+    first_label_info = relationList().at(0)->yLabelInfo();
+  }
+  for (int i=1; i<count; ++i) {
+    if (isX) {
+      label_info = relationList().at(i)->xLabelInfo();
+    } else {
+      label_info = relationList().at(i)->yLabelInfo();
+    }
+    if (label_info != first_label_info) {
+      allSame = false;
+    }
+  }
+
+  if (allSame) {
+    return singleRenderItemLabel(label_info);
+  }
+
   // search for the first vector with quantity and units; use it.
   foreach (const RelationPtr &relation, relationList()) {
     if (isX) {


More information about the Kst mailing list