diff --git a/launcher/InstanceDirUpdate.cpp b/launcher/InstanceDirUpdate.cpp index 8064082fd..49010e6c9 100644 --- a/launcher/InstanceDirUpdate.cpp +++ b/launcher/InstanceDirUpdate.cpp @@ -93,7 +93,7 @@ QString askToUpdateInstanceDirName(InstancePtr instance, QWidget* parent) } // Check for linked instances - if (!checkLinkedInstances(instance->id(), parent)) + if (!checkLinkedInstances(instance->id(), parent, QObject::tr("Renaming"))) return QString(); // Now we can confirm that a renaming is happening @@ -109,17 +109,18 @@ QString askToUpdateInstanceDirName(InstancePtr instance, QWidget* parent) return newRoot; } -bool checkLinkedInstances(const QString& id, QWidget* parent) +bool checkLinkedInstances(const QString& id, QWidget* parent, const QString& verb) { auto linkedInstances = APPLICATION->instances()->getLinkedInstancesById(id); if (!linkedInstances.empty()) { auto response = CustomMessageBox::selectable(parent, QObject::tr("There are linked instances"), QObject::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" + "%2 it could break the other instance(s), \n\n" "Do you wish to proceed?", nullptr, linkedInstances.count()) - .arg(linkedInstances.join("\n")), + .arg(linkedInstances.join("\n")) + .arg(verb), QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) ->exec(); if (response != QMessageBox::Yes) diff --git a/launcher/InstanceDirUpdate.h b/launcher/InstanceDirUpdate.h index 23738a19a..354eba465 100644 --- a/launcher/InstanceDirUpdate.h +++ b/launcher/InstanceDirUpdate.h @@ -43,4 +43,4 @@ QString askToUpdateInstanceDirName(InstancePtr instance, QWidget* parent); /// Check if there are linked instances, and display a warning; return true if the operation should proceed -bool checkLinkedInstances(const QString& id, QWidget* parent); +bool checkLinkedInstances(const QString& id, QWidget* parent, const QString& verb); diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 05afea0b4..7e9c72da7 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1396,7 +1396,7 @@ void MainWindow::on_actionDeleteInstance_triggered() if (response != QMessageBox::Yes) return; - if (!checkLinkedInstances(id, this)) + if (!checkLinkedInstances(id, this, tr("Deleting"))) return; if (APPLICATION->instances()->trashInstance(id)) {