refactor(network): replace nmcli with native D-Bus for Wi-Fi management
This commit fully migrates the Python network service away from external wlan0: connected to Amar 2GNet "MEDIATEK MT7921 802.11ax" wifi (mt7921e), 2C:98:11:76:9B:2B, hw, mtu 1500 ip4 default, ip6 default inet4 192.168.18.70/24 route4 192.168.18.0/24 metric 600 route4 default via 192.168.18.1 metric 600 inet6 2405:acc0:1306:351c:ac94:2135:f9a8:5c89/64 inet6 fe80::4057:8edd:a684:5e33/64 route6 fe80::/64 metric 1024 route6 2405:acc0:1306:351c::/64 metric 600 route6 default via fe80::1 metric 600 lo: connected (externally) to lo "lo" loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536 inet4 127.0.0.1/8 inet6 ::1/128 docker0: connected (externally) to docker0 "docker0" bridge, 0A:89:72:7F:4D:75, sw, mtu 1500 inet4 172.17.0.1/16 route4 172.17.0.0/16 metric 0 p2p-dev-wlan0: disconnected "p2p-dev-wlan0" wifi-p2p, hw enp2s0: unavailable "Realtek RTL8111/8168/8211/8411" ethernet (r8169), 40:C2:BA:53:D5:E4, hw, mtu 1500 DNS configuration: servers: 192.168.18.1 interface: wlan0 servers: fe80::1 interface: wlan0 Use "nmcli device show" to get complete information about known devices and "nmcli connection show" to get an overview on active connection profiles. Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details. subprocess calls, implementing native D-Bus communication for a more robust and integrated architecture. Key changes: - : - Implemented native D-Bus methods for , , and . - Updated to track , , and state. - Fixed a bug where D-Bus returned a tuple, preventing known networks from being parsed correctly. - : - Wired UI events to the new D-Bus connection methods. - Fixed a race condition in initialization where it missed the synchronous signal, leaving the UI permanently disabled. - Removed the early-return optimization in that was preventing the active CSS state from applying to already-known networks. - Cleaned up unused variables to satisfy linting and removed redundant blocks. - : - Removed the 5-second timeout hack, as the new D-Bus service properly fires callbacks upon connection success/failure. - Removed hardcoded WPA2 text to make the dialog security-type agnostic. - : - Cleaned up active state styling so only the SVG icon box highlights (using ) when a network is connected.
This commit is contained in:
4 files changed
+1056
-505
No files matched your search
@@ -1,6 +1,6 @@
|
||||
from enum import Enum, auto
|
||||
|
||||
from fabric.utils import Gdk, GLib, Gtk, logger
|
||||
from fabric.utils import Gdk, GLib, Gtk, idle_add, logger
|
||||
from fabric.widgets.box import Box
|
||||
from fabric.widgets.button import Button
|
||||
from fabric.widgets.centerbox import CenterBox
|
||||
@@ -518,7 +518,7 @@ class BluetoothConnections(Box):
|
||||
):
|
||||
self.client.scan()
|
||||
# Defer refresh until after the height animation completes
|
||||
GLib.idle_add(self._refresh_after_animation)
|
||||
idle_add(self._refresh_after_animation)
|
||||
|
||||
def _cancel_pending_refresh(self):
|
||||
if hasattr(self, "_anim_finished_handler") and self._anim_finished_handler:
|
||||
|
||||
Reference in new issue
Block a user