summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-02-11 12:29:20 +0100
committerCarl Hetherington <cth@carlh.net>2026-02-11 12:29:20 +0100
commitf57b252fd5d753a0b0eab3ccaf87ba4ea25e2f4e (patch)
tree08ce85c30aa91d42c8dd9b2c8dfd33a06783074e /src
parent73c6361dd19274a1ae982a2b448979f32caebcc3 (diff)
Support wxDD_MULTIPLE in DirDialog.
Diffstat (limited to 'src')
-rw-r--r--src/wx/dir_dialog.cc22
-rw-r--r--src/wx/dir_dialog.h1
2 files changed, 22 insertions, 1 deletions
diff --git a/src/wx/dir_dialog.cc b/src/wx/dir_dialog.cc
index 2c25cb6e8..869a86926 100644
--- a/src/wx/dir_dialog.cc
+++ b/src/wx/dir_dialog.cc
@@ -23,8 +23,12 @@
#include "wx_util.h"
#include "lib/config.h"
#include "lib/cross.h"
+#include <dcp/warnings.h>
#include <boost/filesystem.hpp>
#include <vector>
+LIBDCP_DISABLE_WARNINGS
+#include <wx/dirdlg.h>
+LIBDCP_ENABLE_WARNINGS
using std::vector;
@@ -60,6 +64,21 @@ DirDialog::path() const
}
+vector<boost::filesystem::path>
+DirDialog::paths() const
+{
+ wxArrayString wx;
+ GetPaths(wx);
+
+ vector<boost::filesystem::path> std;
+ for (size_t i = 0; i < wx.GetCount(); ++i) {
+ std.push_back(wx_to_std(wx[i]));
+ }
+
+ return std;
+}
+
+
bool
DirDialog::show()
{
@@ -71,7 +90,8 @@ DirDialog::show()
return false;
}
- Config::instance()->set_initial_path(_initial_path_key, path().parent_path());
+ auto initial = GetWindowStyle() & wxDD_MULTIPLE ? paths()[0] : path();
+ Config::instance()->set_initial_path(_initial_path_key, initial.parent_path());
return true;
}
diff --git a/src/wx/dir_dialog.h b/src/wx/dir_dialog.h
index e0c5f07d4..3f5d7ca92 100644
--- a/src/wx/dir_dialog.h
+++ b/src/wx/dir_dialog.h
@@ -46,6 +46,7 @@ public:
bool show();
boost::filesystem::path path() const;
+ std::vector<boost::filesystem::path> paths() const;
private:
std::string _initial_path_key;