ask user if he wants to delete saves on modpack update

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-01-04 03:09:12 +02:00
parent 437242169d
commit 0b26d24c9b
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
6 changed files with 48 additions and 30 deletions

View file

@ -1,4 +1,5 @@
#include "InstanceTask.h"
#include <QDir>
#include "Application.h"
#include "settings/SettingsObject.h"
@ -82,3 +83,13 @@ void InstanceName::setName(InstanceName& other)
}
InstanceTask::InstanceTask() : Task(), InstanceName() {}
ShouldDeleteSaves askIfShouldDeleteSaves(QWidget* parent)
{
auto dialog = CustomMessageBox::selectable(parent, QObject::tr("Delete Existing Save Files"),
QObject::tr("An earlier version of this mod pack installed save files.\n"
"Would you like to remove those existing saves as part of this update?"),
QMessageBox::Question, QMessageBox::No | QMessageBox::Yes);
auto result = dialog->exec();
return result == QMessageBox::Yes ? ShouldDeleteSaves::Yes : ShouldDeleteSaves::No;
}