X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fbatch_job_view.cc;h=06f6988746707900e58d09a82b766a90da2fbe23;hb=2a616640a07662410d6e5f986a692281fdc3c744;hp=853dac8f4adf1912a6d5f819aee0645cf4937737;hpb=1d18c62021664f4cac43b5930ee435f8ba177545;p=dcpomatic.git diff --git a/src/wx/batch_job_view.cc b/src/wx/batch_job_view.cc index 853dac8f4..06f698874 100644 --- a/src/wx/batch_job_view.cc +++ b/src/wx/batch_job_view.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2017 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,13 +18,17 @@ */ + #include "batch_job_view.h" +#include "dcpomatic_button.h" #include "lib/job_manager.h" #include #include + using std::list; -using boost::shared_ptr; +using std::shared_ptr; + BatchJobView::BatchJobView (shared_ptr job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table) : JobView (job, parent, container, table) @@ -32,41 +36,47 @@ BatchJobView::BatchJobView (shared_ptr job, wxWindow* parent, wxWindow* con } + int BatchJobView::insert_position () const { return _table->GetEffectiveRowsCount() * _table->GetEffectiveColsCount(); } + void BatchJobView::finish_setup (wxWindow* parent, wxSizer* sizer) { - _higher_priority = new wxButton (parent, wxID_ANY, _("Higher priority")); - _higher_priority->Bind (wxEVT_BUTTON, boost::bind (&BatchJobView::higher_priority_clicked, this)); + _higher_priority = new Button (parent, _("Higher priority")); + _higher_priority->Bind (wxEVT_BUTTON, boost::bind(&BatchJobView::higher_priority_clicked, this)); sizer->Add (_higher_priority, 1, wxALIGN_CENTER_VERTICAL); - _lower_priority = new wxButton (parent, wxID_ANY, _("Lower priority")); - _lower_priority->Bind (wxEVT_BUTTON, boost::bind (&BatchJobView::lower_priority_clicked, this)); + _lower_priority = new Button (parent, _("Lower priority")); + _lower_priority->Bind (wxEVT_BUTTON, boost::bind(&BatchJobView::lower_priority_clicked, this)); sizer->Add (_lower_priority, 1, wxALIGN_CENTER_VERTICAL); } + + void BatchJobView::higher_priority_clicked () { JobManager::instance()->increase_priority (_job); } + void BatchJobView::lower_priority_clicked () { JobManager::instance()->decrease_priority (_job); } + void BatchJobView::job_list_changed () { bool high = false; bool low = false; - list > jobs = JobManager::instance()->get(); - if (!jobs.empty ()) { + auto jobs = JobManager::instance()->get(); + if (!jobs.empty()) { if (_job != jobs.front()) { high = true; }