| 23 | } |
| 24 | |
| 25 | ShouldUpdate askIfShouldUpdate(QWidget* parent, QString original_version_name) |
| 26 | { |
| 27 | if (APPLICATION->settings()->get("SkipModpackUpdatePrompt").toBool()) |
| 28 | return ShouldUpdate::SkipUpdating; |
| 29 | |
| 30 | auto info = CustomMessageBox::selectable( |
| 31 | parent, QObject::tr("Similar modpack was found!"), |
| 32 | QObject::tr( |
| 33 | "One or more of your instances are from this same modpack%1. Do you want to create a " |
| 34 | "separate instance, or update the existing one?\n\nNOTE: Make sure you made a backup of your important instance data before " |
| 35 | "updating, as worlds can be corrupted and some configuration may be lost (due to pack overrides).") |
| 36 | .arg(original_version_name), |
| 37 | QMessageBox::Information, QMessageBox::Cancel); |
| 38 | QAbstractButton* update = info->addButton(QObject::tr("Update existing instance"), QMessageBox::AcceptRole); |
| 39 | QAbstractButton* skip = info->addButton(QObject::tr("Create new instance"), QMessageBox::ResetRole); |
| 40 | |
| 41 | info->exec(); |
| 42 | |
| 43 | if (info->clickedButton() == update) |
| 44 | return ShouldUpdate::Update; |
| 45 | if (info->clickedButton() == skip) |
| 46 | return ShouldUpdate::SkipUpdating; |
| 47 | return ShouldUpdate::Cancel; |
| 48 | } |
| 49 | |
| 50 | QString InstanceName::name() const |
| 51 | { |
no test coverage detected