Commit cdf47978514a0f12b199cf5aa8b07c2a7f44311e

Authored by Scott Klum
1 parent 5e7ee449

Reverted to the old progress display

openbr/gui/progress.cpp
... ... @@ -27,7 +27,7 @@ br::Progress::Progress(QWidget *parent)
27 27 void br::Progress::checkProgress()
28 28 {
29 29 const int progress = 100 * br_progress();
30   - const bool visible = progress >= 0 && progress < 100;
  30 + const bool visible = progress > 0 && progress < 100;
31 31  
32 32 if (visible) {
33 33 showMessage(Globals->mostRecentMessage);
... ...
openbr/openbr_plugin.cpp
... ... @@ -937,7 +937,7 @@ void br::Context::printStatus()
937 937 const float p = progress();
938 938 if (p < 1) {
939 939 int s = timeRemaining();
940   - fprintf(stderr,"\r%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g/%g", p*100, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(s).toStdString().c_str(), Globals->currentProgress, Globals->totalSteps);
  940 + fprintf(stderr,"\r%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g", p*100, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(s).toStdString().c_str(), Globals->currentStep);
941 941 fflush(stderr);
942 942 }
943 943 }
... ...
openbr/openbr_plugin.h
... ... @@ -696,6 +696,9 @@ public:
696 696 * \brief Used internally to compute progress() and timeRemaining().
697 697 */
698 698  
  699 + Q_PROPERTY(double currentStep READ get_currentStep WRITE set_currentStep RESET reset_currentStep)
  700 + BR_PROPERTY(double, currentStep, 0)
  701 +
699 702 Q_PROPERTY(double currentProgress READ get_currentProgress WRITE set_currentProgress RESET reset_currentProgress)
700 703 BR_PROPERTY(double, currentProgress, 0)
701 704  
... ...
openbr/plugins/misc.cpp
... ... @@ -663,6 +663,8 @@ class ProgressCounterTransform : public TimeVaryingTransform
663 663 Globals->currentProgress = dst[i].file.get<qint64>("progress",0)+1;
664 664 dst[i].file.remove("progress");
665 665 last_frame = frame;
  666 +
  667 + Globals->currentStep++;
666 668 }
667 669 }
668 670  
... ... @@ -684,10 +686,12 @@ class ProgressCounterTransform : public TimeVaryingTransform
684 686 {
685 687 (void) data;
686 688 float p = br_progress();
687   - Globals->currentProgress = totalProgress;
688   - qDebug("\r%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g/%g", p*100, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(0).toStdString().c_str(), Globals->currentProgress, Globals->totalSteps);
  689 + qDebug("\r%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g", p*100, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(0).toStdString().c_str(), Globals->currentStep);
689 690 timer.start();
690 691 Globals->startTime.start();
  692 + Globals->currentStep = 0;
  693 + Globals->currentProgress = 0;
  694 + Globals->totalSteps = totalProgress;
691 695 }
692 696  
693 697 void init()
... ... @@ -695,6 +699,7 @@ class ProgressCounterTransform : public TimeVaryingTransform
695 699 timer.start();
696 700 Globals->startTime.start();
697 701 Globals->currentProgress = 0;
  702 + Globals->currentStep = 0;
698 703 Globals->totalSteps = totalProgress;
699 704 }
700 705  
... ...