[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Sun Mar 20 18:45:59 CET 2005


CVS commit by staikos: 

Kst is now safe for processing events in this manner (we do it elsewhere too).
No need for these classes anymore.  Also hide the progress bar when we're done
with it.


  M +0 -2      Makefile.am   1.183
  M +12 -2     kst.cpp   1.295
  M +4 -4      kst.h   1.127
  R            kstquicklabel.cpp   1.2
  R            kstquicklabel.h   1.2
  R            kstquickprogressbar.cpp   1.4
  R            kstquickprogressbar.h   1.3


--- kdeextragear-2/kst/kst/Makefile.am  #1.182:1.183
@@ -110,6 +110,4 @@
         kstplotdrag.cpp \
         kstplotimagedrag.cpp \
-        kstquickprogressbar.cpp \
-        kstquicklabel.cpp \
         kstscalartable.cpp \
         kstvectortable.cpp \

--- kdeextragear-2/kst/kst/kst.cpp  #1.294:1.295
@@ -33,4 +33,5 @@
 #include <kmessagebox.h>
 #include <kprinter.h>
+#include <kprogress.h>
 #include <kstandarddirs.h>
 #include <kstatusbar.h>
@@ -743,12 +744,13 @@ void KstApp::initStatusBar() {
   statusBar()->addWidget(_dataBar, 5, true);
 
-  _readyBar = new KstQuickLabel(i18n("Almost Ready"), statusBar());
+  _readyBar = new QLabel(i18n("Almost Ready"), statusBar());
   _readyBar->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
   statusBar()->addWidget(_readyBar, 5, true);
 
-  _progressBar = new KstQuickProgressBar(statusBar());
+  _progressBar = new KProgress(statusBar());
   _progressBar->setPercentageVisible(false);
   _progressBar->setCenterIndicator(true);
   statusBar()->addWidget(_progressBar, 2, true);
+  _progressBar->hide();
 
 #ifdef HAVE_LINUX
@@ -1337,4 +1339,10 @@ void KstApp::slotUpdateDataMsg(const QSt
 
 void KstApp::slotUpdateProgress(int total, int step, const QString &msg) {
+  if (step == 0 && msg.isNull()) {
+    _progressBar->hide();
+    return;
+  }
+
+  _progressBar->show();
   if (step > 0) {
     if (!_progressBar->percentageVisible()) {
@@ -1357,4 +1365,6 @@ void KstApp::slotUpdateProgress(int tota
     _readyBar->setText(msg);
   }
+
+  kapp->eventLoop()->processEvents(QEventLoop::ExcludeSocketNotifiers, 10);
 }
 

--- kdeextragear-2/kst/kst/kst.h  #1.126:1.127
@@ -30,6 +30,4 @@
 #include "kst2dplot.h"
 #include "ksteventmonitorentry.h"
-#include "kstquickprogressbar.h"
-#include "kstquicklabel.h"
 
 enum LegendType { LegendOn, LegendOff, LegendAuto };
@@ -59,4 +57,6 @@ class VectorSaveDialog;
 class QLabel;
 class QProgressBar;
+class KProgress;
+
 
 class KstOpen {
@@ -476,6 +476,6 @@ class KstApp : public KMdiMainFrm {
     KToggleAction *viewStatusBar;
 
-    KstQuickLabel *_readyBar;
-    KstQuickProgressBar *_progressBar;
+    QLabel *_readyBar;
+    KProgress *_progressBar;
     QLabel *_memoryBar, *_dataBar;
     bool _stopping;




More information about the Kst mailing list