Disable the option to select an update channel when server has a valid subscription.

Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
Camila Ayres 2025-02-17 16:47:15 +01:00 committed by backportbot[bot]
parent 08088a90c1
commit 69551c6e25

View File

@ -327,12 +327,13 @@ void GeneralSettings::loadMiscSettings()
void GeneralSettings::loadUpdateChannelsList() {
ConfigFile cfgFile;
const auto validUpdateChannels = cfgFile.validUpdateChannels();
if (_currentUpdateChannelList.isEmpty() || (_currentUpdateChannelList != validUpdateChannels && !cfgFile.serverHasValidSubscription())) {
if (_currentUpdateChannelList.isEmpty() || _currentUpdateChannelList != validUpdateChannels){
_currentUpdateChannelList = validUpdateChannels;
_ui->updateChannel->clear();
_ui->updateChannel->addItems(_currentUpdateChannelList);
const auto currentUpdateChannelIndex = _currentUpdateChannelList.indexOf(cfgFile.currentUpdateChannel());
_ui->updateChannel->setCurrentIndex(currentUpdateChannelIndex != -1 ? currentUpdateChannelIndex : 0);
_ui->updateChannel->setDisabled(cfgFile.serverHasValidSubscription());
connect(_ui->updateChannel, &QComboBox::currentTextChanged, this, &GeneralSettings::slotUpdateChannelChanged);
}
}