From 64378f753b5e785a8774b49d6343a9d913a84637 Mon Sep 17 00:00:00 2001 From: claudi Date: Thu, 29 Jan 2026 15:52:59 +0100 Subject: [PATCH] feat: Add user feedback dialog for manual update checks and handle dialog closure --- src/webdrop_bridge/ui/main_window.py | 32 ++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/webdrop_bridge/ui/main_window.py b/src/webdrop_bridge/ui/main_window.py index f7b131b..7dcc8c8 100644 --- a/src/webdrop_bridge/ui/main_window.py +++ b/src/webdrop_bridge/ui/main_window.py @@ -195,6 +195,8 @@ class MainWindow(QMainWindow): super().__init__(parent) self.config = config 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 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: """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") - # 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() + + # Show the dialog + self.checking_dialog.show() def _show_about_dialog(self) -> None: """Show About dialog with version and information.""" @@ -495,6 +507,13 @@ class MainWindow(QMainWindow): worker.finished.connect(worker.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 self._background_threads.append(thread) @@ -520,6 +539,15 @@ class MainWindow(QMainWindow): emoji: 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: """Handle update available notification.