1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

Restore Wifi Services UI

This commit is contained in:
purian23
2025-07-29 22:20:06 -04:00
parent 35c6efdcc5
commit d8ab38a0af
2 changed files with 10 additions and 7 deletions

View File

@@ -66,12 +66,18 @@ Item {
// Auto-enable WiFi auto-refresh when network tab is visible
Component.onCompleted: {
NetworkService.addRef();
NetworkService.autoRefreshEnabled = true;
if (NetworkService.wifiEnabled)
NetworkService.scanWifi();
// Start smart monitoring
wifiMonitorTimer.start();
}
Component.onDestruction: {
NetworkService.removeRef();
NetworkService.autoRefreshEnabled = false;
}
// Two-column layout for WiFi and Ethernet (WiFi on left, Ethernet on right)
Row {

View File

@@ -46,18 +46,15 @@ Singleton {
function addRef() {
refCount++;
console.log("NetworkService: addRef, refCount now:", refCount);
if (refCount === 1) {
// Start monitoring when first consumer appears
networkStatusChecker.running = true;
}
// Reference counting affects WiFi scanning operations only
// Basic network status monitoring always runs
}
function removeRef() {
refCount = Math.max(0, refCount - 1);
console.log("NetworkService: removeRef, refCount now:", refCount);
// Stop intensive WiFi operations when no consumers
if (refCount === 0) {
// Stop monitoring when no consumers
networkStatusChecker.running = false;
autoRefreshTimer.running = false;
}
}
@@ -78,7 +75,7 @@ Singleton {
Process {
id: networkStatusChecker
command: ["sh", "-c", "nmcli -t -f DEVICE,TYPE,STATE device | grep -E '(ethernet|wifi)' && echo '---' && ip link show | grep -E '^[0-9]+:.*ethernet.*state UP'"]
running: false
running: true
stdout: StdioCollector {
onStreamFinished: {