| 244 | } |
| 245 | |
| 246 | static agi::fs::path FileSelector(wxString const& message, std::string const& option_name, std::string const& default_filename, std::string const& default_extension, std::string const& wildcard, int flags, wxWindow *parent) { |
| 247 | wxString path; |
| 248 | if (!option_name.empty()) |
| 249 | path = to_wx(OPT_GET(option_name)->GetString()); |
| 250 | agi::fs::path filename = from_wx(wxFileSelector(message, path, to_wx(default_filename), to_wx(default_extension), to_wx(wildcard), flags, parent)); |
| 251 | if (!filename.empty() && !option_name.empty()) |
| 252 | OPT_SET(option_name)->SetString(filename.parent_path().string()); |
| 253 | return filename; |
| 254 | } |
| 255 | |
| 256 | agi::fs::path OpenFileSelector(wxString const& message, std::string const& option_name, std::string const& default_filename, std::string const& default_extension, std::string const& wildcard, wxWindow *parent) { |
| 257 | return FileSelector(message, option_name, default_filename, default_extension, wildcard, wxFD_OPEN | wxFD_FILE_MUST_EXIST, parent); |
no test coverage detected