X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fjob_manager_view.cc;h=7cfcf3423ce9d2fdaba23d90290a1920011c32a9;hb=f8678dcae5f90eb946ad6e51d9a62e0c02bc63e3;hp=b627edc2f31be8b7cc20b71a503bf90765f35787;hpb=290daefb79ec399cf7ba54968fc7e92e375e98d6;p=dcpomatic.git diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc index b627edc2f..7cfcf3423 100644 --- a/src/wx/job_manager_view.cc +++ b/src/wx/job_manager_view.cc @@ -31,6 +31,7 @@ using std::string; using std::list; using std::map; +using std::min; using std::cout; using boost::shared_ptr; using boost::weak_ptr; @@ -46,11 +47,14 @@ public: { int n = 0; - wxStaticText* m = new wxStaticText (panel, wxID_ANY, std_to_wx (_job->name ())); - table->Insert (n, m, 0, wxALIGN_CENTER_VERTICAL | wxALL, 6); + _name = new wxStaticText (panel, wxID_ANY, ""); + _name->SetLabelMarkup ("" + _job->name () + ""); + table->Insert (n, _name, 0, wxALIGN_CENTER_VERTICAL | wxALL, 6); ++n; _gauge = new wxGauge (panel, wxID_ANY, 100); + /* This seems to be required to allow the gauge to shrink under OS X */ + _gauge->SetMinSize (wxSize (0, -1)); table->Insert (n, _gauge, 1, wxEXPAND | wxLEFT | wxRIGHT); ++n; @@ -94,10 +98,16 @@ private: void progress () { - float const p = _job->overall_progress (); + float const p = _job->progress (); if (p >= 0) { checked_set (_message, _job->status ()); - _gauge->SetValue (p * 100); + string const n = "" + _job->name () + "\n" + _job->sub_name (); + if (n != _last_name) { + _name->SetLabelMarkup (std_to_wx (n)); + _last_name = n; + } + int const pp = min (100.0f, p * 100); + _gauge->SetValue (pp); } _table->Layout (); @@ -147,11 +157,13 @@ private: wxScrolledWindow* _window; wxPanel* _panel; wxFlexGridSizer* _table; + wxStaticText* _name; wxGauge* _gauge; wxStaticText* _message; wxButton* _cancel; wxButton* _pause; wxButton* _details; + std::string _last_name; }; /** Must be called in the GUI thread */