diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-07 13:21:21 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-07 13:21:21 -0700 |
commit | 884ac7307817e10f04512a29213a017ca344c16d (patch) | |
tree | 37bcb97dfec8516edba3501a5475b1daf314d2b7 /launcher/ui/MainWindow.cpp | |
parent | 718abaae0ef465050c81c0dfba63ce9f0fff17fc (diff) | |
parent | ce5bb29c442cee3654c5f4287a999d5d6593032f (diff) | |
download | PrismLauncher-884ac7307817e10f04512a29213a017ca344c16d.tar.gz PrismLauncher-884ac7307817e10f04512a29213a017ca344c16d.tar.bz2 PrismLauncher-884ac7307817e10f04512a29213a017ca344c16d.zip |
Merge remote-tracking branch 'upstream/develop' into better-tasks
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
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; |