From f2ea231f9212006f43ec29faa6c5b47810748a99 Mon Sep 17 00:00:00 2001 From: Al Date: Sun, 6 Jan 2019 21:54:11 +0100 Subject: Made Delete INIs and Saves dialogs remember selection. --- src/profile.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/profile.cpp') diff --git a/src/profile.cpp b/src/profile.cpp index e8ead8e8..09c2a5f5 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -31,6 +31,7 @@ along with Mod Organizer. If not, see . #include #include "util.h" #include "registry.h" +#include #include #include // for QFile @@ -749,12 +750,12 @@ bool Profile::enableLocalSaves(bool enable) m_Directory.mkdir("saves"); } } else { - QMessageBox::StandardButton res = QMessageBox::question( - QApplication::activeModalWidget(), tr("Delete profile-specific save games?"), + QDialogButtonBox::StandardButton res; + res = QuestionBoxMemory::query(QApplication::activeModalWidget(), "deleteSavesQuery", + tr("Delete profile-specific save games?"), tr("Do you want to delete the profile-specific save games? (If you select \"No\", the " "save games will show up again if you re-enable profile-specific save games)"), - QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, - QMessageBox::Cancel); + QDialogButtonBox::No | QDialogButtonBox::Yes | QDialogButtonBox::Cancel, QDialogButtonBox::No); if (res == QMessageBox::Yes) { shellDelete(QStringList(m_Directory.absoluteFilePath("saves"))); } else if (res == QMessageBox::No) { @@ -797,12 +798,12 @@ bool Profile::enableLocalSettings(bool enable) if (enable) { m_GamePlugin->initializeProfile(m_Directory.absolutePath(), IPluginGame::CONFIGURATION); } else { - QMessageBox::StandardButton res = QMessageBox::question( - QApplication::activeModalWidget(), tr("Delete profile-specific game INI files?"), + QDialogButtonBox::StandardButton res; + res = QuestionBoxMemory::query(QApplication::activeModalWidget(), "deleteINIQuery", + tr("Delete profile-specific game INI files?"), tr("Do you want to delete the profile-specific game INI files? (If you select \"No\", the " "INI files will be used again if you re-enable profile-specific game INI files.)"), - QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, - QMessageBox::Cancel); + QDialogButtonBox::No | QDialogButtonBox::Yes | QDialogButtonBox::Cancel, QDialogButtonBox::No); if (res == QMessageBox::Yes) { QStringList filesToDelete; for (QString file : m_GamePlugin->iniFiles()) { -- cgit v1.3.1