Skip to content

Commit

Permalink
Don't display the option to change update channels when server has va…
Browse files Browse the repository at this point in the history
…lid subscription.

Signed-off-by: Camila Ayres <hello@camilasan.com>
  • Loading branch information
camilasan committed Feb 18, 2025
1 parent 6e5db72 commit 711f983
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,19 @@ void GeneralSettings::loadMiscSettings()
#if defined(BUILD_UPDATER)
void GeneralSettings::loadUpdateChannelsList() {
ConfigFile cfgFile;
if (cfgFile.serverHasValidSubscription()) {
_ui->updateChannel->hide();
_ui->updateChannelLabel->hide();
return;
}

const auto validUpdateChannels = cfgFile.validUpdateChannels();
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);
}
}
Expand Down

0 comments on commit 711f983

Please sign in to comment.