chore(cpn): Switch from component names to ids (#2602)

* cpn(fix): Switch from component names to ids

* Fix Win compile

* Sound packs list entries should not be editable
This commit is contained in:
Neil Horne
2022-10-27 21:52:05 +10:00
committed by GitHub
parent 56617dc209
commit 6b01a0c673
17 changed files with 441 additions and 350 deletions
+17 -5
View File
@@ -67,23 +67,35 @@ void Updates::autoUpdates(bool interactive)
factories->resetAllEnvironments();
QStringList list;
QMap<QString, int> components;
if (!factories->isUpdateAvailable(list)) {
if (!factories->isUpdateAvailable(components)) {
if (interactive)
QMessageBox::information(parentWidget(), CPN_STR_APP_NAME, tr("No updates available at this time"));
return;
}
QMapIterator<QString, int> it(components);
QStringList list;
while (it.hasNext()) {
it.next();
list << it.key();
}
if (QMessageBox::question(parentWidget(), CPN_STR_APP_NAME % ": " % tr("Checking for Updates"),
tr("Updates available for:\n - %1\n\nProcess now?").arg(list.join("\n - ")),
(QMessageBox::Yes | QMessageBox::No), QMessageBox::No) == QMessageBox::No) {
return;
}
for (int i = 0; i < list.count(); i++) {
factories->setRunUpdate(list.at(i));
factories->updateRelease(list.at(i));
it.toFront();
while (it.hasNext()) {
it.next();
factories->setRunUpdate(it.value());
factories->updateRelease(it.value());
}
runUpdate();