List enterprise update channel when available.

Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
Camila Ayres 2024-06-03 20:52:11 +02:00
parent a4c114e658
commit ee032827a1
No known key found for this signature in database
GPG key ID: 7A4A6121E88E2AD4

View file

@ -282,6 +282,10 @@ void GeneralSettings::loadMiscSettings()
#if defined(BUILD_UPDATER)
auto validUpdateChannels = cfgFile.validUpdateChannels();
if (const auto serverHasValidSubscription = cfgFile.serverHasValidSubscription();
serverHasValidSubscription) {
validUpdateChannels << QStringLiteral("enterprise");
}
_ui->updateChannel->addItems(validUpdateChannels);
const auto currentUpdateChannelIndex = validUpdateChannels.indexOf(cfgFile.currentUpdateChannel());
_ui->updateChannel->setCurrentIndex(currentUpdateChannelIndex != -1? currentUpdateChannelIndex : 0);
@ -359,6 +363,10 @@ void GeneralSettings::slotUpdateChannelChanged()
return tr("daily");
}
if (channel == QStringLiteral("enterprise")) {
return tr("enterprise");
}
return QString{};
};
@ -370,6 +378,9 @@ void GeneralSettings::slotUpdateChannelChanged()
case 2:
return QStringLiteral("daily");
break;
case 3:
return QStringLiteral("enterprise");
break;
default:
return QStringLiteral("stable");
}