add warnning when user closes the resource download dialog with selection

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2024-06-25 09:50:33 +03:00
parent 98d68bafeb
commit 2f88da9de2
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -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());