From a657f91fe6d0a5e8af24248501267ce897dcc76c Mon Sep 17 00:00:00 2001
From: SecretX33 <4389757+SecretX33@users.noreply.github.com>
Date: Sat, 27 Dec 2025 10:50:44 -0300
Subject: [PATCH] Add option to toggle add-on updates on and off
---
ftl/core/preferences.ftl | 1 +
qt/aqt/forms/preferences.ui | 14 ++++++++++++++
qt/aqt/main.py | 5 +++++
qt/aqt/preferences.py | 6 ++++++
qt/aqt/profiles.py | 6 ++++++
5 files changed, 32 insertions(+)
diff --git a/ftl/core/preferences.ftl b/ftl/core/preferences.ftl
index 23b72f267..f2adc15b1 100644
--- a/ftl/core/preferences.ftl
+++ b/ftl/core/preferences.ftl
@@ -41,6 +41,7 @@ preferences-theme-light = Light
preferences-theme-dark = Dark
preferences-v3-scheduler = V3 scheduler
preferences-check-for-updates = Check for program updates
+preferences-check-for-addon-updates = Check for add-on 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,
diff --git a/qt/aqt/forms/preferences.ui b/qt/aqt/forms/preferences.ui
index 0035e1f42..9f71b23e8 100644
--- a/qt/aqt/forms/preferences.ui
+++ b/qt/aqt/forms/preferences.ui
@@ -95,6 +95,19 @@
+ -
+
+
+
+ 0
+ 0
+
+
+
+ preferences_check_for_addon_updates
+
+
+
@@ -1254,6 +1267,7 @@
lang
video_driver
check_for_updates
+ check_for_addon_updates
theme
styleComboBox
uiScale
diff --git a/qt/aqt/main.py b/qt/aqt/main.py
index c707d1b2a..3a320d386 100644
--- a/qt/aqt/main.py
+++ b/qt/aqt/main.py
@@ -1022,6 +1022,11 @@ title="{}" {}>{}""".format(
def maybe_check_for_addon_updates(
self, on_done: Callable[[list[DownloadLogEntry]], None] | None = None
) -> None:
+ if not self.pm.check_for_addon_updates():
+ if on_done:
+ on_done([])
+ return
+
last_check = self.pm.last_addon_update_check()
elap = int_time() - last_check
diff --git a/qt/aqt/preferences.py b/qt/aqt/preferences.py
index 939dd8c2c..17664586b 100644
--- a/qt/aqt/preferences.py
+++ b/qt/aqt/preferences.py
@@ -224,6 +224,12 @@ class Preferences(QDialog):
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.form.check_for_addon_updates.setChecked(self.mw.pm.check_for_addon_updates())
+ qconnect(
+ self.form.check_for_addon_updates.stateChanged,
+ self.mw.pm.set_check_for_addon_updates,
+ )
+
self.update_login_status()
qconnect(self.form.syncLogout.clicked, self.sync_logout)
qconnect(self.form.syncLogin.clicked, self.sync_login)
diff --git a/qt/aqt/profiles.py b/qt/aqt/profiles.py
index 919be170c..15587467d 100644
--- a/qt/aqt/profiles.py
+++ b/qt/aqt/profiles.py
@@ -596,6 +596,12 @@ create table if not exists profiles
def set_last_addon_update_check(self, secs: int) -> None:
self.meta["last_addon_update_check"] = secs
+ def check_for_addon_updates(self) -> bool:
+ return self.meta.get("check_for_addon_updates", True)
+
+ def set_check_for_addon_updates(self, on: bool) -> None:
+ self.meta["check_for_addon_updates"] = on
+
@deprecated(info="use theme_manager.night_mode")
def night_mode(self) -> bool:
return theme_manager.night_mode