From 66af39f2472c069dbbb8702ed0cf785e7183a433 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Wed, 17 Jun 2026 02:01:35 +0545 Subject: [PATCH] =?UTF-8?q?=20refactor(src/window/controlcenter):=20migrat?= =?UTF-8?q?e=20WiFi=20handling=20to=20use=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=E2=94=82=20=E2=94=82=20network=5Fservice=20abstraction?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=E2=94=82=20=E2=94=82=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=E2=94=82=20=E2=94=82=20Updated=20lo?= =?UTF-8?q?gic=20to=20delegate=20network=20operations=20through=20NetworkS?= =?UTF-8?q?ervice,=20renamed=20=E2=94=82=20=E2=94=82=20signal=20listeners,?= =?UTF-8?q?=20and=20simplified=20connectivity=20checks=20focusing=20on=20s?= =?UTF-8?q?ervice=20=20=20=20=20=E2=94=82=20=E2=94=82=20availability=20rat?= =?UTF-8?q?her=20than=20session=20object=20emission.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/window/panel/components/indicators.py | 33 +++++++++-------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/window/panel/components/indicators.py b/src/window/panel/components/indicators.py index 014e4ea..7f19096 100644 --- a/src/window/panel/components/indicators.py +++ b/src/window/panel/components/indicators.py @@ -193,12 +193,8 @@ class NetworkIndicator(Box): self.wifi_window._pointing_widget = self.network_button modus_service.connect("wlan-changed", self.on_wlan_changed) - self.network_service.connect("wifi-device-added", self.on_wifi_device_added) - self.network_service.connect( - "ethernet-device-added", self.on_ethernet_device_added - ) - self.network_service.connect("changed", self.on_network_changed) - + self.network_service.connect("device-ready", self.on_wifi_device_added) + self.network_service.connect("device-ready", self.on_ethernet_device_added) self.update_modus_service_wlan_state() self.update_state() @@ -236,13 +232,12 @@ class NetworkIndicator(Box): if self.network_service.wifi_device: wifi = self.network_service.wifi_device - if not wifi.wireless_enabled: + if not wifi.enabled: wlan_state = "disabled" - elif wifi.active_access_point: - ap = wifi.active_access_point - wlan_state = f"connected:{ap.ssid}" - if ap.strength >= 0: - wlan_state += f":{ap.strength}%" + elif wifi.ssid: + wlan_state = f"connected:{wifi.ssid}" + if wifi.strength >= 0: + wlan_state += f":{wifi.strength}%" else: wlan_state = "enabled" @@ -267,17 +262,15 @@ class NetworkIndicator(Box): # Check WiFi first (prioritize WiFi over Ethernet) if self.network_service.wifi_device: wifi = self.network_service.wifi_device - if not wifi.wireless_enabled: + if not wifi.enabled: icon_file = "wifi-off-clear.svg" tooltip = "WiFi disabled" - elif wifi.active_access_point: - ap = wifi.active_access_point - # Use dynamic WiFi icon based on signal strength - wifi_icon_path = get_wifi_icon_for_strength(ap.strength) + elif wifi.ssid: + wifi_icon_path = get_wifi_icon_for_strength(wifi.strength) self.network_icon.set_from_file(wifi_icon_path) - tooltip = f"Connected to {ap.ssid}" - if ap.strength >= 0: - tooltip += f" ({ap.strength}%)" + tooltip = f"Connected to {wifi.ssid}" + if wifi.strength >= 0: + tooltip += f" ({wifi.strength}%)" self.network_button.set_tooltip_text(tooltip) return # Early return to avoid setting icon again else: