[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Thu Sep 23 01:32:48 CEST 2004


CVS commit by arwalker: 

This should make the PSD curve the same color as the data curve.
It also make the PSD point style the same as the data point style (if applicable).
I think this now closes 83943, with Bath's earlier fix.

CCMAIL: 83943-done at bugs.kde.org


  M +15 -5     datawizard.ui.h   1.87


--- kdeextragear-2/kst/kst/datawizard.ui.h  #1.86:1.87
@@ -385,4 +385,6 @@ void DataWizard::finished()
     KstVectorList l;
     QString name = QString("V%1-%2").arg(KST::vectorList.count()).arg(_xVector->currentText());
+    QValueList<QColor> colors;
+    QColor color;
     uint n_curves = 0;
     uint n_steps = 0;
@@ -533,6 +535,7 @@ void DataWizard::finished()
         if (_radioButtonPlotData->isChecked() || _radioButtonPlotDataPSD->isChecked()) {
             name = KST::suggestCurveName((*it)->tagName());
-            KstBaseCurvePtr c = new KstVCurve(name, xv, *it, 0L, 0L,
-                    KstColorSequence::next(static_cast<Kst2DPlot*>((*pit).data())->Curves,static_cast<Kst2DPlot*>((*pit).data())->backgroundColor()));
+      color = KstColorSequence::next(static_cast<Kst2DPlot*>((*pit).data())->Curves,static_cast<Kst2DPlot*>((*pit).data())->backgroundColor());
+      colors.append(color);
+      KstBaseCurvePtr c = new KstVCurve(name, xv, *it, 0L, 0L, color);
             if (_drawBoth->isChecked()) {
                 c->setHasPoints(true);
@@ -577,6 +580,8 @@ void DataWizard::finished()
     // create the PSDs...
     //
-    if (_radioButtonPlotPSD->isChecked() ||
-                                _radioButtonPlotDataPSD->isChecked()) {
+    if (_radioButtonPlotPSD->isChecked() || _radioButtonPlotDataPSD->isChecked()) {
+      KstVCurvePtr c;
+      int indexColor = 0;
+      ptype = 0;
         app->slotUpdateProgress(n_steps, prg, i18n("Creating PSDs..."));
         
@@ -593,5 +598,10 @@ void DataWizard::finished()
                         _kstFFTOptions->VectorUnits->text(),
                         _kstFFTOptions->RateUnits->text());
-                KstVCurvePtr c = new KstVCurve(name + "-curve", p->vX(), p->vY(), 0L, 0L, KstColorSequence::next(static_cast<Kst2DPlot*>((*pit).data())->Curves,static_cast<Kst2DPlot*>((*pit).data())->backgroundColor()));
+      if (_radioButtonPlotPSD->isChecked() || colors.count() <= indexColor) {
+                    c = new KstVCurve(name + "-curve", p->vX(), p->vY(), 0L, 0L, KstColorSequence::next(static_cast<Kst2DPlot*>((*pit).data())->Curves,static_cast<Kst2DPlot*>((*pit).data())->backgroundColor()));
+      } else {
+                    c = new KstVCurve(name + "-curve", p->vX(), p->vY(), 0L, 0L, colors[indexColor]);
+        indexColor++;
+      }
                 if (_drawBoth->isChecked()) {
                     c->setHasPoints(true);





More information about the Kst mailing list