+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.
_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);
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);
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);
{
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)));
}
}
class JobManagerView : public wxScrolledWindow
{
public:
- JobManagerView (wxWindow *);
+ JobManagerView (wxWindow *, bool latest_at_top);
private:
void job_added (boost::weak_ptr<Job>);
wxPanel* _panel;
wxFlexGridSizer* _table;
boost::shared_ptr<wxTimer> _timer;
+ bool _latest_at_top;
std::list<boost::shared_ptr<JobView> > _job_records;
};
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);
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 ();
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));