summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-01-23 20:47:27 +0100
committerCarl Hetherington <cth@carlh.net>2022-01-23 20:47:27 +0100
commite378c11e193a55042a9798e0736cd2233ce8ba69 (patch)
treee1c3ae0f4293f93b50a7b68e52f8147c8c35de4c /src/tools
parent249056e053425d85ace8118b7092c96a19bb3f9a (diff)
Add option to export config as a .zip (#1776).
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 1daa75de0..2482a9cb5 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -257,6 +257,7 @@ enum {
ID_tools_check_for_updates,
ID_tools_send_translations,
ID_tools_restore_default_preferences,
+ ID_tools_export_preferences,
ID_help_report_a_problem,
/* IDs for shortcuts (with no associated menu item) */
ID_add_file,
@@ -339,6 +340,7 @@ public:
Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_check_for_updates, this), ID_tools_check_for_updates);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_send_translations, this), ID_tools_send_translations);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_restore_default_preferences, this), ID_tools_restore_default_preferences);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_export_preferences, this), ID_tools_export_preferences);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::help_about, this), wxID_ABOUT);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::help_report_a_problem, this), ID_help_report_a_problem);
@@ -738,6 +740,21 @@ private:
}
}
+ void tools_export_preferences ()
+ {
+ auto dialog = new wxFileDialog (
+ this, _("Specify ZIP file"), wxEmptyString, wxT("dcpomatic_config.zip"), wxT("ZIP files (*.zip)|*.zip"),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT
+ );
+
+ int const r = dialog->ShowModal ();
+ dialog->Destroy ();
+
+ if (r == wxID_OK) {
+ save_all_config_as_zip (wx_to_std(dialog->GetPath()));
+ }
+ }
+
void jobs_make_dcp ()
{
double required;
@@ -1366,6 +1383,8 @@ private:
add_item (tools, _("Send translations..."), ID_tools_send_translations, 0);
tools->AppendSeparator ();
add_item (tools, _("Restore default preferences"), ID_tools_restore_default_preferences, ALWAYS);
+ tools->AppendSeparator ();
+ add_item (tools, _("Export preferences..."), ID_tools_export_preferences, ALWAYS);
wxMenu* help = new wxMenu;
#ifdef __WXOSX__