mirror of
https://github.com/Omni-guides/Jackify.git
synced 2026-01-17 19:47:00 +01:00
Sync from development - prepare for v0.1.2
This commit is contained in:
@@ -528,6 +528,10 @@ class JackifyMainWindow(QMainWindow):
|
||||
from jackify.backend.services.protontricks_detection_service import ProtontricksDetectionService
|
||||
self.protontricks_service = ProtontricksDetectionService(steamdeck=self.system_info.is_steamdeck)
|
||||
|
||||
# Initialize update service
|
||||
from jackify.backend.services.update_service import UpdateService
|
||||
self.update_service = UpdateService(__version__)
|
||||
|
||||
debug_print(f"GUI Backend initialized - Steam Deck: {self.system_info.is_steamdeck}")
|
||||
|
||||
def _is_steamdeck(self):
|
||||
@@ -735,6 +739,32 @@ class JackifyMainWindow(QMainWindow):
|
||||
print(f"Error checking protontricks: {e}")
|
||||
# Continue anyway - don't block startup on detection errors
|
||||
|
||||
def _check_for_updates_on_startup(self):
|
||||
"""Check for updates on startup in background thread"""
|
||||
try:
|
||||
debug_print("Checking for updates on startup...")
|
||||
|
||||
def update_check_callback(update_info):
|
||||
"""Handle update check results"""
|
||||
try:
|
||||
if update_info:
|
||||
debug_print(f"Update available: v{update_info.version}")
|
||||
# Show update dialog
|
||||
from jackify.frontends.gui.dialogs.update_dialog import UpdateDialog
|
||||
dialog = UpdateDialog(update_info, self.update_service, self)
|
||||
dialog.show() # Non-blocking
|
||||
else:
|
||||
debug_print("No updates available")
|
||||
except Exception as e:
|
||||
debug_print(f"Error showing update dialog: {e}")
|
||||
|
||||
# Check for updates in background
|
||||
self.update_service.check_for_updates_async(update_check_callback)
|
||||
|
||||
except Exception as e:
|
||||
debug_print(f"Error checking for updates on startup: {e}")
|
||||
# Continue anyway - don't block startup on update check errors
|
||||
|
||||
def cleanup_processes(self):
|
||||
"""Clean up any running processes before closing"""
|
||||
try:
|
||||
@@ -843,6 +873,9 @@ def main():
|
||||
window = JackifyMainWindow(dev_mode=dev_mode)
|
||||
window.show()
|
||||
|
||||
# Start background update check after window is shown
|
||||
window._check_for_updates_on_startup()
|
||||
|
||||
# Ensure cleanup on exit
|
||||
import atexit
|
||||
atexit.register(emergency_cleanup)
|
||||
|
||||
Reference in New Issue
Block a user