feat: allow deselecting mods from the mod confirmation dialog

This adds a checkbox to each mod on the dialog that shows up when
confirming the mods to download, so you can deselect some of those if
you want to.
This commit is contained in:
flow authored and flow committed 2022-05-21 08:02:27 -03:00
1 parent 9a0d6124f3
commit 613f2fc447
4 files changed
+71 -67

No files matched your search

+10 -8
View File
@@ -77,18 +77,20 @@ void ModDownloadDialog::confirm()
auto keys = modTask.keys();
keys.sort(Qt::CaseInsensitive);
auto confirm_dialog = ReviewMessageBox::create(
this,
tr("Confirm mods to download")
);
auto confirm_dialog = ReviewMessageBox::create(this, tr("Confirm mods to download"));
for(auto& task : keys){
confirm_dialog->appendMod(task, modTask.find(task).value()->getFilename());
for (auto& task : keys) {
confirm_dialog->appendMod({ task, modTask.find(task).value()->getFilename() });
}
connect(confirm_dialog, &QDialog::accepted, this, &ModDownloadDialog::accept);
if (confirm_dialog->exec()) {
auto deselected = confirm_dialog->deselectedMods();
for (auto name : deselected) {
modTask.remove(name);
}
confirm_dialog->open();
this->accept();
}
}
void ModDownloadDialog::accept()