add installed text to version select

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2024-10-27 10:56:14 +02:00
parent b593ff09e9
commit b1c8ab9350
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -283,11 +283,15 @@ void ResourcePage::updateVersionList()
if (!m_model->checkVersionFilters(version))
continue;
auto release_type = current_pack->versions[i].version_type.isValid()
? QString(" [%1]").arg(current_pack->versions[i].version_type.toString())
: "";
auto versionText = version.version;
if (version.version_type.isValid()) {
versionText += QString(" [%1]").arg(version.version_type.toString());
}
if (version.fileId == installedVersion) {
versionText += tr(" [installed]", "Mod version select");
}
m_ui->versionSelectionBox->addItem(QString("%1%2").arg(version.version, release_type), QVariant(i));
m_ui->versionSelectionBox->addItem(versionText, QVariant(i));
}
}
if (m_ui->versionSelectionBox->count() == 0) {