Merge pull request #2054 from Trial97/add_configurable_updater_interval
Made updater interval configurable
This commit is contained in:
commit
95e7f36732
@ -196,6 +196,7 @@ void LauncherPage::applySettings()
|
||||
// Updates
|
||||
if (APPLICATION->updater()) {
|
||||
APPLICATION->updater()->setAutomaticallyChecksForUpdates(ui->autoUpdateCheckBox->isChecked());
|
||||
APPLICATION->updater()->setUpdateCheckInterval(ui->updateIntervalSpinBox->value() * 3600);
|
||||
}
|
||||
|
||||
s->set("MenuBarInsteadOfToolBar", ui->preferMenuBarCheckBox->isChecked());
|
||||
@ -246,6 +247,7 @@ void LauncherPage::loadSettings()
|
||||
// Updates
|
||||
if (APPLICATION->updater()) {
|
||||
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)
|
||||
|
@ -58,6 +58,33 @@
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -257,7 +257,7 @@ void PrismExternalUpdater::setBetaAllowed(bool allowed)
|
||||
|
||||
void PrismExternalUpdater::resetAutoCheckTimer()
|
||||
{
|
||||
if (priv->autoCheck) {
|
||||
if (priv->autoCheck && priv->updateInterval > 0) {
|
||||
int timeoutDuration = 0;
|
||||
auto now = QDateTime::currentDateTime();
|
||||
if (priv->lastCheck.isValid()) {
|
||||
|
Loading…
Reference in New Issue
Block a user