Merge pull request #2566 from Trial97/mod_warning

add warnning when user closes the resource download dialog with selec…
This commit is contained in:
Alexandru Ionut Tripon 2024-06-26 08:17:16 +03:00 committed by GitHub
commit 3aaa36a2bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,6 +92,19 @@ void ResourceDownloadDialog::accept()
void ResourceDownloadDialog::reject() 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()) if (!geometrySaveKey().isEmpty())
APPLICATION->settings()->set(geometrySaveKey(), saveGeometry().toBase64()); APPLICATION->settings()->set(geometrySaveKey(), saveGeometry().toBase64());