aboutsummaryrefslogtreecommitdiff
path: root/launcher/InstanceTask.cpp
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-12-14 23:22:27 +0100
committerSefa Eyeoglu <contact@scrumplex.net>2022-12-14 23:22:27 +0100
commit849b92665e0762a38a7e17403015e2b037318aec (patch)
tree2fbeac111297727aa6613aacc08e80dcec5c3724 /launcher/InstanceTask.cpp
parentfdbd8d9d2b2e04cd68fd800882309b40c05aba2c (diff)
parentd193ed9eebb392b259edb88a227dce4cee773df6 (diff)
downloadPrismLauncher-849b92665e0762a38a7e17403015e2b037318aec.tar.gz
PrismLauncher-849b92665e0762a38a7e17403015e2b037318aec.tar.bz2
PrismLauncher-849b92665e0762a38a7e17403015e2b037318aec.zip
Merge branch 'develop' into remove-updater
Diffstat (limited to 'launcher/InstanceTask.cpp')
-rw-r--r--launcher/InstanceTask.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/launcher/InstanceTask.cpp b/launcher/InstanceTask.cpp
index 55a44fd3..06682782 100644
--- a/launcher/InstanceTask.cpp
+++ b/launcher/InstanceTask.cpp
@@ -18,6 +18,29 @@ InstanceNameChange askForChangingInstanceName(QWidget* parent, const QString& ol
return InstanceNameChange::ShouldKeep;
}
+ShouldUpdate askIfShouldUpdate(QWidget *parent, QString original_version_name)
+{
+ auto info = CustomMessageBox::selectable(
+ parent, QObject::tr("Similar modpack was found!"),
+ QObject::tr("One or more of your instances are from this same modpack%1. Do you want to create a "
+ "separate instance, or update the existing one?\n\nNOTE: Make sure you made a backup of your important instance data before "
+ "updating, as worlds can be corrupted and some configuration may be lost (due to pack overrides).")
+ .arg(original_version_name),
+ QMessageBox::Information, QMessageBox::Ok | QMessageBox::Reset | QMessageBox::Abort);
+ info->setButtonText(QMessageBox::Ok, QObject::tr("Update existing instance"));
+ info->setButtonText(QMessageBox::Abort, QObject::tr("Create new instance"));
+ info->setButtonText(QMessageBox::Reset, QObject::tr("Cancel"));
+
+ info->exec();
+
+ if (info->clickedButton() == info->button(QMessageBox::Ok))
+ return ShouldUpdate::Update;
+ if (info->clickedButton() == info->button(QMessageBox::Abort))
+ return ShouldUpdate::SkipUpdating;
+ return ShouldUpdate::Cancel;
+
+}
+
QString InstanceName::name() const
{
if (!m_modified_name.isEmpty())