[Kst] [Bug 120331] More options to memorize in datawizard

Andrew Walker arwalker at sumusltd.com
Thu Mar 16 19:42:04 CET 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=120331         
arwalker sumusltd com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From arwalker sumusltd com  2006-03-16 19:42 -------
SVN commit 519273 by arwalker:

BUG:120331 Remember more settings. This can be modified as necessary for later UI changes.

 M  +2 -0      datawizard.ui  
 M  +105 -0    datawizard.ui.h  


--- trunk/extragear/graphics/kst/src/libkstapp/datawizard.ui #519272:519273
 @ -1369,6 +1369,8  @
     <function returnType="bool">xVectorOk()</function>
     <function returnType="bool">yVectorsOk()</function>
     <function>showPage( QWidget * page )</function>
+    <function>loadSettings()</function>
+    <function>saveSettings()</function>
 </functions>
 <pixmapinproject/>
 <layoutdefaults spacing="6" margin="11"/>
--- trunk/extragear/graphics/kst/src/libkstapp/datawizard.ui.h #519272:519273
 @ -53,6 +53,8  @
     _xVectorExisting->setEnabled(false);
     _xVectorExisting->_newVector->hide();
     _xVectorExisting->_editVector->hide();
+    
+    loadSettings();
 }
 
 
 @ -484,6 +486,8  @
     int ptype = 0;
     int prg = 0;
   
+    saveSettings();
+    
     KstDataSourcePtr ds = *KST::dataSourceList.findReusableFileName(_file);
     if (!ds) {
 	ds = KstDataSource::loadSource(_file);
 @ -1028,4 +1032,105  @
     sourceChanged(_url->url());
 }
 
+void DataWizard::saveSettings()
+{
+  KConfig cfg("kstrc", false, false);
+
+  cfg.setGroup("DataWizard");
+
+  cfg.writeEntry("PlotXY", _radioButtonPlotData->isChecked());
+  cfg.writeEntry("PlotPS", _radioButtonPlotPSD->isChecked());
+  cfg.writeEntry("PlotBoth", _radioButtonPlotDataPSD->isChecked());
+  
+  cfg.writeEntry("XCreate", _xAxisCreateFromField->isChecked());
+  cfg.writeEntry("XFieldCreate", _xVector->currentText());
+  cfg.writeEntry("XExists", _xAxisUseExisting->isChecked());
+  cfg.writeEntry("XFieldExists", _xVectorExisting->selectedVector());
+  
+  cfg.writeEntry("Lines", _drawLines->isChecked());
+  cfg.writeEntry("Points", _drawPoints->isChecked());
+  cfg.writeEntry("Both", _drawBoth->isChecked());
+  
+  cfg.writeEntry("LogX", _psdLogX->isChecked());
+  cfg.writeEntry("LogY", _psdLogY->isChecked());
+  cfg.writeEntry("XAxisLabel", _xAxisLabels->isChecked());
+  cfg.writeEntry("YAxisLabel", _yAxisLabels->isChecked());
+  cfg.writeEntry("TitleLabel", _plotTitles->isChecked());
+  
+  cfg.writeEntry("LegendsOn", _legendsOn->isChecked());
+  cfg.writeEntry("LegendsOff", _legendsOff->isChecked());
+  cfg.writeEntry("LegendsAuto", _legendsAuto->isChecked());
+  
+  cfg.writeEntry("OnePlot", _onePlot->isChecked());
+  cfg.writeEntry("MultiplePlots", _multiplePlots->isChecked());
+  cfg.writeEntry("CycleThrough", _cycleThrough->isChecked());
+  cfg.writeEntry("CycleExisting", _cycleExisting->isChecked());
+  cfg.writeEntry("PlotNumber", _plotNumber->value());
+}
+
+
+void DataWizard::loadSettings()
+{
+  KConfig cfg("kstrc");
+  QListBoxItem* pItem;
+  QString str;
+  
+  cfg.setGroup("DataWizard");
+    
+  if (cfg.readBoolEntry("PlotXY", true)) {
+    _radioButtonPlotData->setChecked(true);
+  } else if (cfg.readBoolEntry("PlotPS", true)) {
+    _radioButtonPlotPSD->setChecked(true);
+  } else {
+    _radioButtonPlotDataPSD->setChecked(true);
+  }
+  
+  if (cfg.readBoolEntry("XCreate", true) || _xVectorExisting->_vector->count() == 0) {
+    _xAxisCreateFromField->setChecked(true);
+    str = cfg.readEntry("XFieldCreate", "");
+    if (_xVector->listBox()) {
+      pItem = _xVector->listBox()->findItem(str, Qt::ExactMatch);
+      if (pItem) {
+        _xVector->listBox()->setSelected(pItem, true);
+      }
+    }
+  } else {
+    _xAxisUseExisting->setChecked(true);
+    str = cfg.readEntry("XFieldExists", "");
+    if (_xVectorExisting->_vector->listBox()) {
+      if (_xVectorExisting->_vector->listBox()->findItem(str, Qt::ExactMatch)) {
+        _xVectorExisting->setSelection(str);
+      }
+    }
+  }
+  
+  if (cfg.readBoolEntry("Lines", true)) {
+    _drawLines->setChecked(true);
+  } else if (cfg.readBoolEntry("Points", true)) {
+    _drawPoints->setChecked(true);
+  } else {
+    _drawBoth->setChecked(true);
+  }
+  
+  _psdLogX->setChecked( cfg.readBoolEntry("LogX", false));
+  _psdLogY->setChecked( cfg.readBoolEntry("LogY", false));
+  _xAxisLabels->setChecked( cfg.readBoolEntry("XAxisLabel", true));
+  _yAxisLabels->setChecked( cfg.readBoolEntry("YAxisLabel", true));
+  _plotTitles->setChecked( cfg.readBoolEntry("TitleLabel", true));
+  
+  if (cfg.readBoolEntry("LegendsAuto", true)) {
+    _legendsAuto->setChecked(true);
+  } else if(cfg.readBoolEntry("LegendsOn", true)) {
+    _legendsOn->setChecked(true);
+  } else {
+    _legendsOff->setChecked(true);
+  }
+
+  _onePlot->setChecked(cfg.readBoolEntry("OnePlot", true));
+  _multiplePlots->setChecked(cfg.readBoolEntry("MultiplePlots", false));
+  _cycleThrough->setChecked(cfg.readBoolEntry("CycleThrough", false));
+  _cycleExisting->setChecked(cfg.readBoolEntry("CycleExisting", false));
+  _plotNumber->setValue(cfg.readNumEntry("PlotNumber", 2));
+}
+
 // vim: ts=8 sw=4 noet


More information about the Kst mailing list