X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fkdm_output_panel.cc;h=96b97b1636be1acc06cf933dcc84cbc50531b201;hb=d0188ed3e1ea5536e729e93b87d54114368120ac;hp=ec2182c36a1e2f2fd79ae3d44e3adae75dcbbba6;hpb=c7d1f6e7988888811fdac36c465919f170a06c7a;p=dcpomatic.git diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc index ec2182c36..96b97b163 100644 --- a/src/wx/kdm_output_panel.cc +++ b/src/wx/kdm_output_panel.cc @@ -22,6 +22,7 @@ #include "check_box.h" #include "confirm_kdm_email_dialog.h" #include "dcpomatic_button.h" +#include "extra_kdm_email_dialog.h" #include "kdm_advanced_dialog.h" #include "kdm_choice.h" #include "kdm_output_panel.h" @@ -31,25 +32,26 @@ #include "lib/cinema.h" #include "lib/config.h" #include "lib/send_kdm_email_job.h" -#include "lib/warnings.h" #include #include +#include #ifdef DCPOMATIC_USE_OWN_PICKER #include "dir_picker_ctrl.h" #else -DCPOMATIC_DISABLE_WARNINGS +LIBDCP_DISABLE_WARNINGS #include -DCPOMATIC_ENABLE_WARNINGS +LIBDCP_ENABLE_WARNINGS #endif -DCPOMATIC_DISABLE_WARNINGS +LIBDCP_DISABLE_WARNINGS #include -DCPOMATIC_ENABLE_WARNINGS +LIBDCP_ENABLE_WARNINGS using std::exception; using std::function; using std::list; using std::make_pair; +using std::make_shared; using std::pair; using std::shared_ptr; using std::string; @@ -72,7 +74,7 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent) auto type = new wxBoxSizer (wxHORIZONTAL); _type = new KDMChoice (this); type->Add (_type, 1, wxTOP, DCPOMATIC_CHOICE_TOP_PAD); - _type->SetSelection (0); + _type->set(Config::instance()->default_kdm_type()); auto advanced = new Button (this, _("Advanced...")); type->Add (advanced, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP); table->Add (type, 1, wxTOP, DCPOMATIC_CHOICE_TOP_PAD); @@ -135,7 +137,8 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent) _email = new CheckBox (this, _("Send by email")); table->Add (_email, 1, wxEXPAND); - table->AddSpacer (0); + auto add_email_addresses = new wxButton(this, wxID_ANY, _("Set additional email addresses...")); + table->Add (add_email_addresses); switch (Config::instance()->last_kdm_write_type().get_value_or(Config::KDM_WRITE_FLAT)) { case Config::KDM_WRITE_FLAT: @@ -152,8 +155,9 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent) _write_to->SetValue (Config::instance()->write_kdms_to_disk()); _email->SetValue (Config::instance()->email_kdms()); - _write_to->Bind (wxEVT_CHECKBOX, boost::bind (&KDMOutputPanel::write_to_changed, this)); - _email->Bind (wxEVT_CHECKBOX, boost::bind (&KDMOutputPanel::email_changed, this)); + _write_to->bind(&KDMOutputPanel::write_to_changed, this); + _email->bind(&KDMOutputPanel::email_changed, this); + add_email_addresses->Bind (wxEVT_BUTTON, boost::bind(&KDMOutputPanel::add_email_addresses_clicked, this)); _write_flat->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::kdm_write_type_changed, this)); _write_folder->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::kdm_write_type_changed, this)); _write_zip->Bind (wxEVT_RADIOBUTTON, boost::bind (&KDMOutputPanel::kdm_write_type_changed, this)); @@ -301,13 +305,12 @@ KDMOutputPanel::make ( } if (_email->GetValue ()) { - job.reset ( - new SendKDMEmailJob ( - cinema_kdms, - _container_name_format->get(), - _filename_format->get(), - name - ) + job = make_shared( + cinema_kdms, + _container_name_format->get(), + _filename_format->get(), + name, + _extra_addresses ); } @@ -335,3 +338,15 @@ KDMOutputPanel::directory () const { return wx_to_std (_folder->GetPath ()); } + + +void +KDMOutputPanel::add_email_addresses_clicked () +{ + auto dialog = new ExtraKDMEmailDialog (this, _extra_addresses); + if (dialog->ShowModal() == wxID_OK) { + _extra_addresses = dialog->get(); + } + dialog->Destroy(); +} +