summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-27 20:28:18 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-27 20:28:18 +0100
commit65a73ce59aeb4b452f55a87c001acb3cf177e99f (patch)
tree3421211f5573f877e14d3b090e762abf49629fc0 /src/wx
parentc0d2b454ea1e8c9b047907343c902d72101ef6dd (diff)
parent9ce33a007d305cec0ebb91dc4839d0d2a05837ab (diff)
Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/about_dialog.cc1
-rw-r--r--src/wx/confirm_kdm_email_dialog.cc62
-rw-r--r--src/wx/confirm_kdm_email_dialog.h31
-rw-r--r--src/wx/kdm_dialog.cc42
-rw-r--r--src/wx/wscript1
5 files changed, 128 insertions, 9 deletions
diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc
index 46231d242..e29844693 100644
--- a/src/wx/about_dialog.cc
+++ b/src/wx/about_dialog.cc
@@ -148,6 +148,7 @@ AboutDialog::AboutDialog (wxWindow* parent)
supported_by.Add (wxT ("Nathan Carpenter"));
supported_by.Add (wxT ("Matt Carter"));
supported_by.Add (wxT ("Frank Cianciolo"));
+ supported_by.Add (wxT ("Central Cinema"));
supported_by.Add (wxT ("Cinema Clarici"));
supported_by.Add (wxT ("Adam Colt"));
supported_by.Add (wxT ("Adam Cousins"));
diff --git a/src/wx/confirm_kdm_email_dialog.cc b/src/wx/confirm_kdm_email_dialog.cc
new file mode 100644
index 000000000..69ee7feec
--- /dev/null
+++ b/src/wx/confirm_kdm_email_dialog.cc
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "confirm_kdm_email_dialog.h"
+#include "wx_util.h"
+#include "lib/config.h"
+#include "lib/cinema_kdms.h"
+#include <boost/foreach.hpp>
+
+using std::list;
+using std::string;
+
+ConfirmKDMEmailDialog::ConfirmKDMEmailDialog (wxWindow* parent, list<string> emails)
+ : wxDialog (parent, wxID_ANY, _("Confirm KDM email"))
+{
+ wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
+
+ wxString message = _("Are you sure you want to send emails to the following addresses?\n\n");
+ BOOST_FOREACH (string i, emails) {
+ message += "\t" + std_to_wx (i) + "\n";
+ }
+
+ sizer->Add (new wxStaticText (this, wxID_ANY, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
+
+ wxCheckBox* shut_up = new wxCheckBox (this, wxID_ANY, _("Don't ask this again"));
+ sizer->Add (shut_up, 0, wxALL, DCPOMATIC_DIALOG_BORDER);
+
+ shut_up->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, bind (&ConfirmKDMEmailDialog::shut_up, this, _1));
+
+ wxStdDialogButtonSizer* buttons = CreateStdDialogButtonSizer (0);
+ sizer->Add (CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder());
+ buttons->SetAffirmativeButton (new wxButton (this, wxID_OK, _("Send emails")));
+ buttons->SetNegativeButton (new wxButton (this, wxID_CANCEL, _("Don't send emails")));
+ buttons->Realize ();
+
+ SetSizer (sizer);
+ sizer->Layout ();
+ sizer->SetSizeHints (this);
+}
+
+void
+ConfirmKDMEmailDialog::shut_up (wxCommandEvent& ev)
+{
+ Config::instance()->set_confirm_kdm_email (!ev.IsChecked ());
+}
diff --git a/src/wx/confirm_kdm_email_dialog.h b/src/wx/confirm_kdm_email_dialog.h
new file mode 100644
index 000000000..84182ad93
--- /dev/null
+++ b/src/wx/confirm_kdm_email_dialog.h
@@ -0,0 +1,31 @@
+/*
+ Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <wx/wx.h>
+#include <list>
+
+class ConfirmKDMEmailDialog : public wxDialog
+{
+public:
+ ConfirmKDMEmailDialog (wxWindow* parent, std::list<std::string> addresses);
+
+private:
+ void shut_up (wxCommandEvent& ev);
+};
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."));
diff --git a/src/wx/wscript b/src/wx/wscript
index f89b60c40..e001c51b7 100644
--- a/src/wx/wscript
+++ b/src/wx/wscript
@@ -34,6 +34,7 @@ sources = """
cinema_dialog.cc
colour_conversion_editor.cc
config_dialog.cc
+ confirm_kdm_email_dialog.cc
content_colour_conversion_dialog.cc
content_menu.cc
content_panel.cc