Add error dialog

This commit is contained in:
TheKodeToad 2024-09-01 19:07:42 +01:00
parent 4c937d3660
commit 3fafeb5bd8
No known key found for this signature in database
GPG key ID: 5E39D70B4C93C38E
2 changed files with 31 additions and 0 deletions

View file

@ -7,3 +7,4 @@ ColumnLimit: 120
--- ---
Language: Cpp Language: Cpp
AccessModifierOffset: -4 AccessModifierOffset: -4
IndentCaseLabels: true

View file

@ -49,6 +49,36 @@ void InstallerFrame::perform_install(const wxCommandEvent &) {
if (result == InstallerResult::OK) { if (result == InstallerResult::OK) {
wxMessageBox(_("Reopen the launcher and FrogLoader should be available."), _("Installation Complete")); wxMessageBox(_("Reopen the launcher and FrogLoader should be available."), _("Installation Complete"));
} else {
wxString message;
switch (result) {
case InstallerResult::CouldntCreateLauncherDataDir:
message = _("Failed to create launcher data directory");
break;
case InstallerResult::CouldntCreateVersionDir:
message = _("Failed to create versions directory");
break;
case InstallerResult::CouldntWriteVersion:
message = _("Failed to write version");
break;
case InstallerResult::CouldntReadLauncherProfiles:
message = _("Failed to read launcher profiles");
break;
case InstallerResult::CouldntWriteLauncherProfiles:
message = _("Failed to write launcher profiles");
break;
case InstallerResult::CouldntCreateInstallationDir:
message = _("Failed to create game directory");
break;
}
if (!message.IsEmpty())
message = wxString::Format(_("An error occurred during installation: %s."), message);
else
message = _("An error occured during installation.");
wxMessageBox(message, _("Installation Failed"), wxICON_ERROR | wxOK | wxCENTRE);
} }
}); });
} }