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 180edbe
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -292,9 +304,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 +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()
Expand All @@ -360,6 +364,10 @@ void GeneralSettings::slotUpdateChannelChanged()
return tr("daily");
}

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

return QString{};
};

Expand Down

0 comments on commit 180edbe

Please sign in to comment.