From 69dce75b19486ca4329b6ba6306767224e03e283 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 18 Dec 2025 19:25:21 +0100 Subject: [PATCH] update: fixed systemwide profile backgrounds --- gui/__main__.py | 43 +++++++++++++++++++++---------------------- pyproject.toml | 2 +- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/gui/__main__.py b/gui/__main__.py index ff4a9ec..cad9ac4 100755 --- a/gui/__main__.py +++ b/gui/__main__.py @@ -1473,13 +1473,16 @@ class MenuPage(Page): self.eliminacion() def show_disconnect_button(self, toggle, profile_type, target_button): - if target_button.isChecked(): - if profile_type == 1: - self.disconnect_button.setVisible(toggle) - self.boton_just_session.setVisible(not toggle) - else: - self.disconnect_system_wide_button.setVisible(toggle) - self.boton_just.setVisible(not toggle) + try: + if target_button.isChecked(): + if profile_type == 1: + self.disconnect_button.setVisible(toggle) + self.boton_just_session.setVisible(not toggle) + else: + self.disconnect_system_wide_button.setVisible(toggle) + self.boton_just.setVisible(not toggle) + except RuntimeError: + pass def match_core_profiles(self, profiles_dict): new_dict = {} @@ -1560,7 +1563,6 @@ class MenuPage(Page): self.button_states.clear() self.connection_manager._connected_profiles.clear() self.IsSystem = 0 - for profile_id, profile in profiles.items(): if ProfileController.is_enabled(profile): self.connection_manager.add_connected_profile(profile_id) @@ -2191,16 +2193,7 @@ class MenuPage(Page): self.main_window.on_label.setParent(None) self.main_window.off_label.setParent(None) - for widget in self.scroll_widget.findChildren(QLabel): - widget.setParent(None) - - for widget in self.scroll_widget.findChildren(QPushButton): - widget.setParent(None) - - self.profile_info.clear() - self.profile_button_map.clear() - self.button_states.clear() - self.buttons.clear() + self.refresh_menu_buttons() self.main_window.toggle_bg.setParent(self.main_window.toggle_button) self.main_window.toggle_handle.setParent(self.main_window.toggle_button) @@ -2337,11 +2330,17 @@ class MenuPage(Page): if profile_type == 1: if target_button: icon_path = self.connected_tor_profile if profile_connection == 'tor' else self.connected_profile - target_button.setIcon(QIcon(icon_path)) + try: + target_button.setIcon(QIcon(icon_path)) + except RuntimeError: + pass self.button_states[profile_id] = icon_path else: if target_button: - target_button.setIcon(QIcon(self.system_wide_connected_profile)) + try: + target_button.setIcon(QIcon(self.system_wide_connected_profile)) + except RuntimeError: + pass self.update_status.update_image(appearance_value='background_connected') self.button_states[profile_id] = self.system_wide_connected_profile self.IsSystem += 1 @@ -2368,10 +2367,10 @@ class MenuPage(Page): self.boton_edit.setEnabled(True) - self.refresh_menu_buttons() - if profile_id == self.reverse_id: self.print_profile_details(f"Profile_{profile_id}") + + self.refresh_menu_buttons() except IndexError: self.update_status.update_status('An error occurred while updating profile state.') diff --git a/pyproject.toml b/pyproject.toml index 04276ef..1cc56e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sp-hydra-veil-gui" -version = "2.0.0" +version = "2.0.1" authors = [ { name = "Simplified Privacy" }, ]