Skip to content

Commit

Permalink
List daily update channel in the general settings view.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Jun 3, 2024
1 parent 8084ae4 commit 031319f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -292,9 +300,6 @@ void GeneralSettings::slotUpdateInfo()
return;
}

const auto validUpdateChannels = config.validUpdateChannels();
_ui->updateChannel->addItems(validUpdateChannels);

if (updater) {
connect(_ui->updateButton,
&QAbstractButton::clicked,
Expand Down Expand Up @@ -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()
Expand All @@ -360,6 +360,10 @@ void GeneralSettings::slotUpdateChannelChanged()
return tr("daily");
}

if (channel == QStringLiteral("enterprise")) {
return tr("enterprise");
}

return QString{};
};

Expand Down

0 comments on commit 031319f

Please sign in to comment.