From 2f88da9de20af705a5f8889e2186f485193b5a8b Mon Sep 17 00:00:00 2001 From: Trial97 Date: Tue, 25 Jun 2024 09:50:33 +0300 Subject: [PATCH] add warnning when user closes the resource download dialog with selection Signed-off-by: Trial97 --- launcher/ui/dialogs/ResourceDownloadDialog.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/launcher/ui/dialogs/ResourceDownloadDialog.cpp b/launcher/ui/dialogs/ResourceDownloadDialog.cpp index ef36edb32..9574d0bc4 100644 --- a/launcher/ui/dialogs/ResourceDownloadDialog.cpp +++ b/launcher/ui/dialogs/ResourceDownloadDialog.cpp @@ -92,6 +92,19 @@ void ResourceDownloadDialog::accept() void ResourceDownloadDialog::reject() { + auto selected = getTasks(); + if (selected.count() > 0) { + auto reply = CustomMessageBox::selectable(this, tr("Confirmation Needed"), + tr("You have %1 selected resources.\n" + "Are you sure you want to close this dialog?") + .arg(selected.count()), + QMessageBox::Question, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) + ->exec(); + if (reply != QMessageBox::Yes) { + return; + } + } + if (!geometrySaveKey().isEmpty()) APPLICATION->settings()->set(geometrySaveKey(), saveGeometry().toBase64());