[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Thu Jul 15 23:59:06 CEST 2004


CVS commit by arwalker: 

Provide smoother progress bar.


  M +16 -3     datawizard.ui.h   1.60


--- kdeextragear-2/kst/kst/datawizard.ui.h  #1.59:1.60
@@ -446,7 +446,20 @@ void DataWizard::finished()
     int ptype = 0;
     uint n_curves = 0;
+    uint n_steps = 0;
+
+    // count the number steps we're about to take through the progress bar...
+    QListViewItemIterator itSteps(_vectors);
+    while (itSteps.current()) {
+        QCheckListItem *i = static_cast<QCheckListItem*>(itSteps.current());
+        if (i->isOn()) {
+    n_steps++;
+  }
+        ++itSteps;
+  }
+  n_steps *= 2;  
 
     dlg->setAllowCancel(false);
-    dlg->progressBar()->setTotalSteps(2 * _vectors->childCount());
+    dlg->progressBar()->setTotalSteps(n_steps);
+    dlg->progressBar()->setPercentageVisible(true);
     dlg->progressBar()->setProgress(0);
     dlg->setLabel(i18n("Creating curves and plots..."));
@@ -480,6 +493,6 @@ void DataWizard::finished()
             }
             n_curves++;
-        }
         dlg->progressBar()->setProgress(++prg);
+        }
         ++it;
     }





More information about the Kst mailing list