diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-16 21:26:43 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-16 21:26:43 +0300 |
commit | b0e197de38858c3fe6bc5fbb62570efd3359c802 (patch) | |
tree | 6bcdbcf2b638830f4123482e15f95c44b11b1177 | |
parent | 6c2c724bd99d442f7856da1a2ef4ebdd674064d1 (diff) | |
download | PrismLauncher-b0e197de38858c3fe6bc5fbb62570efd3359c802.tar.gz PrismLauncher-b0e197de38858c3fe6bc5fbb62570efd3359c802.tar.bz2 PrismLauncher-b0e197de38858c3fe6bc5fbb62570efd3359c802.zip |
removed warning for one mod selected
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
-rw-r--r-- | launcher/ui/pages/instance/ModFolderPage.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index d4e7a25c..b42bbf46 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -310,23 +310,20 @@ void ModFolderPage::visitModPages() void ModFolderPage::deleteModMetadata() { auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes(); - QString text; auto selectionCount = m_model->selectedMods(selection).length(); if (selectionCount == 0) return; - else if (selectionCount > 1) - text = tr("You are about to remove the metadata for %1 mods.\n" - "Are you sure?") - .arg(selectionCount); - else - text = tr("You are about to remove the metadata for %1.\n" - "Are you sure?") - .arg(m_model->at(selection.at(0).row())->name()); - - auto response = CustomMessageBox::selectable(this, tr("Confirm Removal"), text, QMessageBox::Warning, - QMessageBox::Yes | QMessageBox::No, QMessageBox::No) - ->exec(); - - if (response == QMessageBox::Yes) - m_model->deleteModsMetadata(selection); + if (selectionCount > 1) { + auto response = CustomMessageBox::selectable(this, tr("Confirm Removal"), + tr("You are about to remove the metadata for %1 mods.\n" + "Are you sure?") + .arg(selectionCount), + QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) + ->exec(); + + if (response != QMessageBox::Yes) + return; + } + + m_model->deleteModsMetadata(selection); } |