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

Andrew Walker arwalker at sumusltd.com
Fri Sep 28 21:08:40 CEST 2007


SVN commit 718456 by arwalker:

windows are now referred to as tabs

 M  +1 -1      graphfiledialog.ui  
 M  +17 -4     kstfitdialog_i.cpp  
 M  +8 -1      kstplugindialog_i.cpp  


--- branches/work/kst/1.6/kst/src/libkstapp/graphfiledialog.ui #718455:718456
@@ -421,7 +421,7 @@
                 <cstring>buttonGroup1</cstring>
             </property>
             <property name="title">
-                <string>Windows</string>
+                <string>Tabs</string>
             </property>
             <hbox>
                 <property name="name">
--- branches/work/kst/1.6/kst/src/libkstapp/kstfitdialog_i.cpp #718455:718456
@@ -227,8 +227,7 @@
         return false;
       }
     } else {
-      KMessageBox::sorry(this, i18n("There is something wrong (i.e, there is a bug) with"
-                                    " the selected plugin.\n"));
+      KMessageBox::sorry(this, i18n("There is something wrong (i.e, there is a bug) with the selected plugin.\n"));
       return false;
     }
 
@@ -261,6 +260,7 @@
     bool string = false;
     bool scalar = false;
     bool fixed = false;
+
     switch ((*it)._type) {
       case Plugin::Data::IOValue::PidType:
         continue;
@@ -338,7 +338,14 @@
           }
           iInputVector++;
         } else {
-          widget = new VectorSelector(parent, (*it)._name.latin1());
+          VectorSelector *vectorSelector = new VectorSelector(parent, (*it)._name.latin1());
+          widget = dynamic_cast<QWidget*>(vectorSelector);
+          if ((*it)._optional) {
+            KstVectorPtr vector;
+
+            vectorSelector->provideNoneVector(true);
+            vectorSelector->setSelection(vector);
+          }
           connect(widget, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
         }
       }
@@ -375,6 +382,7 @@
       QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "VectorSelector");
       KstVectorPtr v;
       KstReadLocker vl(&KST::vectorList.lock());
+
       if (!field) {
         field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "QLabel");
         assert(field);
@@ -383,8 +391,11 @@
         VectorSelector *vs = static_cast<VectorSelector*>(field);
         v = *KST::vectorList.findTag(vs->selectedVector());
       }
-      if (v) {
+
+      if (!v && (*it)._optional) {
         plugin->inputVectors().insert((*it)._name, v);
+      } else if (v) {
+        plugin->inputVectors().insert((*it)._name, v);
       } else if (plugin->inputVectors().contains((*it)._name)) {
         plugin->inputVectors().erase((*it)._name);
         rc = false;
@@ -395,6 +406,7 @@
       StringSelector *ss = static_cast<StringSelector*>(field);
       KstWriteLocker sl(&KST::stringList.lock());
       KstStringPtr s = *KST::stringList.findTag(ss->selectedString());
+
       if (s == *KST::stringList.end()) {
         QString val = ss->_string->currentText();
         // create orphan string
@@ -411,6 +423,7 @@
       ScalarSelector *ss = static_cast<ScalarSelector*>(field);
       KstWriteLocker sl(&KST::scalarList.lock());
       KstScalarPtr s = *KST::scalarList.findTag(ss->selectedScalar());
+
       if (s == *KST::scalarList.end()) {
         bool ok;
         double val = ss->_scalar->currentText().toDouble(&ok);
--- branches/work/kst/1.6/kst/src/libkstapp/kstplugindialog_i.cpp #718455:718456
@@ -747,7 +747,14 @@
           p->unlock();
         }
       } else {
-        widget = new VectorSelector(parent, (*it)._name.latin1());
+        VectorSelector *vectorSelector = new VectorSelector(parent, (*it)._name.latin1());
+        widget = dynamic_cast<QWidget*>(vectorSelector);
+        if ((*it)._optional) {
+          KstVectorPtr vector;
+
+          vectorSelector->provideNoneVector(true);
+          vectorSelector->setSelection(vector);
+        }
         connect(widget, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
       }
     } else {


More information about the Kst mailing list