summaryrefslogtreecommitdiff
path: root/src/wx/dir_dialog.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/wx/dir_dialog.cc')
-rw-r--r--src/wx/dir_dialog.cc22
1 files changed, 21 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;
}