✨ feat(bluetooth): control scanning based on other devices section visibility
This commit is contained in:
1 file changed
+10
-5
@@ -328,13 +328,18 @@ class BluetoothConnections(Box):
|
|||||||
current_state = self.other_devices_revealer.child_revealed
|
current_state = self.other_devices_revealer.child_revealed
|
||||||
self.other_devices_revealer.child_revealed = not current_state
|
self.other_devices_revealer.child_revealed = not current_state
|
||||||
|
|
||||||
# Update button text based on state
|
# Handle scanning based on section visibility
|
||||||
if self.other_devices_revealer.child_revealed:
|
if self.client:
|
||||||
# Trigger a scan when revealing other devices and force refresh
|
if self.other_devices_revealer.child_revealed:
|
||||||
if self.client:
|
# Start scanning when revealing other devices section
|
||||||
self.client.toggle_scan()
|
if not self.client.scanning:
|
||||||
|
self.client.toggle_scan()
|
||||||
# Also force an immediate device refresh to catch any missed connections
|
# Also force an immediate device refresh to catch any missed connections
|
||||||
self.force_device_refresh()
|
self.force_device_refresh()
|
||||||
|
else:
|
||||||
|
# Stop scanning when hiding other devices section
|
||||||
|
if self.client.scanning:
|
||||||
|
self.client.toggle_scan()
|
||||||
|
|
||||||
def open_bluetooth_settings(self, *_):
|
def open_bluetooth_settings(self, *_):
|
||||||
"""Open Blueman bluetooth manager"""
|
"""Open Blueman bluetooth manager"""
|
||||||
|
|||||||
Reference in new issue
Block a user