summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-01-31 19:39:27 +0000
committerCarl Hetherington <cth@carlh.net>2019-01-31 19:39:27 +0000
commit0fb8f8c4ec481e342d26a332595d39fcf8cd4e94 (patch)
tree1c2315afe0351d182a4bf858e2f964d337785c16 /src
parentd31bb9dd64630718fe7faa607e61be7ba88e9097 (diff)
parent9fa17d52810490359f899cc0cbdb4c25ac74bc92 (diff)
Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
Diffstat (limited to 'src')
-rw-r--r--src/lib/dcpomatic_socket.h1
-rw-r--r--src/lib/film.cc25
-rw-r--r--src/lib/film.h3
-rw-r--r--src/tools/dcpomatic.cc6
-rw-r--r--src/wx/config_dialog.cc51
-rw-r--r--src/wx/config_dialog.h3
6 files changed, 63 insertions, 26 deletions
diff --git a/src/lib/dcpomatic_socket.h b/src/lib/dcpomatic_socket.h
index 6f7c05e22..870e7315c 100644
--- a/src/lib/dcpomatic_socket.h
+++ b/src/lib/dcpomatic_socket.h
@@ -19,6 +19,7 @@
*/
#include <boost/asio.hpp>
+#include <boost/noncopyable.hpp>
/** @class Socket
* @brief A class to wrap a boost::asio::ip::tcp::socket with some things
diff --git a/src/lib/film.cc b/src/lib/film.cc
index f4745d099..e7861a032 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -1220,6 +1220,31 @@ Film::playlist_change (ChangeType type)
{
signal_change (type, CONTENT);
signal_change (type, NAME);
+
+ if (type == CHANGE_TYPE_DONE) {
+ /* Check that this change hasn't made our settings inconsistent */
+ bool change_made = false;
+ BOOST_FOREACH (shared_ptr<Content> i, content()) {
+ shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i);
+ if (!d) {
+ continue;
+ }
+
+ string why_not;
+ if (d->reference_video() && !d->can_reference_video(shared_from_this(), why_not)) {
+ d->set_reference_video(false);
+ change_made = true;
+ }
+ if (d->reference_audio() && !d->can_reference_audio(shared_from_this(), why_not)) {
+ d->set_reference_audio(false);
+ change_made = true;
+ }
+ }
+
+ if (change_made) {
+ Message (_("DCP-o-matic had to change your settings for referring to DCPs as OV. Please review those settings to make sure they are what you want."));
+ }
+ }
}
void
diff --git a/src/lib/film.h b/src/lib/film.h
index 7fdd4d269..b77ce7a76 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -334,6 +334,9 @@ public:
/** Emitted when some property of our content has changed */
mutable boost::signals2::signal<void (ChangeType, boost::weak_ptr<Content>, int, bool)> ContentChange;
+ /** Emitted when we have something important to tell the user */
+ boost::signals2::signal<void (std::string)> Message;
+
/** Current version number of the state file */
static int const current_state_version;
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 2e8a595ad..db3d22052 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -457,6 +457,7 @@ public:
}
if (_film) {
_film->Change.connect (boost::bind (&DOMFrame::film_change, this, _1));
+ _film->Message.connect (boost::bind(&DOMFrame::film_message, this, _1));
}
}
@@ -466,6 +467,11 @@ public:
private:
+ void film_message (string m)
+ {
+ message_dialog (this, std_to_wx(m));
+ }
+
void film_change (ChangeType type)
{
if (type == CHANGE_TYPE_DONE) {
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index 8b6d215a2..13a405670 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -408,6 +408,8 @@ CertificateChainEditor::CertificateChainEditor (
_button_sizer = new wxBoxSizer (wxHORIZONTAL);
_remake_certificates = new Button (this, _("Re-make certificates and key..."));
_button_sizer->Add (_remake_certificates, 1, wxRIGHT, border);
+ _export_chain = new Button (this, _("Export chain..."));
+ _button_sizer->Add (_export_chain, 1, wxRIGHT, border);
table->Add (_button_sizer, wxGBPosition (r, 0), wxGBSpan (1, 4));
++r;
@@ -424,6 +426,7 @@ CertificateChainEditor::CertificateChainEditor (
_certificates->Bind (wxEVT_LIST_ITEM_SELECTED, bind (&CertificateChainEditor::update_sensitivity, this));
_certificates->Bind (wxEVT_LIST_ITEM_DESELECTED, bind (&CertificateChainEditor::update_sensitivity, this));
_remake_certificates->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::remake_certificates, this));
+ _export_chain->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::export_chain, this));
_import_private_key->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::import_private_key, this));
_export_private_key->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::export_private_key, this));
@@ -543,6 +546,29 @@ CertificateChainEditor::export_certificate ()
}
void
+CertificateChainEditor::export_chain ()
+{
+ wxFileDialog* d = new wxFileDialog (
+ this, _("Select Chain File"), wxEmptyString, wxEmptyString, wxT("PEM files (*.pem)|*.pem"),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT
+ );
+
+ if (d->ShowModal () == wxID_OK) {
+ boost::filesystem::path path (wx_to_std(d->GetPath()));
+ FILE* f = fopen_boost (path, "w");
+ if (!f) {
+ throw OpenFileError (path, errno, false);
+ }
+
+ string const s = _get()->chain();
+ checked_fwrite (s.c_str(), s.length(), f, path);
+ fclose (f);
+ }
+
+ d->Destroy ();
+}
+
+void
CertificateChainEditor::update_certificate_list ()
{
_certificates->DeleteAllItems ();
@@ -737,8 +763,6 @@ KeysPage::setup ()
wxButton* export_decryption_certificate = new Button (_panel, _("Export KDM decryption certificate..."));
sizer->Add (export_decryption_certificate, 0, wxLEFT, _border);
- wxButton* export_decryption_chain = new Button (_panel, _("Export KDM decryption chain..."));
- sizer->Add (export_decryption_chain, 0, wxLEFT, _border);
wxButton* export_settings = new Button (_panel, _("Export all KDM decryption settings..."));
sizer->Add (export_settings, 0, wxLEFT, _border);
wxButton* import_settings = new Button (_panel, _("Import all KDM decryption settings..."));
@@ -747,7 +771,6 @@ KeysPage::setup ()
sizer->Add (decryption_advanced, 0, wxALL, _border);
export_decryption_certificate->Bind (wxEVT_BUTTON, bind (&KeysPage::export_decryption_certificate, this));
- export_decryption_chain->Bind (wxEVT_BUTTON, bind (&KeysPage::export_decryption_chain, this));
export_settings->Bind (wxEVT_BUTTON, bind (&KeysPage::export_decryption_chain_and_key, this));
import_settings->Bind (wxEVT_BUTTON, bind (&KeysPage::import_decryption_chain_and_key, this));
decryption_advanced->Bind (wxEVT_BUTTON, bind (&KeysPage::decryption_advanced, this));
@@ -868,28 +891,6 @@ KeysPage::nag_remake_decryption_chain ()
}
void
-KeysPage::export_decryption_chain ()
-{
- wxFileDialog* d = new wxFileDialog (
- _panel, _("Select Chain File"), wxEmptyString, _("dcpomatic_kdm_decryption_chain.pem"), wxT ("PEM files (*.pem)|*.pem"),
- wxFD_SAVE | wxFD_OVERWRITE_PROMPT
- );
-
- if (d->ShowModal () == wxID_OK) {
- boost::filesystem::path path (wx_to_std(d->GetPath()));
- FILE* f = fopen_boost (path, "w");
- if (!f) {
- throw OpenFileError (path, errno, false);
- }
-
- string const s = Config::instance()->decryption_chain()->chain();
- checked_fwrite (s.c_str(), s.length(), f, path);
- fclose (f);
- }
- d->Destroy ();
-}
-
-void
KeysPage::export_decryption_certificate ()
{
wxFileDialog* d = new wxFileDialog (
diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h
index 3b8762d8b..896b463d8 100644
--- a/src/wx/config_dialog.h
+++ b/src/wx/config_dialog.h
@@ -135,6 +135,7 @@ private:
void update_private_key ();
void import_private_key ();
void export_private_key ();
+ void export_chain ();
wxListCtrl* _certificates;
wxButton* _add_certificate;
@@ -144,6 +145,7 @@ private:
wxStaticText* _private_key;
wxButton* _import_private_key;
wxButton* _export_private_key;
+ wxButton* _export_chain;
wxStaticText* _private_key_bad;
wxSizer* _sizer;
wxBoxSizer* _button_sizer;
@@ -173,7 +175,6 @@ private:
void setup ();
void export_decryption_certificate ();
- void export_decryption_chain ();
void config_changed () {}
bool nag_remake_decryption_chain ();
void decryption_advanced ();