diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-12 01:13:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-12 01:13:17 -0700 |
commit | 6b6d6a01dc9cf05715f01e3a549740b169ef9ae3 (patch) | |
tree | 8ba9746a188c39003213839825552543e3f1a48f /launcher/ui/MainWindow.cpp | |
parent | f27716656c6f6006238203669a7a02f035733fc0 (diff) | |
parent | c5aff7cc1ef43a1326bd3ce0c83e29669e2ff43f (diff) | |
download | PrismLauncher-6b6d6a01dc9cf05715f01e3a549740b169ef9ae3.tar.gz PrismLauncher-6b6d6a01dc9cf05715f01e3a549740b169ef9ae3.tar.bz2 PrismLauncher-6b6d6a01dc9cf05715f01e3a549740b169ef9ae3.zip |
Merge branch 'develop' into fix/network_and_signals
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; |