From 031319f3d87fc9cd65609ab5a972a098e8e368c2 Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Mon, 3 Jun 2024 20:52:11 +0200 Subject: [PATCH] List daily update channel in the general settings view. Signed-off-by: Camila Ayres --- src/gui/generalsettings.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index c1f6f354f1555..6d2079865d595 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -279,6 +279,14 @@ 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(); + _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 +300,6 @@ void GeneralSettings::slotUpdateInfo() return; } - const auto validUpdateChannels = config.validUpdateChannels(); - _ui->updateChannel->addItems(validUpdateChannels); - if (updater) { connect(_ui->updateButton, &QAbstractButton::clicked, @@ -338,11 +343,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 +360,10 @@ void GeneralSettings::slotUpdateChannelChanged() return tr("daily"); } + if (channel == QStringLiteral("enterprise")) { + return tr("enterprise"); + } + return QString{}; };