Extract common code out into kdm_for_screen()
[dcpomatic.git] / src / wx / normal_job_view.cc
index 2ae6a014034ef7d274ef1fe9270666e911914a15..ada0596c82b978a5b5a15af19c5c621727e0e697 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -19,6 +19,7 @@
 */
 
 #include "normal_job_view.h"
+#include "dcpomatic_button.h"
 #include "lib/job.h"
 #include <wx/wx.h>
 
@@ -34,8 +35,8 @@ NormalJobView::NormalJobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* c
 void
 NormalJobView::finish_setup (wxWindow* parent, wxSizer* sizer)
 {
-       _pause = new wxButton (parent, wxID_ANY, _("Pause"));
-       _pause->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&NormalJobView::pause_clicked, this));
+       _pause = new Button (parent, _("Pause"));
+       _pause->Bind (wxEVT_BUTTON, boost::bind (&NormalJobView::pause_clicked, this));
        sizer->Add (_pause, 1, wxALIGN_CENTER_VERTICAL);
 }
 
@@ -48,11 +49,11 @@ NormalJobView::insert_position () const
 void
 NormalJobView::pause_clicked ()
 {
-       if (_job->paused()) {
+       if (_job->paused_by_user()) {
                _job->resume ();
                _pause->SetLabel (_("Pause"));
        } else {
-               _job->pause ();
+               _job->pause_by_user ();
                _pause->SetLabel (_("Resume"));
        }
 }