Made updater interval configurable
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
78482d0d3e
commit
9bbeb5ef3a
@ -185,6 +185,7 @@ void LauncherPage::applySettings()
|
|||||||
// Updates
|
// Updates
|
||||||
if (APPLICATION->updater()) {
|
if (APPLICATION->updater()) {
|
||||||
APPLICATION->updater()->setAutomaticallyChecksForUpdates(ui->autoUpdateCheckBox->isChecked());
|
APPLICATION->updater()->setAutomaticallyChecksForUpdates(ui->autoUpdateCheckBox->isChecked());
|
||||||
|
APPLICATION->updater()->setUpdateCheckInterval(ui->updateIntervalSpinBox->value() * 3600);
|
||||||
}
|
}
|
||||||
|
|
||||||
s->set("MenuBarInsteadOfToolBar", ui->preferMenuBarCheckBox->isChecked());
|
s->set("MenuBarInsteadOfToolBar", ui->preferMenuBarCheckBox->isChecked());
|
||||||
@ -234,6 +235,7 @@ void LauncherPage::loadSettings()
|
|||||||
// Updates
|
// Updates
|
||||||
if (APPLICATION->updater()) {
|
if (APPLICATION->updater()) {
|
||||||
ui->autoUpdateCheckBox->setChecked(APPLICATION->updater()->getAutomaticallyChecksForUpdates());
|
ui->autoUpdateCheckBox->setChecked(APPLICATION->updater()->getAutomaticallyChecksForUpdates());
|
||||||
|
ui->updateIntervalSpinBox->setValue(APPLICATION->updater()->getUpdateCheckInterval() / 3600);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toolbar/menu bar settings (not applicable if native menu bar is present)
|
// Toolbar/menu bar settings (not applicable if native menu bar is present)
|
||||||
|
@ -58,6 +58,33 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="updateSetingsLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="updateIntervalLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Update interval</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QSpinBox" name="updateIntervalSpinBox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Set it to 0 to only check on launch</string>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string>h</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>99999999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -257,7 +257,7 @@ void PrismExternalUpdater::setBetaAllowed(bool allowed)
|
|||||||
|
|
||||||
void PrismExternalUpdater::resetAutoCheckTimer()
|
void PrismExternalUpdater::resetAutoCheckTimer()
|
||||||
{
|
{
|
||||||
if (priv->autoCheck) {
|
if (priv->autoCheck && priv->updateInterval > 0) {
|
||||||
int timeoutDuration = 0;
|
int timeoutDuration = 0;
|
||||||
auto now = QDateTime::currentDateTime();
|
auto now = QDateTime::currentDateTime();
|
||||||
if (priv->lastCheck.isValid()) {
|
if (priv->lastCheck.isValid()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user