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

Andrew Walker arwalker at sumusltd.com
Fri Jan 18 22:33:57 CET 2008


SVN commit 763203 by arwalker:

BUG:156138 Update vector and scalar lists in custom plugin dialogs when a new vector or scalar is created

 M  +4 -1      binnedmap/binnedmapdialog_i.cpp  
 M  +12 -5     crossspectrum/crossspectrumdialog_i.cpp  


--- branches/work/kst/1.6/kst/src/plugins/binnedmap/binnedmapdialog_i.cpp #763202:763203
@@ -66,6 +66,7 @@
   connect(this, SIGNAL(modified()), _w->_Y, SLOT(update()));
   connect(this, SIGNAL(modified()), _w->_Z, SLOT(update()));
   connect(_w->_AutoBin, SIGNAL(clicked()), this, SLOT(fillAutoRange()));
+  connect(KstApp::inst()->document(), SIGNAL(updateDialogs()), this, SLOT(update()));
 }
 
 
@@ -74,7 +75,9 @@
 
 
 void BinnedMapDialogI::update() {
-  //called upon showing the dialog either in 'edit' mode or 'new' mode
+  _w->_X->update();
+  _w->_Y->update();
+  _w->_Z->update();
 }
 
 
--- branches/work/kst/1.6/kst/src/plugins/crossspectrum/crossspectrumdialog_i.cpp #763202:763203
@@ -61,6 +61,7 @@
   connect(_w->_v2, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
   connect(_w->_fft, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
   connect(_w->_sample, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
+  connect(KstApp::inst()->document(), SIGNAL(updateDialogs()), this, SLOT(update()));
 
   _w->_fft->allowDirectEntry( true );
   _w->_sample->allowDirectEntry( true );
@@ -72,7 +73,10 @@
 
 
 void CrossSpectrumDialogI::update() {
-  //called upon showing the dialog either in 'edit' mode or 'new' mode
+  _w->_v1->update();
+  _w->_v2->update();
+  _w->_fft->update();
+  _w->_sample->update();
 }
 
 
@@ -89,7 +93,9 @@
 
   //Need to create a new object rather than use the one in KstDataObject pluginList
   CrossPowerSpectrumPtr cps = kst_cast<CrossPowerSpectrum>(KstDataObject::createPlugin("Cross Power Spectrum"));
-  Q_ASSERT(cps); //should never happen...
+  if (!cps) {
+    return false;
+  }
 
   KstWriteLocker pl(cps);
 
@@ -125,9 +131,10 @@
 
 
 bool CrossSpectrumDialogI::editObject() {
-  //called upon clicking 'ok' in 'edit' mode
-  //return false if the specified objects can't be editted, otherwise true
-
+  //
+  // called upon clicking 'ok' in 'edit' mode
+  // return false if the specified objects can't be edited, otherwise true
+  //
   CrossPowerSpectrumPtr cps = kst_cast<CrossPowerSpectrum>(_dp);
   if (!cps) {
     return false;


More information about the Kst mailing list