summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/gui/updates.py
diff options
context:
space:
mode:
authorWarry <FunWarry@users.noreply.github.com>2025-12-04 12:03:31 +0100
committerWarry <FunWarry@users.noreply.github.com>2025-12-04 12:03:31 +0100
commit75868b32d07aafe46b69649d2da0dc2c833f112d (patch)
tree970a50f4cbf141af0e5e0856e087e347f3b5be48 /tidal_dl_ng/gui/updates.py
parent428d34056be16ed9d28597253b333dfbd7f21a47 (diff)
downloadtidal-dl-ng-75868b32d07aafe46b69649d2da0dc2c833f112d.tar.gz
refactor: Restructure GUI components into separate modules for improved maintainability
Diffstat (limited to 'tidal_dl_ng/gui/updates.py')
-rw-r--r--tidal_dl_ng/gui/updates.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tidal_dl_ng/gui/updates.py b/tidal_dl_ng/gui/updates.py
new file mode 100644
index 0000000..099210c
--- /dev/null
+++ b/tidal_dl_ng/gui/updates.py
@@ -0,0 +1,25 @@
+"""Updates mixin for MainWindow.
+
+Handles application update checking.
+"""
+
+from tidal_dl_ng import update_available
+from tidal_dl_ng.dialog import DialogVersion
+from tidal_dl_ng.model.meta import ReleaseLatest
+
+
+class UpdatesMixin:
+ """Mixin containing update checking methods."""
+
+ def on_update_check(self, on_startup: bool = True) -> None:
+ """Check for application updates and emit update signals."""
+ is_available, info = update_available()
+
+ if (on_startup and is_available) or not on_startup:
+ self.s_update_show.emit(True, is_available, info)
+
+ def on_version(
+ self, update_check: bool = False, update_available: bool = False, update_info: ReleaseLatest | None = None
+ ) -> None:
+ """Show the version information dialog."""
+ DialogVersion(self, update_check, update_available, update_info)