diff options
author | Christian Kamm <mail@ckamm.de> | 2018-04-26 12:24:30 +0300 |
---|---|---|
committer | Markus Goetz <markus@woboq.com> | 2018-05-24 13:09:40 +0300 |
commit | 7790953a2c64bd078a1ed19efd06588000e992b2 (patch) | |
tree | 414d40baa4a3dcc6b6de9d7bd41b9f21d996d157 /src/gui/generalsettings.cpp | |
parent | e3083d67916b194db4df63f2306316cc311ebd8b (diff) |
Settings: Add update channel combobox #6259
Diffstat (limited to 'src/gui/generalsettings.cpp')
-rw-r--r-- | src/gui/generalsettings.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index e224fca47..516af3fad 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -138,12 +138,27 @@ void GeneralSettings::slotUpdateInfo() connect(_ui->restartButton, &QAbstractButton::clicked, qApp, &QApplication::quit, Qt::UniqueConnection); _ui->updateStateLabel->setText(updater->statusString()); _ui->restartButton->setVisible(updater->downloadState() == OCUpdater::DownloadComplete); + + // Channel selection + _ui->updateChannel->setCurrentIndex(ConfigFile().updateChannel() == "beta" ? 1 : 0); + connect(_ui->updateChannel, &QComboBox::currentTextChanged, + this, &GeneralSettings::slotUpdateChannelChanged, Qt::UniqueConnection); + } else { // can't have those infos from sparkle currently _ui->updatesGroupBox->setVisible(false); } } +void GeneralSettings::slotUpdateChannelChanged(const QString &channel) +{ + ConfigFile().setUpdateChannel(channel); + if (OCUpdater *updater = qobject_cast<OCUpdater *>(Updater::instance())) { + updater->setUpdateUrl(Updater::updateUrl()); + updater->checkForUpdate(); + } +} + void GeneralSettings::saveMiscSettings() { if (_currentlyLoading) |