X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fkdm_dialog.cc;h=40efc5411e61bfac248e8a181ecb386552d2e1a4;hb=3bc7c343d4e13a2d0498ae92dbc99b292f5ea322;hp=ef7912ee3c2adf2133672779aba63148d751209c;hpb=fbe2784c136fa1550815babfce89589f66b35a29;p=dcpomatic.git diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index ef7912ee3..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 #include #include @@ -55,7 +58,7 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr film) wxBoxSizer* left = new wxBoxSizer (wxVERTICAL); wxBoxSizer* right = new wxBoxSizer (wxVERTICAL); - horizontal->Add (left, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_X_GAP * 2); + horizontal->Add (left, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_X_GAP * 4); horizontal->Add (right, 1, wxEXPAND); /* Font for sub-headings */ @@ -145,16 +148,39 @@ KDMDialog::make_clicked () _output->name_format(), name_values ); - } else { - JobManager::instance()->add ( - shared_ptr (new SendKDMEmailJob ( - CinemaKDMs::collect (screen_kdms), - _output->name_format(), - name_values, - film->dcp_name(), - film->log() - )) - ); + } + + if (_output->email ()) { + + list const cinema_kdms = CinemaKDMs::collect (screen_kdms); + + bool ok = true; + + if (Config::instance()->confirm_kdm_email ()) { + list 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 (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."));