summaryrefslogtreecommitdiff
path: root/src/wx/job_view_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-05-01 01:31:35 +0200
committerCarl Hetherington <cth@carlh.net>2021-05-01 01:31:35 +0200
commit8963f0007af1a312017b9627c18b82ec2a577591 (patch)
treebaeb6f2c17da72248408b8c1d695242b44edda9e /src/wx/job_view_dialog.cc
parent29f84e2b8785585885e0658bdf9938967547460f (diff)
C++11 tidying.
Diffstat (limited to 'src/wx/job_view_dialog.cc')
-rw-r--r--src/wx/job_view_dialog.cc17
1 files changed, 11 insertions, 6 deletions
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 <cth@carlh.net>
+ Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
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> job)
: TableDialog (parent, title, 4, 0, false)
, _job (job)
@@ -33,29 +36,31 @@ JobViewDialog::JobViewDialog (wxWindow* parent, wxString title, shared_ptr<Job>
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<wxButton *> (FindWindowById (wxID_OK, this));
+ auto ok = dynamic_cast<wxButton *>(FindWindowById(wxID_OK, this));
if (ok) {
ok->Enable (false);
}
}
+
JobViewDialog::~JobViewDialog ()
{
delete _view;
}
+
void
JobViewDialog::periodic ()
{
_view->maybe_pulse ();
- shared_ptr<Job> job = _job.lock ();
- wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
+ auto job = _job.lock ();
+ auto ok = dynamic_cast<wxButton *>(FindWindowById(wxID_OK, this));
if (job && ok) {
ok->Enable (job->finished ());
}