summaryrefslogtreecommitdiff
path: root/src/wx/job_manager_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-10-19 15:41:41 +0100
committerCarl Hetherington <cth@carlh.net>2013-10-19 15:41:41 +0100
commit11325f810e214935e4115248223c186a6e4cc184 (patch)
treeb529056e5f0001cccb0621f31a3bed5d4f43e2da /src/wx/job_manager_view.cc
parent6543d9a51b31ce24726187d9d1b018f05f09ef40 (diff)
Some improvements in progress reporting, especially for long jobs.
Diffstat (limited to 'src/wx/job_manager_view.cc')
-rw-r--r--src/wx/job_manager_view.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc
index a95087b02..bd0554f45 100644
--- a/src/wx/job_manager_view.cc
+++ b/src/wx/job_manager_view.cc
@@ -46,8 +46,9 @@ 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 ("<b>" + _job->name () + "</b>");
+ table->Insert (n, _name, 0, wxALIGN_CENTER_VERTICAL | wxALL, 6);
++n;
_gauge = new wxGauge (panel, wxID_ANY, 100);
@@ -96,9 +97,14 @@ private:
void progress ()
{
- float const p = _job->overall_progress ();
+ float const p = _job->progress ();
if (p >= 0) {
checked_set (_message, _job->status ());
+ string const n = "<b>" + _job->name () + "</b>\n" + _job->sub_name ();
+ if (n != _last_name) {
+ _name->SetLabelMarkup (std_to_wx (n));
+ _last_name = n;
+ }
_gauge->SetValue (p * 100);
}
@@ -149,11 +155,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 */