summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-07 21:16:41 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-07 21:16:41 +0100
commitccc093b159c61e811e24f427860b72343185681e (patch)
treea39e0a3859175e969e7accb788dc82d71c4cb5df /src
parent5c9e39df078aab9f03ae186d0758d4d710f90bab (diff)
Add export button for cinemas XML (#1319).
Diffstat (limited to 'src')
-rw-r--r--src/wx/full_config_dialog.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc
index c371239b7..1ea07404a 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -103,6 +103,8 @@ private:
add_label_to_sizer (table, _panel, _("Cinema and screen database file"), true, wxGBPosition (r, 0));
_cinemas_file = new FilePickerCtrl (_panel, _("Select cinema and screen database file"), "*.xml", true);
table->Add (_cinemas_file, wxGBPosition (r, 1));
+ wxButton* export_cinemas = new wxButton (_panel, wxID_ANY, _("Export..."));
+ table->Add (export_cinemas, wxGBPosition (r, 2));
++r;
add_play_sound_controls (table, r);
@@ -140,6 +142,7 @@ private:
_master_encoding_threads->Bind (wxEVT_SPINCTRL, boost::bind (&FullGeneralPage::master_encoding_threads_changed, this));
_server_encoding_threads->SetRange (1, 128);
_server_encoding_threads->Bind (wxEVT_SPINCTRL, boost::bind (&FullGeneralPage::server_encoding_threads_changed, this));
+ export_cinemas->Bind (wxEVT_BUTTON, boost::bind (&FullGeneralPage::export_cinemas_file, this));
#ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
_analyse_ebur128->Bind (wxEVT_CHECKBOX, boost::bind (&FullGeneralPage::analyse_ebur128_changed, this));
@@ -168,6 +171,19 @@ private:
GeneralPage::config_changed ();
}
+ void export_cinemas_file ()
+ {
+ wxFileDialog* d = new wxFileDialog (
+ _panel, _("Select Cinemas File"), wxEmptyString, wxEmptyString, wxT ("XML files (*.xml)|*.xml"),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT
+ );
+
+ if (d->ShowModal () == wxID_OK) {
+ boost::filesystem::copy_file (Config::instance()->cinemas_file(), path_from_file_dialog (d, "xml"));
+ }
+ d->Destroy ();
+ }
+
#ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
void analyse_ebur128_changed ()