This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- JobRecord (shared_ptr<Job> job, wxScrolledWindow* window, wxPanel* panel, wxFlexGridSizer* table, bool pause)
+ JobRecord (shared_ptr<Job> job, wxScrolledWindow* window, wxPanel* panel, wxFlexGridSizer* table)
table->Insert (n, _name, 0, wxALIGN_CENTER_VERTICAL | wxALL, 6);
++n;
table->Insert (n, _name, 0, wxALIGN_CENTER_VERTICAL | wxALL, 6);
++n;
table->Insert (n, _cancel, 1, wxALIGN_CENTER_VERTICAL | wxALL, 6);
++n;
table->Insert (n, _cancel, 1, wxALIGN_CENTER_VERTICAL | wxALL, 6);
++n;
- if (pause) {
- _pause = new wxButton (_panel, wxID_ANY, _("Pause"));
- _pause->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobRecord::pause_clicked, this);
- table->Insert (n, _pause, 1, wxALIGN_CENTER_VERTICAL | wxALL, 6);
- ++n;
- }
+ _pause = new wxButton (_panel, wxID_ANY, _("Pause"));
+ _pause->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobRecord::pause_clicked, this);
+ table->Insert (n, _pause, 1, wxALIGN_CENTER_VERTICAL | wxALL, 6);
+ ++n;
_details = new wxButton (_panel, wxID_ANY, _("Details..."));
_details->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobRecord::details_clicked, this);
_details = new wxButton (_panel, wxID_ANY, _("Details..."));
_details->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobRecord::details_clicked, this);
- float const p = _job->progress ();
- if (p >= 0) {
- checked_set (_message, _job->status ());
- update_job_name ();
- int const pp = min (100.0f, p * 100);
- _gauge->SetValue (pp);
- }
-
+ checked_set (_message, _job->status ());
+ update_job_name ();
+ if (_job->progress ()) {
+ _gauge->SetValue (min (100.0f, _job->progress().get() * 100));
+ }
{
_panel = new wxPanel (this);
wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
sizer->Add (_panel, 1, wxEXPAND);
SetSizer (sizer);
{
_panel = new wxPanel (this);
wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
sizer->Add (_panel, 1, wxEXPAND);
SetSizer (sizer);
_table->AddGrowableCol (1, 1);
_panel->SetSizer (_table);
SetScrollRate (0, 32);
_table->AddGrowableCol (1, 1);
_panel->SetSizer (_table);
SetScrollRate (0, 32);
Bind (wxEVT_TIMER, boost::bind (&JobManagerView::periodic, this));
_timer.reset (new wxTimer (this));
_timer->Start (1000);
Bind (wxEVT_TIMER, boost::bind (&JobManagerView::periodic, this));
_timer.reset (new wxTimer (this));
_timer->Start (1000);
- _job_records.push_back (shared_ptr<JobRecord> (new JobRecord (job, this, _panel, _table, _buttons & PAUSE)));
+ _job_records.push_back (shared_ptr<JobRecord> (new JobRecord (job, this, _panel, _table)));