mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
ask user if he wants to delete saves on modpack update
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
437242169d
commit
0b26d24c9b
6 changed files with 48 additions and 30 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue