Job progress tidy-ups.
authorCarl Hetherington <cth@carlh.net>
Mon, 5 Nov 2012 13:52:01 +0000 (13:52 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 5 Nov 2012 13:52:01 +0000 (13:52 +0000)
src/lib/transcode_job.cc
src/wx/job_manager_view.cc
src/wx/job_manager_view.h

index db4fb86e1304482e1e63b98337743274778c2210..25581c8f5dd8df4a6cfa67d9bbaef27c1ae3edbf 100644 (file)
@@ -98,7 +98,12 @@ TranscodeJob::status () const
 
        stringstream s;
 
-       s << Job::status () << "; " << fixed << setprecision (1) << fps << " frames per second";
+       s << Job::status ();
+
+       if (!finished ()) {
+               s << "; " << fixed << setprecision (1) << fps << " frames per second";
+       }
+       
        return s.str ();
 }
 
index bd28862319aa956bb074e2523f74587d94966011..9c70405846cc1587baf8e3fcfd350a4bfd2267df 100644 (file)
@@ -77,6 +77,7 @@ 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);
                        
@@ -99,9 +100,10 @@ JobManagerView::update ()
                        }
                }
                
-               if ((*i)->finished()) {
+               if ((*i)->finished() && !_job_records[*i].finalised) {
                        _job_records[*i].gauge->SetValue (100);
                        _job_records[*i].message->SetLabel (std_to_wx (st));
+                       _job_records[*i].finalised = true;
                }
 
                index += 3;
index b10446cdda4f7d215df9b152e3f3ab1cbfd879e6..5c10890ef01391966c9131af3de312e25eb9bceb 100644 (file)
@@ -46,6 +46,7 @@ private:
        struct JobRecord {
                wxGauge* gauge;
                wxStaticText* message;
+               bool finalised;
        };
                
        std::map<boost::shared_ptr<Job>, JobRecord> _job_records;