feat: Add user feedback dialog for manual update checks and handle dialog closure
This commit is contained in:
parent
e57e822bed
commit
64378f753b
1 changed files with 30 additions and 2 deletions
|
|
@ -195,6 +195,8 @@ class MainWindow(QMainWindow):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.config = config
|
self.config = config
|
||||||
self._background_threads = [] # Keep references to background threads
|
self._background_threads = [] # Keep references to background threads
|
||||||
|
self.checking_dialog = None # Track the checking dialog
|
||||||
|
self._is_manual_check = False # Track if this is a manual check (for UI feedback)
|
||||||
|
|
||||||
# Set window properties
|
# Set window properties
|
||||||
self.setWindowTitle(f"{config.app_name} v{config.app_version}")
|
self.setWindowTitle(f"{config.app_name} v{config.app_version}")
|
||||||
|
|
@ -398,11 +400,21 @@ class MainWindow(QMainWindow):
|
||||||
def _on_manual_check_for_updates(self) -> None:
|
def _on_manual_check_for_updates(self) -> None:
|
||||||
"""Handle manual check for updates from menu.
|
"""Handle manual check for updates from menu.
|
||||||
|
|
||||||
Triggers an immediate update check (bypass cache).
|
Triggers an immediate update check (bypass cache) with user feedback dialog.
|
||||||
"""
|
"""
|
||||||
logger.info("Manual update check requested from menu")
|
logger.info("Manual update check requested from menu")
|
||||||
# Same as startup check, but user-initiated
|
|
||||||
|
# Show "Checking for Updates..." dialog
|
||||||
|
from webdrop_bridge.ui.update_manager_ui import CheckingDialog
|
||||||
|
|
||||||
|
self.checking_dialog = CheckingDialog(self)
|
||||||
|
self._is_manual_check = True
|
||||||
|
|
||||||
|
# Start the update check
|
||||||
self.check_for_updates_startup()
|
self.check_for_updates_startup()
|
||||||
|
|
||||||
|
# Show the dialog
|
||||||
|
self.checking_dialog.show()
|
||||||
|
|
||||||
def _show_about_dialog(self) -> None:
|
def _show_about_dialog(self) -> None:
|
||||||
"""Show About dialog with version and information."""
|
"""Show About dialog with version and information."""
|
||||||
|
|
@ -495,6 +507,13 @@ class MainWindow(QMainWindow):
|
||||||
worker.finished.connect(worker.deleteLater)
|
worker.finished.connect(worker.deleteLater)
|
||||||
thread.finished.connect(thread.deleteLater)
|
thread.finished.connect(thread.deleteLater)
|
||||||
|
|
||||||
|
# Close checking dialog when finished
|
||||||
|
def close_checking_dialog():
|
||||||
|
if hasattr(self, 'checking_dialog') and self.checking_dialog:
|
||||||
|
self.checking_dialog.close()
|
||||||
|
|
||||||
|
worker.finished.connect(close_checking_dialog)
|
||||||
|
|
||||||
# Keep reference to thread to prevent garbage collection
|
# Keep reference to thread to prevent garbage collection
|
||||||
self._background_threads.append(thread)
|
self._background_threads.append(thread)
|
||||||
|
|
||||||
|
|
@ -520,6 +539,15 @@ class MainWindow(QMainWindow):
|
||||||
emoji: Status emoji
|
emoji: Status emoji
|
||||||
"""
|
"""
|
||||||
self.set_update_status(status, emoji)
|
self.set_update_status(status, emoji)
|
||||||
|
|
||||||
|
# If this is a manual check and we get the "Ready" status, it means no updates
|
||||||
|
if self._is_manual_check and status == "Ready":
|
||||||
|
# Show "No Updates Available" dialog
|
||||||
|
from webdrop_bridge.ui.update_manager_ui import NoUpdateDialog
|
||||||
|
|
||||||
|
dialog = NoUpdateDialog(parent=self)
|
||||||
|
self._is_manual_check = False
|
||||||
|
dialog.exec()
|
||||||
|
|
||||||
def _on_update_available(self, release) -> None:
|
def _on_update_available(self, release) -> None:
|
||||||
"""Handle update available notification.
|
"""Handle update available notification.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue