From f29f405000752ad568de1e304640a4edac8214bc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 7 Oct 2015 17:11:31 +0100 Subject: Basics of job view when sending KDM emails from dcpomatic_kdm. --- src/tools/dcpomatic_kdm.cc | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/tools') diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index 5972b6c0f..dd2c09bb0 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -25,6 +25,7 @@ #include "wx/screens_panel.h" #include "wx/kdm_timing_panel.h" #include "wx/kdm_output_panel.h" +#include "wx/job_view_dialog.h" #include "lib/config.h" #include "lib/util.h" #include "lib/screen.h" @@ -61,6 +62,7 @@ public: DOMFrame (wxString const & title) : wxFrame (NULL, -1, title) , _config_dialog (0) + , _job_view (0) { wxMenuBar* bar = new wxMenuBar; setup_menu (bar); @@ -270,14 +272,20 @@ private: wxString::Format (s, int(screen_kdms.size()), std_to_wx(_output->directory().string()).data()) ); } else { - JobManager::instance()->add ( - shared_ptr (new SendKDMEmailJob ( - decrypted.annotation_text(), - decrypted.content_title_text(), - _timing->from(), _timing->until(), - CinemaKDMs::collect (screen_kdms) - )) - ); + shared_ptr job (new SendKDMEmailJob ( + decrypted.annotation_text(), + decrypted.content_title_text(), + _timing->from(), _timing->until(), + CinemaKDMs::collect (screen_kdms) + )); + + JobManager::instance()->add (job); + if (_job_view) { + _job_view->Destroy (); + _job_view = 0; + } + _job_view = new JobViewDialog (this, _("Send KDM emails"), job); + _job_view->ShowModal (); } } catch (dcp::NotEncryptedError& e) { error_dialog (this, _("CPL's content is not encrypted.")); @@ -308,6 +316,7 @@ private: wxStaticText* _issue_date; wxButton* _create; KDMOutputPanel* _output; + JobViewDialog* _job_view; }; /** @class App -- cgit v1.2.3