Add FilmViewer::time_until_next_frame.
[dcpomatic.git] / src / wx / job_view_dialog.cc
index e629cce626a4771f9c3d7ce0511fed86a824474e..a49818cc8c5d420fc48a4d72dfe13478451270a0 100644 (file)
 */
 
 #include "job_view_dialog.h"
-#include "job_view.h"
+#include "normal_job_view.h"
+#include "lib/job.h"
 
 using boost::shared_ptr;
 
 JobViewDialog::JobViewDialog (wxWindow* parent, wxString title, shared_ptr<Job> job)
        : TableDialog (parent, title, 4, 0, false)
+       , _job (job)
 {
-       _view = new JobView (job, this, this, _table, true);
+       _view = new NormalJobView (job, this, this, _table);
+       _view->setup ();
        layout ();
        SetMinSize (wxSize (960, -1));
 
        Bind (wxEVT_TIMER, boost::bind (&JobViewDialog::periodic, this));
        _timer.reset (new wxTimer (this));
        _timer->Start (1000);
+
+       /* Start off with OK disabled and it will be enabled when the job is finished */
+       wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
+       if (ok) {
+               ok->Enable (false);
+       }
 }
 
 JobViewDialog::~JobViewDialog ()
@@ -44,4 +53,10 @@ void
 JobViewDialog::periodic ()
 {
        _view->maybe_pulse ();
+
+       shared_ptr<Job> job = _job.lock ();
+       wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
+       if (job && ok) {
+               ok->Enable (job->finished ());
+       }
 }