diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-05-03 00:56:26 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-05-03 00:56:26 +0300 |
commit | 42dc3ed03f76f1064d6367a4d90f7cea895bcb6b (patch) | |
tree | 5923fa27324aef89b6539c69e8d4d242302097fd /launcher/ui/MainWindow.cpp | |
parent | f6ed2036b34177d7f932007dc5b3cc3d59f99aea (diff) | |
parent | 64ba5e4ed1456bed159cfe7b41ed9175b8baf5c4 (diff) | |
download | PrismLauncher-42dc3ed03f76f1064d6367a4d90f7cea895bcb6b.tar.gz PrismLauncher-42dc3ed03f76f1064d6367a4d90f7cea895bcb6b.tar.bz2 PrismLauncher-42dc3ed03f76f1064d6367a4d90f7cea895bcb6b.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into Fix_Assert
Diffstat (limited to 'launcher/ui/MainWindow.cpp')
-rw-r--r-- | launcher/ui/MainWindow.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 8490b292..72b7db64 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1337,6 +1337,20 @@ void MainWindow::on_actionDeleteInstance_triggered() if (response != QMessageBox::Yes) return; + auto linkedInstances = APPLICATION->instances()->getLinkedInstancesById(id); + if (!linkedInstances.empty()) { + response = CustomMessageBox::selectable( + this, tr("There are linked instances"), + tr("The following instance(s) might reference files in this instance:\n\n" + "%1\n\n" + "Deleting it could break the other instance(s), \n\n" + "Do you wish to proceed?", nullptr, linkedInstances.count()).arg(linkedInstances.join("\n")), + QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No + )->exec(); + if (response != QMessageBox::Yes) + return; + } + if (APPLICATION->instances()->trashInstance(id)) { ui->actionUndoTrashInstance->setEnabled(APPLICATION->instances()->trashedSomething()); return; |