X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fjob_view_dialog.cc;h=3d900e1d3e8d84a17abab8266d4b66b9bf7d0369;hb=e72a69ac2ebf24df05ba4b6de65bfa338a58b0ec;hp=455998c5cab002bccfea7550a0018b652ce6b102;hpb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;p=dcpomatic.git diff --git a/src/wx/job_view_dialog.cc b/src/wx/job_view_dialog.cc index 455998c5c..3d900e1d3 100644 --- a/src/wx/job_view_dialog.cc +++ b/src/wx/job_view_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2015 Carl Hetherington + Copyright (C) 2015-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,12 +18,15 @@ */ + #include "job_view_dialog.h" #include "normal_job_view.h" #include "lib/job.h" + using std::shared_ptr; + JobViewDialog::JobViewDialog (wxWindow* parent, wxString title, shared_ptr job) : TableDialog (parent, title, 4, 0, false) , _job (job) @@ -33,29 +36,31 @@ JobViewDialog::JobViewDialog (wxWindow* parent, wxString title, shared_ptr layout (); SetMinSize (wxSize (960, -1)); - Bind (wxEVT_TIMER, boost::bind (&JobViewDialog::periodic, this)); - _timer.reset (new wxTimer (this)); + Bind (wxEVT_TIMER, boost::bind(&JobViewDialog::periodic, this)); + _timer.reset (new wxTimer(this)); _timer->Start (1000); /* Start off with OK disabled and it will be enabled when the job is finished */ - wxButton* ok = dynamic_cast (FindWindowById (wxID_OK, this)); + auto ok = dynamic_cast(FindWindowById(wxID_OK, this)); if (ok) { ok->Enable (false); } } + JobViewDialog::~JobViewDialog () { delete _view; } + void JobViewDialog::periodic () { _view->maybe_pulse (); - shared_ptr job = _job.lock (); - wxButton* ok = dynamic_cast (FindWindowById (wxID_OK, this)); + auto job = _job.lock (); + auto ok = dynamic_cast(FindWindowById(wxID_OK, this)); if (job && ok) { ok->Enable (job->finished ()); }