summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-12-16 12:10:51 +0000
committerCarl Hetherington <cth@carlh.net>2016-12-16 12:10:51 +0000
commit532e7faa6ab37681999d1cbb0e9f8b6978198622 (patch)
tree43ea916af86201d08c7f1aaf7b8f02f1aa021920 /src/wx
parent396c26415da57f42271ddcf56c1169a437d5a981 (diff)
Add preference for default KDM target directory (#1013).
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/config_dialog.cc17
-rw-r--r--src/wx/kdm_output_panel.cc7
2 files changed, 23 insertions, 1 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index ee780dc5f..b32ea9e27 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -460,10 +460,19 @@ private:
_standard = new wxChoice (_panel, wxID_ANY);
table->Add (_standard);
+ add_label_to_sizer (table, _panel, _("Default KDM directory"), true);
+#ifdef DCPOMATIC_USE_OWN_PICKER
+ _kdm_directory = new DirPickerCtrl (_panel);
+#else
+ _kdm_directory = new wxDirPickerCtrl (_panel, wxDD_DIR_MUST_EXIST);
+#endif
+ table->Add (_kdm_directory, 1, wxEXPAND);
+
_still_length->SetRange (1, 3600);
_still_length->Bind (wxEVT_SPINCTRL, boost::bind (&DefaultsPage::still_length_changed, this));
_directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::directory_changed, this));
+ _kdm_directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::kdm_directory_changed, this));
_isdcf_metadata_button->Bind (wxEVT_BUTTON, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this));
@@ -515,6 +524,7 @@ private:
checked_set (_still_length, config->default_still_length ());
_directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())).string ()));
+ _kdm_directory->SetPath (std_to_wx (config->default_kdm_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())).string ()));
checked_set (_j2k_bandwidth, config->default_j2k_bandwidth() / 1000000);
_j2k_bandwidth->SetRange (50, config->maximum_j2k_bandwidth() / 1000000);
checked_set (_dcp_audio_channels, locale_convert<string> (config->default_dcp_audio_channels()));
@@ -547,6 +557,11 @@ private:
Config::instance()->set_default_directory (wx_to_std (_directory->GetPath ()));
}
+ void kdm_directory_changed ()
+ {
+ Config::instance()->set_default_kdm_directory (wx_to_std (_kdm_directory->GetPath ()));
+ }
+
void edit_isdcf_metadata_clicked ()
{
ISDCFMetadataDialog* d = new ISDCFMetadataDialog (_panel, Config::instance()->default_isdcf_metadata (), false);
@@ -583,8 +598,10 @@ private:
wxSpinCtrl* _still_length;
#ifdef DCPOMATIC_USE_OWN_PICKER
DirPickerCtrl* _directory;
+ DirPickerCtrl* _kdm_directory;
#else
wxDirPickerCtrl* _directory;
+ wxDirPickerCtrl* _kdm_directory;
#endif
wxChoice* _container;
wxChoice* _dcp_content_type;
diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc
index 3919e6ceb..a36c82024 100644
--- a/src/wx/kdm_output_panel.cc
+++ b/src/wx/kdm_output_panel.cc
@@ -81,7 +81,12 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent, bool interop)
_folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1));
#endif
- _folder->SetPath (wxStandardPaths::Get().GetDocumentsDir());
+ boost::optional<boost::filesystem::path> path = Config::instance()->default_kdm_directory ();
+ if (path) {
+ _folder->SetPath (std_to_wx (path->string ()));
+ } else {
+ _folder->SetPath (wxStandardPaths::Get().GetDocumentsDir());
+ }
table->Add (_folder, 1, wxEXPAND);