- _scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
-
- _store = Gtk::TreeStore::create (_columns);
- _view.set_model (_store);
- _view.append_column ("Name", _columns.name);
-
- Gtk::CellRendererProgress* r = Gtk::manage (new Gtk::CellRendererProgress ());
- int const n = _view.append_column ("Progress", *r);
- Gtk::TreeViewColumn* c = _view.get_column (n - 1);
- c->add_attribute (r->property_value(), _columns.progress);
- c->add_attribute (r->property_pulse(), _columns.progress_unknown);
- c->add_attribute (r->property_text(), _columns.text);
-
- _scroller.add (_view);
- _scroller.set_size_request (-1, 150);
-
- update ();
-}
+public:
+ JobRecord (shared_ptr<Job> job, wxScrolledWindow* window, wxPanel* panel, wxFlexGridSizer* table)
+ : _job (job)
+ , _window (window)
+ , _panel (panel)
+ {
+ int n = 0;
+
+ wxBoxSizer* gauge_message = new wxBoxSizer (wxVERTICAL);
+ _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));
+ gauge_message->Add (_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT);
+ _message = new wxStaticText (panel, wxID_ANY, wxT (" \n "), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
+ gauge_message->Add (_message, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
+ table->Insert (n, gauge_message, 1, wxEXPAND | wxLEFT | wxRIGHT);
+ ++n;
+
+ _cancel = new wxButton (panel, wxID_ANY, _("Cancel"));
+ _cancel->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobRecord::cancel_clicked, this);
+ table->Insert (n, _cancel, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3);
+ ++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, 3);
+ ++n;
+
+ _details = new wxButton (_panel, wxID_ANY, _("Details..."));
+ _details->Bind (wxEVT_COMMAND_BUTTON_CLICKED, &JobRecord::details_clicked, this);
+ _details->Enable (false);
+ table->Insert (n, _details, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3);
+ ++n;
+
+ _progress_connection = job->Progress.connect (boost::bind (&JobRecord::progress, this));
+ _finished_connection = job->Finished.connect (boost::bind (&JobRecord::finished, this));
+
+ table->Layout ();
+ }