[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Thu Apr 15 01:40:09 CEST 2004


CVS commit by arwalker: 

The plugin dialog update( ... ) function is really two seperate functions.
One for updating the list of scalars and vectors within the input comboboxes
and the other (already existing) to handle changes in the plugin itself.
These functions have now been split, as previously creating a new
scalar or vector within the plugin dialog would cause any modified
settings to revert back to those of the last created plugin.


  M +35 -6     kstplugindialog_i.cpp   1.61
  M +2 -1      kstplugindialog_i.h   1.15


--- kdeextragear-2/kst/kst/kstplugindialog_i.cpp  #1.60:1.61
@@ -69,5 +69,5 @@ KstPluginDialogI::KstPluginDialogI(QWidg
                                    bool modal, WFlags fl)
 : KstPluginDialog(parent, name, modal, fl) {
-  connect(Select, SIGNAL(activated(int)), this, SLOT(update(int)));
+  connect(Select, SIGNAL(activated(int)), this, SLOT(updatePlugin(int)));
   connect(New, SIGNAL(clicked()), this, SLOT(new_I()));
   connect(Edit, SIGNAL(clicked()), this, SLOT(edit_I()));
@@ -92,5 +92,5 @@ void KstPluginDialogI::show_I(const QStr
 
   updatePluginList();
-  update(new_index);
+  updatePlugin(new_index);
   show();
   raise();
@@ -134,5 +134,5 @@ void KstPluginDialogI::updatePluginList(
 void KstPluginDialogI::show_New() {
   updatePluginList();
-  update(-2);
+  updatePlugin(-2);
   show();
   raise();
@@ -139,6 +139,35 @@ void KstPluginDialogI::show_New() {
 }
 
-
 void KstPluginDialogI::update(int new_index) {
+  Q_UNUSED(new_index);
+  
+  QString selectedVector;
+  QString selectedScalar;
+  KstSharedPtr<Plugin> pPtr;
+  
+  pPtr = PluginCollection::self()->plugin(_pluginList[PluginCombo->currentItem()]);
+  if( pPtr != NULL ) {
+    const QValueList<Plugin::Data::IOValue>& itable = pPtr->data()._inputs;
+    for (QValueList<Plugin::Data::IOValue>::ConstIterator it = itable.begin(); it != itable.end(); ++it) {
+      if ((*it)._type == Plugin::Data::IOValue::TableType) { // vector
+        QObject *field = _frameWidget->child((*it)._name.latin1(), "VectorSelector");
+        assert(field);
+        if (field) {
+          VectorSelector *vs = static_cast<VectorSelector*>(field);
+          vs->update();
+        }
+      } else {
+        QObject *field = _frameWidget->child((*it)._name.latin1(), "ScalarSelector");
+        assert(field);
+        if (field) {
+          ScalarSelector *ss = static_cast<ScalarSelector*>(field);
+          ss->update();
+        }
+      }
+    }
+  }
+}
+
+void KstPluginDialogI::updatePlugin(int new_index) {
   QString selectedVector;
   QString selectedScalar;

--- kdeextragear-2/kst/kst/kstplugindialog_i.h  #1.14:1.15
@@ -35,4 +35,5 @@ public slots:
   /** update the entries in the plugin dialog to represent current plugins */
   void update(int new_index = -1);
+  void updatePlugin(int new_index = -1);
 
   /** Calls update(), then shows/raises the dialog */





More information about the Kst mailing list