Add functionality to (Sparkle) updater settings on macOS

Also remove a debug line I accidentally left in
This commit is contained in:
Kenneth Chew 2022-04-22 22:29:00 -04:00
parent f9f46609ee
commit 34adcec616
No known key found for this signature in database
GPG Key ID: F17D3E14A07739DA
3 changed files with 9 additions and 2 deletions

View File

@ -261,7 +261,11 @@ void LauncherPage::applySettings()
auto s = APPLICATION->settings();
// Updates
#ifdef Q_OS_MAC
APPLICATION->updateChecker()->getSparkleUpdater()->setAutomaticallyChecksForUpdates(ui->autoUpdateCheckBox->isChecked());
#else
s->set("AutoUpdate", ui->autoUpdateCheckBox->isChecked());
#endif
s->set("UpdateChannel", m_currentUpdateChannel);
auto original = s->get("IconTheme").toString();
//FIXME: make generic
@ -343,7 +347,11 @@ void LauncherPage::loadSettings()
{
auto s = APPLICATION->settings();
// Updates
#ifdef Q_OS_MAC
ui->autoUpdateCheckBox->setChecked(APPLICATION->updateChecker()->getSparkleUpdater()->getAutomaticallyChecksForUpdates());
#else
ui->autoUpdateCheckBox->setChecked(s->get("AutoUpdate").toBool());
#endif
m_currentUpdateChannel = s->get("UpdateChannel").toString();
//FIXME: make generic
auto theme = s->get("IconTheme").toString();

View File

@ -54,7 +54,7 @@
<item>
<widget class="QCheckBox" name="autoUpdateCheckBox">
<property name="text">
<string>Check for updates on start?</string>
<string>Check for updates automatically</string>
</property>
</widget>
</item>

View File

@ -173,7 +173,6 @@ void SparkleUpdater::setAllowedChannel(const QString &channel)
NSSet<NSString *> *nsChannels = [NSSet setWithObject:channel.toNSString()];
priv->updaterDelegate.allowedChannels = nsChannels;
qDebug() << channel;
APPLICATION->settings()->set("UpdateChannel", channel);
}