From fa81d2428e56c4d0feb19f8dac5a1b52631897da Mon Sep 17 00:00:00 2001 From: William JCM Date: Mon, 21 Nov 2022 19:22:03 +0100 Subject: [PATCH] SaveTool: increase reliability. --- src/SaveTool/SaveTool_ProfileManager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SaveTool/SaveTool_ProfileManager.cpp b/src/SaveTool/SaveTool_ProfileManager.cpp index 50a5c85..f1d9fe7 100644 --- a/src/SaveTool/SaveTool_ProfileManager.cpp +++ b/src/SaveTool/SaveTool_ProfileManager.cpp @@ -341,12 +341,18 @@ auto SaveTool::drawBackupProfilePopup(std::size_t profile_index) -> ImGuiID { ImGui::TableSetColumnIndex(1); if(ImGui::Button("Yes")) { - _profileManager->backupProfile(profile_index, true); + if(!_profileManager->backupProfile(profile_index, true)) { + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", + _profileManager->lastError().data(), window()); + } ImGui::CloseCurrentPopup(); } ImGui::SameLine(); if(ImGui::Button("No", ImGui::GetItemRectSize())) { - _profileManager->backupProfile(profile_index, false); + if(!_profileManager->backupProfile(profile_index, false)) { + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", + _profileManager->lastError().data(), window()); + } ImGui::CloseCurrentPopup(); } ImGui::SameLine();