rework: make the filter as a tabbed widget in the dialog itself

Still needs a clear indication that the filter only applies after you
click the search button...
This commit is contained in:
flow
2022-04-14 10:27:03 -03:00
parent 63bce04648
commit 277de41200
11 changed files with 138 additions and 247 deletions
@@ -67,25 +67,6 @@ auto FlameModPage::validateVersion(ModPlatform::IndexedVersion& ver, QString min
return ver.mcVersion.contains(mineVer);
}
// We override this so that it refreshes correctly, otherwise it would show
// invalid mods on the mod list, because the API would return mods for the
// wrong mod loader :(
void FlameModPage::filterMods()
{
auto ret = filter_dialog.execWithInstance(static_cast<MinecraftInstance*>(m_instance));
m_filter = filter_dialog.getFilter();
if(ret == QDialog::DialogCode::Accepted){
// CF API can't handle well this
if(!m_filter->versions.empty())
listModel->refresh();
int prev_count = ui->versionSelectionBox->count();
ui->versionSelectionBox->clear();
updateModVersions(prev_count);
}
}
// I don't know why, but doing this on the parent class makes it so that
// other mod providers start loading before being selected, at least with
// my Qt, so we need to implement this in every derived class...