Create the config directory at first launch

First launch would fail because wx does not create the configuration
directory by itself if it does not exist.
This also fixes an incorrect menu option.
This commit is contained in:
Fabrice de Gans 2023-06-01 11:18:59 -07:00 committed by Rafael Kitover
parent 7b8c4242fb
commit 6f68bfcf71
2 changed files with 6 additions and 1 deletions

View File

@ -2608,7 +2608,7 @@ EVT_HANDLER(SpeedOn, "Enable faster network protocol by default")
EVT_HANDLER(LinkProto, "Local host IPC")
{
GetMenuOptionConfig("LinkProto", config::OptionID::kGBALinkHost);
GetMenuOptionConfig("LinkProto", config::OptionID::kGBALinkProto);
}
EVT_HANDLER(LinkConfigure, "Link options...")

View File

@ -406,6 +406,11 @@ bool wxvbamApp::OnInit() {
config_file_.GetFullPath(),
wxEmptyString, wxCONFIG_USE_LOCAL_FILE));
// wx does not create the directories by itself so do it here, if needed.
if (!wxDirExists(config_file_.GetPath())) {
config_file_.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL);
}
// Load the default options.
load_opts(!config_file_.Exists());