mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Add option for toggling update checks (#3346)
This commit is contained in:
parent
06d5256f4e
commit
1065941767
6 changed files with 26 additions and 1 deletions
|
@ -185,6 +185,7 @@ Expertium <https://github.com/Expertium>
|
|||
Christian Donat <https://github.com/cdonat2>
|
||||
Asuka Minato <https://asukaminato.eu.org>
|
||||
Dillon Baldwin <https://github.com/DillBal>
|
||||
Voczi <https://github.com/voczi>
|
||||
********************
|
||||
|
||||
The text of the 3 clause BSD license follows:
|
||||
|
|
|
@ -41,6 +41,7 @@ preferences-theme-follow-system = Follow System
|
|||
preferences-theme-light = Light
|
||||
preferences-theme-dark = Dark
|
||||
preferences-v3-scheduler = V3 scheduler
|
||||
preferences-check-for-updates = Check for program updates
|
||||
preferences-ignore-accents-in-search = Ignore accents in search (slower)
|
||||
preferences-backup-explanation =
|
||||
Anki periodically backs up your collection. After backups are more than 2 days old,
|
||||
|
|
|
@ -82,6 +82,19 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="check_for_updates">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>preferences_check_for_updates</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -1431,7 +1431,8 @@ title="{}" {}>{}</button>""".format(
|
|||
def setup_auto_update(self, _log: list[DownloadLogEntry]) -> None:
|
||||
from aqt.update import check_for_update
|
||||
|
||||
check_for_update()
|
||||
if aqt.mw.pm.check_for_updates():
|
||||
check_for_update()
|
||||
|
||||
# Timers
|
||||
##########################################################################
|
||||
|
|
|
@ -207,6 +207,9 @@ class Preferences(QDialog):
|
|||
self.form.custom_sync_url.setText(self.mw.pm.custom_sync_url())
|
||||
self.form.network_timeout.setValue(self.mw.pm.network_timeout())
|
||||
|
||||
self.form.check_for_updates.setChecked(self.mw.pm.check_for_updates())
|
||||
qconnect(self.form.check_for_updates.stateChanged, self.mw.pm.set_update_check)
|
||||
|
||||
self.update_login_status()
|
||||
qconnect(self.form.syncLogout.clicked, self.sync_logout)
|
||||
qconnect(self.form.syncLogin.clicked, self.sync_login)
|
||||
|
|
|
@ -652,6 +652,12 @@ create table if not exists profiles
|
|||
def set_host_number(self, val: int | None) -> None:
|
||||
self.profile["hostNum"] = val or 0
|
||||
|
||||
def check_for_updates(self) -> bool:
|
||||
return self.meta.get("check_for_updates", True)
|
||||
|
||||
def set_update_check(self, on: bool) -> None:
|
||||
self.meta["check_for_updates"] = on
|
||||
|
||||
def media_syncing_enabled(self) -> bool:
|
||||
return self.profile.get("syncMedia", True)
|
||||
|
||||
|
|
Loading…
Reference in a new issue