summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wx/file_dialog.cc12
-rw-r--r--src/wx/file_dialog.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/src/wx/file_dialog.cc b/src/wx/file_dialog.cc
index 5a530359c..9f547f85a 100644
--- a/src/wx/file_dialog.cc
+++ b/src/wx/file_dialog.cc
@@ -63,6 +63,7 @@ FileDialog::FileDialog(
style
)
, _initial_path_key(initial_path_key)
+ , _multiple(style & wxFD_MULTIPLE)
{
}
@@ -96,9 +97,14 @@ FileDialog::show()
return false;
}
- auto p = paths();
- DCPOMATIC_ASSERT(!p.empty());
- Config::instance()->set_initial_path(_initial_path_key, p[0].parent_path());
+ if (_multiple) {
+ auto p = paths();
+ DCPOMATIC_ASSERT(!p.empty());
+ Config::instance()->set_initial_path(_initial_path_key, p[0].parent_path());
+ } else {
+ Config::instance()->set_initial_path(_initial_path_key, path().parent_path());
+ }
+
return true;
}
diff --git a/src/wx/file_dialog.h b/src/wx/file_dialog.h
index ad8f68aa1..a87c65395 100644
--- a/src/wx/file_dialog.h
+++ b/src/wx/file_dialog.h
@@ -52,5 +52,6 @@ public:
private:
std::string _initial_path_key;
+ bool _multiple;
};