#include "job_manager_view.h"
#include "wx_util.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using boost::shared_ptr;
/** Must be called in the GUI thread */
JobManagerView::JobManagerView (wxWindow* parent)
_table->Insert (index, m, 0, wxALIGN_CENTER_VERTICAL | wxALL, 6);
JobRecord r;
+ r.finalised = false;
r.gauge = new wxGauge (_panel, wxID_ANY, 100);
_table->Insert (index + 1, r.gauge, 1, wxEXPAND | wxLEFT | wxRIGHT);
- r.informed_of_finish = false;
r.message = new wxStaticText (_panel, wxID_ANY, std_to_wx (""));
_table->Insert (index + 2, r.message, 1, wxALIGN_CENTER_VERTICAL | wxALL, 6);
}
}
- /* Hack to work around our lack of cross-thread
- signalling; we tell the job to emit_finished()
- from here (the GUI thread).
- */
-
- if ((*i)->finished () && !_job_records[*i].informed_of_finish) {
+ if ((*i)->finished() && !_job_records[*i].finalised) {
_job_records[*i].gauge->SetValue (100);
_job_records[*i].message->SetLabel (std_to_wx (st));
-
- try {
- (*i)->emit_finished ();
- } catch (OpenFileError& e) {
- error_dialog (this, String::compose ("Error: %1", e.what ()));
- }
-
- _job_records[*i].informed_of_finish = true;
+ _job_records[*i].finalised = true;
}
index += 3;