MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / FileSelector

Function FileSelector

src/utils.cpp:246–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246static 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
256agi::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);

Callers 2

OpenFileSelectorFunction · 0.85
SaveFileSelectorFunction · 0.85

Calls 3

from_wxFunction · 0.85
stringMethod · 0.80
to_wxFunction · 0.70

Tested by

no test coverage detected