diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index c1f6f354f1555..b47e23e970093 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -279,6 +279,18 @@ void GeneralSettings::loadMiscSettings() _ui->stopExistingFolderNowBigSyncCheckBox->setChecked(_ui->existingFolderLimitCheckBox->isChecked() && cfgFile.stopSyncingExistingFoldersOverLimit()); _ui->newExternalStorage->setChecked(cfgFile.confirmExternalStorage()); _ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons()); + +#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.updateChannel()); + _ui->updateChannel->setCurrentIndex(currentUpdateChannelIndex != -1? currentUpdateChannelIndex : 0); + connect(_ui->updateChannel, &QComboBox::currentTextChanged, this, &GeneralSettings::slotUpdateChannelChanged); +#endif } #if defined(BUILD_UPDATER) @@ -292,9 +304,6 @@ void GeneralSettings::slotUpdateInfo() return; } - const auto validUpdateChannels = config.validUpdateChannels(); - _ui->updateChannel->addItems(validUpdateChannels); - if (updater) { connect(_ui->updateButton, &QAbstractButton::clicked, @@ -338,11 +347,6 @@ void GeneralSettings::slotUpdateInfo() _ui->updateButton->setEnabled(enableUpdateButton); } #endif - - const auto currentUpdateChannelIndex = validUpdateChannels.indexOf(config.updateChannel()); - _ui->updateChannel->setCurrentIndex(currentUpdateChannelIndex != -1? currentUpdateChannelIndex : 0); - connect(_ui->updateChannel, &QComboBox::currentTextChanged, - this, &GeneralSettings::slotUpdateChannelChanged, Qt::UniqueConnection); } void GeneralSettings::slotUpdateChannelChanged() @@ -360,6 +364,10 @@ void GeneralSettings::slotUpdateChannelChanged() return tr("daily"); } + if (channel == QStringLiteral("enterprise")) { + return tr("enterprise"); + } + return QString{}; };