X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fjob_view.cc;h=06d10401f578c23a980fc92279aceea1d380930b;hb=bfcfda264d12e42facce6f59e7cada9574ca7f2e;hp=231176e4fd96c773d1f96a779de648647f0ddf3a;hpb=6485b4cb7afb020a8a4e8ff1a5b36544d25595a8;p=dcpomatic.git diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc index 231176e4f..06d10401f 100644 --- a/src/wx/job_view.cc +++ b/src/wx/job_view.cc @@ -40,7 +40,6 @@ using std::string; using std::min; using std::shared_ptr; using boost::bind; -using std::dynamic_pointer_cast; JobView::JobView (shared_ptr job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table) @@ -103,8 +102,11 @@ JobView::setup () void JobView::maybe_pulse () { - if (_gauge && _job->running() && !_job->progress()) { - _gauge->Pulse (); + if (_gauge && _job->running()) { + auto elapsed = _job->seconds_since_last_progress_update(); + if (!_job->progress() || !elapsed || *elapsed > 2) { + _gauge->Pulse (); + } } } @@ -156,7 +158,7 @@ JobView::finished () d->Destroy (); } - if ((dynamic_pointer_cast(_job) || dynamic_pointer_cast(_job)) && _notify->GetValue()) { + if (_job->enable_notify() && _notify->GetValue()) { if (Config::instance()->notification(Config::MESSAGE_BOX)) { wxMessageBox (std_to_wx(_job->name() + ": " + _job->status()), _("DCP-o-matic"), wxICON_INFORMATION); }