Display a dialog box message saying that there's no update when manually checking

This commit is contained in:
SecretX33 2025-12-27 11:17:49 -03:00
parent 0a82f607c9
commit 2d19aa749c
3 changed files with 9 additions and 3 deletions

View file

@ -3,6 +3,7 @@ qt-misc-addons = Add-ons
qt-misc-all-cards-notes-and-media-for = All cards, notes, and media for this profile will be deleted. Are you sure?
qt-misc-all-cards-notes-and-media-for2 = All cards, notes, and media for the profile "{ $name }" will be deleted. Are you sure?
qt-misc-anki-updatedanki-has-been-released = <h1>Anki Updated</h1>Anki { $val } has been released.<br><br>
qt-misc-no-update-available = You're up to date!<br><br>Anki { $val } is currently the newest version available.
qt-misc-automatic-syncing-and-backups-have-been = Backup successfully restored. Automatic syncing and backups have been disabled for now. To enable them again, close the profile or restart Anki.
qt-misc-back-side-only = Back Side Only
qt-misc-backing-up = Backing Up...

View file

@ -1335,7 +1335,7 @@ title="{}" {}>{}</button>""".format(
def onCheckForUpdates(self) -> None:
from aqt.update import check_for_update
check_for_update()
check_for_update(notify_if_no_update=True)
# legacy

View file

@ -15,10 +15,10 @@ from aqt.package import (
update_and_restart as _update_and_restart,
)
from aqt.qt import *
from aqt.utils import openLink, show_warning, showText, tr
from aqt.utils import openLink, show_info, show_warning, showText, tr
def check_for_update() -> None:
def check_for_update(notify_if_no_update: bool = False) -> None:
from aqt import mw
def do_check(_col: Collection) -> CheckForUpdateResponse:
@ -54,6 +54,11 @@ def check_for_update() -> None:
if ver := resp.new_version:
if mw.pm.meta.get("suppressUpdate", None) != ver:
prompt_to_update(mw, ver)
elif notify_if_no_update:
show_info(
tr.qt_misc_no_update_available(val=aqt.appVersion),
textFormat=Qt.TextFormat.RichText,
)
def on_fail(exc: Exception) -> None:
print(f"update check failed: {exc}")