summaryrefslogtreecommitdiff
path: root/src/wx/full_config_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-01-16 01:44:49 +0100
committerCarl Hetherington <cth@carlh.net>2024-01-16 21:33:29 +0100
commit127bdaa2d8a869112fd6ec908cf115f391dbba24 (patch)
treef1878f27421d80694e28b46f4d609ae51ebebc29 /src/wx/full_config_dialog.cc
parentc64b6891f6e28c1a7f11871d3dcccdfe75944644 (diff)
Remember some more paths when selecting files (#2728).
* export subtitles * export video * debug log * cinema database * config file
Diffstat (limited to 'src/wx/full_config_dialog.cc')
-rw-r--r--src/wx/full_config_dialog.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc
index f7945a44a..77f173d7c 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -115,12 +115,12 @@ private:
++r;
add_label_to_sizer (table, _panel, _("Configuration file"), true, wxGBPosition (r, 0));
- _config_file = new FilePickerCtrl (_panel, _("Select configuration file"), "*.xml", true, false);
+ _config_file = new FilePickerCtrl(_panel, _("Select configuration file"), "*.xml", true, false, "ConfigFilePath");
table->Add (_config_file, wxGBPosition (r, 1));
++r;
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, false);
+ _cinemas_file = new FilePickerCtrl(_panel, _("Select cinema and screen database file"), "*.xml", true, false, "CinemaDatabasePath");
table->Add (_cinemas_file, wxGBPosition (r, 1));
auto export_cinemas = new Button (_panel, _("Export..."));
table->Add (export_cinemas, wxGBPosition (r, 2));
@@ -217,12 +217,12 @@ private:
{
auto config = Config::instance();
auto const new_file = _config_file->path();
- if (new_file == config->config_read_file()) {
+ if (!new_file || *new_file == config->config_read_file()) {
return;
}
bool copy_and_link = true;
- if (dcp::filesystem::exists(new_file)) {
- ConfigMoveDialog dialog(_panel, new_file);
+ if (dcp::filesystem::exists(*new_file)) {
+ ConfigMoveDialog dialog(_panel, *new_file);
if (dialog.ShowModal() == wxID_OK) {
copy_and_link = false;
}
@@ -231,16 +231,18 @@ private:
if (copy_and_link) {
config->write ();
if (new_file != config->config_read_file()) {
- config->copy_and_link (new_file);
+ config->copy_and_link(*new_file);
}
} else {
- config->link (new_file);
+ config->link(*new_file);
}
}
void cinemas_file_changed ()
{
- Config::instance()->set_cinemas_file(_cinemas_file->path());
+ if (auto path = _cinemas_file->path()) {
+ Config::instance()->set_cinemas_file(*path);
+ }
}
void default_add_file_location_changed()