Bug 145434

Summary: Plugin dialog not automatically updated with newly created vectors
Product: [Applications] kst Reporter: Andrew Walker <arwalker>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.4.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Andrew Walker 2007-05-14 21:20:16 UTC
Version:           1.4.0 (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
OS:                Linux

PROBLEM:

A plugin dialog with vector selectors does not automatically update the list of available vectors in the vector selectors when new vectors are created.

STEPS TO PREPRODUCE:

Start Kst
Select Data... New Plugin...
Select (e.g.) 'Bin' in the Data Plugins dialog
Using the data wizard create a few plots

RESULTS:

The vector selector in the 'New' dialog is not updated with the newly created vectors
In order to see the newly created vectors the user close the 'New' dialog and re-select Data... New Plugin...

EXPECTED RESULTS:

The vector selector in the 'New' dialog is updated with the newly created vectors
Comment 1 Andrew Walker 2007-05-14 23:03:29 UTC
SVN commit 664785 by arwalker:

BUG:145434 update the new style plugin dialog when vectors, scalars, or strings are created

 M  +4 -0      kst.cpp  
 M  +32 -1     kstbasicdialog_i.cpp  
 M  +1 -0      kstbasicdialog_i.h  


--- branches/work/kst/1.5/kst/src/libkstapp/kst.cpp #664784:664785
@@ -75,6 +75,7 @@
 #include "kstmatrixdefaults.h"
 #include "kstmonochromedialog_i.h"
 #include "kstplugindialog_i.h"
+#include "kstbasicdialog_i.h"
 #include "kstprintoptionspage.h"
 #include "kstpsddialog_i.h"
 #include "kstquickstartdialog_i.h"
@@ -2094,6 +2095,9 @@
     if (!onlyVisible || KstVectorDialogI::globalInstance()->isShown()) {
       KstVectorDialogI::globalInstance()->update();
     }
+    if (!onlyVisible || KstBasicDialogI::globalInstance()->isShown()) {
+      KstBasicDialogI::globalInstance()->updateForm();
+    }
     if (!onlyVisible || KstPluginDialogI::globalInstance()->isShown()) {
       KstPluginDialogI::globalInstance()->updateForm();
     }
--- branches/work/kst/1.5/kst/src/libkstapp/kstbasicdialog_i.cpp #664784:664785
@@ -401,8 +401,39 @@
 }
 
 
+void KstBasicDialogI::updateForm() {
+  KstBasicPluginPtr ptr = kst_cast<KstBasicPlugin>(KstDataObject::plugin(_pluginName));
+  if (!ptr) {
+    return;
+  }
+
+  // input vectors...
+  QStringList iv = ptr->inputVectorList();
+  for (QStringList::ConstIterator ivI = iv.begin(); ivI != iv.end(); ++ivI) {
+    if (VectorSelector *w = vector(*ivI)) {
+      w->update();
+    }
+  }
+
+  // input scalars...
+  QStringList is = ptr->inputScalarList();
+  for (QStringList::ConstIterator isI = is.begin(); isI != is.end(); ++isI) {
+    if (ScalarSelector *w = scalar(*isI)) {
+      w->update();
+    }
+  }
+
+  // input strings...
+  QStringList istr = ptr->inputStringList();
+  for (QStringList::ConstIterator istrI = istr.begin(); istrI != istr.end(); ++istrI) {
+    if (StringSelector *w = string(*istrI)) {
+      w->update();
+    }
+  }
+}
+
+
 void KstBasicDialogI::fillFieldsForEdit() {
-
   KstBasicPluginPtr ptr = kst_cast<KstBasicPlugin>(_dp);
   if (!ptr)
     return; //shouldn't happen
--- branches/work/kst/1.5/kst/src/libkstapp/kstbasicdialog_i.h #664784:664785
@@ -39,6 +39,7 @@
     static KstBasicDialogI *globalInstance();
 
   public slots:
+    void updateForm();
     virtual void update();
     virtual bool newObject();
     virtual bool editObject();