diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-02-15 22:01:27 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-03-20 14:56:32 -0700 |
commit | 1ca2c59f2ed7739b4b7d50c7212e292a4432da93 (patch) | |
tree | caf24466c26cd86ce0f1f0d31cb02c7302fe44a2 /launcher/ui/MainWindow.cpp | |
parent | 3ec92acfe7a843a34018fc142439888c4ca5dba0 (diff) | |
download | PrismLauncher-1ca2c59f2ed7739b4b7d50c7212e292a4432da93.tar.gz PrismLauncher-1ca2c59f2ed7739b4b7d50c7212e292a4432da93.tar.bz2 PrismLauncher-1ca2c59f2ed7739b4b7d50c7212e292a4432da93.zip |
feat: track instance copies that use links
confirm deleations when other instances link to it
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..a6aa8320 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 folowing Instance(s) might reference files in this instance:\n\n" + "%1\n\n" + "Deleting it could break the other instance(s), \n\n" + "Are you sure?").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; |