From 766d4e29fe8b1599199492bf67c7ca2e00a64c8c Mon Sep 17 00:00:00 2001 From: SimplifiedPrivacy Date: Fri, 23 Oct 2026 20:32:39 -0400 Subject: [PATCH] Disconnect directly --- gui/v2/actions/menu_coordinator.py | 25 ++++++++++++------------- gui/v2/ui/pages/menu_page.py | 19 ++++++++++--------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gui/v2/actions/menu_coordinator.py b/gui/v2/actions/menu_coordinator.py index b69dc50..01b6271 100644 --- a/gui/v2/actions/menu_coordinator.py +++ b/gui/v2/actions/menu_coordinator.py @@ -239,11 +239,7 @@ def connect_with_billing_code(profile_id: int, billing_code: str) -> Result: return literally_connect(profile_id=profile_id) -@type_checker -def literally_disconnect( - profile_id: int, - ignore_state_conflict: Optional[bool] = False -) -> Result: +def literally_disconnect(profile_id: int) -> Result: """Get a profile and use core to disable it.""" # Step 1: Get the Profile @@ -254,8 +250,9 @@ def literally_disconnect( profile = profile_result.data # EXCEPTIONS - ignored = get_ignored_exceptions(ignore_state_conflict=ignore_state_conflict) + ignored = get_ignored_exceptions(ignore_state_conflict=False) + print("Literally disconnecting") try: final_result = disable_profile( profile=profile, @@ -272,11 +269,13 @@ def literally_disconnect( return translate_error(error=error, profile_id=profile_id) + def disconnect_profile(profile_id: int, ui_caller: Callable) -> Result: - """Background Thread to literally_disconnect""" - take_action( - action=literally_disconnect, - ui_caller=ui_caller, - profile_id=profile_id - ) - return Result(valid=True) + print("GUI is disconnecting a profile") + return literally_disconnect(profile_id) + + # take_action( + # action=literally_disconnect, + # ui_caller=ui_caller, + # profile_id=profile_id + # ) diff --git a/gui/v2/ui/pages/menu_page.py b/gui/v2/ui/pages/menu_page.py index fce2bd7..e6089aa 100755 --- a/gui/v2/ui/pages/menu_page.py +++ b/gui/v2/ui/pages/menu_page.py @@ -199,6 +199,7 @@ class MenuPage(Page): # 3. Connection Status connected = is_connected(profile_id) + print(f"is {profile_id} connected? {connected}") # 4. Route: if connected: @@ -584,13 +585,15 @@ class MenuPage(Page): def post_disconnect(self, result: Result): """Recieve the callback after disconnection""" + print(f"result is {result}") + # -------------------- # BOTTOM LEFT STATUS BAR # -------------------- - if result.message: - if len(result.message) > 20: - self.update_status.disable_marquee - self.update_status.update_status(result.message) + # if result.message: + # if len(result.message) > 20: + # self.update_status.disable_marquee + # self.update_status.update_status(result.message) # -------------------- # WORKED @@ -651,11 +654,9 @@ class MenuPage(Page): def disconnect(self): self.update_status.update_status("Disconnecting...") - disconnect_profile(profile_id=self.reverse_id, ui_caller=self.post_disconnect) - - - - + print(f"Disconnecting profile {self.reverse_id}") + result = disconnect_profile(profile_id=self.reverse_id, ui_caller=self.post_disconnect) + print("Disconnected") # self._set_task_busy(True) # self.worker = disable_profile(self.reverse_id, self.connection_manager.get_connected_profiles(),