Reverse order of jobs in the batch converter view.
authorCarl Hetherington <cth@carlh.net>
Fri, 30 Sep 2016 09:42:30 +0000 (10:42 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 30 Sep 2016 09:42:30 +0000 (10:42 +0100)
ChangeLog
src/tools/dcpomatic.cc
src/tools/dcpomatic_batch.cc
src/wx/job_manager_view.cc
src/wx/job_manager_view.h
src/wx/job_view.cc
src/wx/job_view.h
src/wx/job_view_dialog.cc

index ad3447b9a9de3f00f88e7c28f38c3d68eabe7179..366b854332403fdb405c83593f73e51d38ce630b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-09-30  c.hetherington  <cth@carlh.net>
+
+       * Order jobs from first-to-execute to last in the batch converter.
+
 2016-09-28  c.hetherington  <cth@carlh.net>
 
        * Fix crash on "report a problem" in the KDM creator.
index 6c16457af95844ce07849c41679fc3927120e850..cb4927ad033b940fc12a89db5b313c92917844de 100644 (file)
@@ -245,7 +245,7 @@ public:
 
                _film_viewer = new FilmViewer (overall_panel);
                _film_editor = new FilmEditor (overall_panel, _film_viewer);
-               JobManagerView* job_manager_view = new JobManagerView (overall_panel);
+               JobManagerView* job_manager_view = new JobManagerView (overall_panel, false);
 
                wxBoxSizer* right_sizer = new wxBoxSizer (wxVERTICAL);
                right_sizer->Add (_film_viewer, 2, wxEXPAND | wxALL, 6);
index 9e2d6969d9c2c39ce2a1d5d7111c412490545279..64eb46af2c2813de29acc96a04e534fe147e3e70 100644 (file)
@@ -109,7 +109,7 @@ public:
                s->Add (panel, 1, wxEXPAND);
                SetSizer (s);
 
-               JobManagerView* job_manager_view = new JobManagerView (panel);
+               JobManagerView* job_manager_view = new JobManagerView (panel, false);
                _sizer->Add (job_manager_view, 1, wxALL | wxEXPAND, 6);
 
                wxSizer* buttons = new wxBoxSizer (wxHORIZONTAL);
index cd6918b7268e730c7a93d4e8d1a796293c7cadf9..dcef5f4fd24d374bf0cda9ca538d1100590565a1 100644 (file)
@@ -40,9 +40,15 @@ using std::cout;
 using boost::shared_ptr;
 using boost::weak_ptr;
 
-/** Must be called in the GUI thread */
-JobManagerView::JobManagerView (wxWindow* parent)
+/** @param parent Parent window.
+ *  @param latest_at_top true to put the last-added job at the top of the view,
+ *  false to put it at the bottom.
+ *
+ *  Must be called in the GUI thread.
+ */
+JobManagerView::JobManagerView (wxWindow* parent, bool latest_at_top)
        : wxScrolledWindow (parent)
+       , _latest_at_top (latest_at_top)
 {
        _panel = new wxPanel (this);
        wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
@@ -68,7 +74,7 @@ JobManagerView::job_added (weak_ptr<Job> j)
 {
        shared_ptr<Job> job = j.lock ();
        if (job) {
-               _job_records.push_back (shared_ptr<JobView> (new JobView (job, this, _panel, _table)));
+               _job_records.push_back (shared_ptr<JobView> (new JobView (job, this, _panel, _table, _latest_at_top)));
        }
 }
 
index 7624678c2be691aadc5871700cad63660d36823c..d887718d34b0f18eea8e3fdd6a53e448cfa74581 100644 (file)
@@ -35,7 +35,7 @@ class JobView;
 class JobManagerView : public wxScrolledWindow
 {
 public:
-       JobManagerView (wxWindow *);
+       JobManagerView (wxWindow *, bool latest_at_top);
 
 private:
        void job_added (boost::weak_ptr<Job>);
@@ -44,6 +44,7 @@ private:
        wxPanel* _panel;
        wxFlexGridSizer* _table;
        boost::shared_ptr<wxTimer> _timer;
+       bool _latest_at_top;
 
        std::list<boost::shared_ptr<JobView> > _job_records;
 };
index 136b18ed39fb75eedf782e1b2ac1caae171a7a2f..83d3159b09dcd15b90d5c19a2cad1717e1e662d0 100644 (file)
@@ -28,11 +28,12 @@ using std::string;
 using std::min;
 using boost::shared_ptr;
 
-JobView::JobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table)
+/** @param top Put this view at the top of table, otherwise put it at the bottom */
+JobView::JobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table, bool top)
        : _job (job)
        , _parent (parent)
 {
-       int n = 0;
+       int n = top ? 0 : (table->GetEffectiveRowsCount() * table->GetEffectiveColsCount());
 
        _gauge_message = new wxBoxSizer (wxVERTICAL);
        _gauge = new wxGauge (container, wxID_ANY, 100);
index ee254f2a4edd5fa5fcfaaadd1eadfafb77a1db9f..96233f7322b5e78b1d113eb7c1ba870e750eff49 100644 (file)
@@ -35,7 +35,7 @@ class wxButton;
 class JobView : public boost::noncopyable
 {
 public:
-       JobView (boost::shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table);
+       JobView (boost::shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table, bool top);
 
        void maybe_pulse ();
 
index b4dcd271f18af35584705c6932613b3acd8409d3..e629cce626a4771f9c3d7ce0511fed86a824474e 100644 (file)
@@ -26,7 +26,7 @@ using boost::shared_ptr;
 JobViewDialog::JobViewDialog (wxWindow* parent, wxString title, shared_ptr<Job> job)
        : TableDialog (parent, title, 4, 0, false)
 {
-       _view = new JobView (job, this, this, _table);
+       _view = new JobView (job, this, this, _table, true);
        layout ();
        SetMinSize (wxSize (960, -1));