summaryrefslogtreecommitdiff
path: root/src/wx/job_manager_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-23 23:17:36 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-23 23:17:36 +0000
commit68f662ac50a00ad986e3bd258c3f7daac374ab26 (patch)
tree2b8d4d7050ea1cd594997198fe05f3f4bbf57c21 /src/wx/job_manager_view.cc
parenta3c4945f77fa8e7123c30026654cb86e99343f50 (diff)
Hand-apply 111f02f4fc8ace359a16aea1c88c2821bf3dde31 from master; improve progress reporting when scanning a file for length.
Diffstat (limited to 'src/wx/job_manager_view.cc')
-rw-r--r--src/wx/job_manager_view.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc
index b62d44d07..fd3ea6bf7 100644
--- a/src/wx/job_manager_view.cc
+++ b/src/wx/job_manager_view.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -88,7 +88,7 @@ public:
void maybe_pulse ()
{
- if (_job->running() && _job->progress_unknown ()) {
+ if (_job->running() && !_job->progress ()) {
_gauge->Pulse ();
}
}
@@ -110,14 +110,11 @@ private:
void progress ()
{
- float const p = _job->progress ();
- if (p >= 0) {
- checked_set (_message, _job->status ());
- update_job_name ();
- int const pp = min (100.0f, p * 100);
- _gauge->SetValue (pp);
- }
-
+ checked_set (_message, _job->status ());
+ update_job_name ();
+ if (_job->progress ()) {
+ _gauge->SetValue (min (100.0f, _job->progress().get() * 100));
+ }
_table->Layout ();
_window->FitInside ();
}