Use String::compose in a few places.
[dcpomatic.git] / src / wx / job_manager_view.cc
index c9e120135af557f449ad80c10be6ab8f57f633fc..97da3936fdd4b96e1e4ba547fe7bdcd407aacfbd 100644 (file)
@@ -67,15 +67,21 @@ JobManagerView::update ()
 {
        list<shared_ptr<Job> > jobs = JobManager::instance()->get ();
 
+       int index = 0;
+
        for (list<shared_ptr<Job> >::iterator i = jobs.begin(); i != jobs.end(); ++i) {
                
                if (_job_records.find (*i) == _job_records.end ()) {
-                       add_label_to_sizer (_table, _panel, (*i)->name ());
+                       wxStaticText* m = new wxStaticText (_panel, wxID_ANY, std_to_wx ((*i)->name ()));
+                       _table->Insert (index, m, 0, wxALIGN_CENTER_VERTICAL | wxALL, 6);
+                       
                        JobRecord r;
                        r.gauge = new wxGauge (_panel, wxID_ANY, 100);
-                       _table->Add (r.gauge, 1, wxEXPAND | wxLEFT | wxRIGHT);
+                       _table->Insert (index + 1, r.gauge, 1, wxEXPAND | wxLEFT | wxRIGHT);
+                       
                        r.informed_of_finish = false;
-                       r.message = add_label_to_sizer (_table, _panel, "", 1);
+                       r.message = new wxStaticText (_panel, wxID_ANY, std_to_wx (""));
+                       _table->Insert (index + 2, r.message, 1, wxALIGN_CENTER_VERTICAL | wxALL, 6);
                        
                        _job_records[*i] = r;
                }
@@ -105,13 +111,13 @@ JobManagerView::update ()
                        try {
                                (*i)->emit_finished ();
                        } catch (OpenFileError& e) {
-                               stringstream s;
-                               s << "Error: " << e.what();
-                               error_dialog (this, s.str ());
+                               error_dialog (this, String::compose ("Error: %1", e.what ()));
                        }
                        
                        _job_records[*i].informed_of_finish = true;
                }
+
+               index += 3;
        }
 
        _table->Layout ();