Add option to export config as a .zip (#1776).
[dcpomatic.git] / src / wx / job_view.cc
index 2754948ae609c0c2283f903714946649f180d673..06d10401f578c23a980fc92279aceea1d380930b 100644 (file)
@@ -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> 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 ();
+               }
        }
 }
 
@@ -151,12 +153,12 @@ JobView::finished ()
        }
 
        if (_job->message()) {
-               MessageDialog* d = new MessageDialog (_parent, _job->name(), _job->message().get());
+               auto d = new MessageDialog (_parent, std_to_wx(_job->name()), std_to_wx(_job->message().get()));
                d->ShowModal ();
                d->Destroy ();
        }
 
-       if ((dynamic_pointer_cast<TranscodeJob>(_job) || dynamic_pointer_cast<AnalyseAudioJob>(_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);
                }