diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-08-26 11:19:34 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-08-26 11:19:34 +0100 |
| commit | cb2546eaf5e2f109ca5309f3dc04e6c17b8037e5 (patch) | |
| tree | 3f1e2e897a6090dae55101c42e22405f87e4f29f /src/wx/kdm_dialog.cc | |
| parent | 4f8442947b0c35fd50cb58e99036ba4d45e1d12e (diff) | |
Confirm sending of KDM emails.
Diffstat (limited to 'src/wx/kdm_dialog.cc')
| -rw-r--r-- | src/wx/kdm_dialog.cc | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index b5ebd1e96..40efc5411 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -24,12 +24,15 @@ #include "kdm_timing_panel.h" #include "kdm_output_panel.h" #include "kdm_cpl_panel.h" +#include "confirm_kdm_email_dialog.h" #include "lib/film.h" #include "lib/screen.h" #include "lib/screen_kdm.h" #include "lib/send_kdm_email_job.h" #include "lib/job_manager.h" #include "lib/cinema_kdms.h" +#include "lib/config.h" +#include "lib/cinema.h" #include <libcxml/cxml.h> #include <dcp/exceptions.h> #include <wx/treectrl.h> @@ -148,15 +151,36 @@ KDMDialog::make_clicked () } if (_output->email ()) { - JobManager::instance()->add ( - shared_ptr<Job> (new SendKDMEmailJob ( - CinemaKDMs::collect (screen_kdms), - _output->name_format(), - name_values, - film->dcp_name(), - film->log() - )) - ); + + list<CinemaKDMs> const cinema_kdms = CinemaKDMs::collect (screen_kdms); + + bool ok = true; + + if (Config::instance()->confirm_kdm_email ()) { + list<string> emails; + BOOST_FOREACH (CinemaKDMs i, cinema_kdms) { + BOOST_FOREACH (string j, i.cinema->emails) { + emails.push_back (j); + } + } + + ConfirmKDMEmailDialog* d = new ConfirmKDMEmailDialog (this, emails); + if (d->ShowModal() == wxID_CANCEL) { + ok = false; + } + } + + if (ok) { + JobManager::instance()->add ( + shared_ptr<Job> (new SendKDMEmailJob ( + cinema_kdms, + _output->name_format(), + name_values, + film->dcp_name(), + film->log() + )) + ); + } } } catch (dcp::NotEncryptedError& e) { error_dialog (this, _("CPL's content is not encrypted.")); |
