Try a bit of backwards compatibility in state file.
[dcpomatic.git] / src / wx / job_manager_view.cc
index 97da3936fdd4b96e1e4ba547fe7bdcd407aacfbd..9c70405846cc1587baf8e3fcfd350a4bfd2267df 100644 (file)
@@ -28,8 +28,9 @@
 #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)
@@ -76,10 +77,10 @@ JobManagerView::update ()
                        _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);
                        
@@ -99,22 +100,10 @@ JobManagerView::update ()
                        }
                }
                
-               /* 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;