mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
Restore Wifi Services UI
This commit is contained in:
@@ -66,12 +66,18 @@ Item {
|
|||||||
|
|
||||||
// Auto-enable WiFi auto-refresh when network tab is visible
|
// Auto-enable WiFi auto-refresh when network tab is visible
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
NetworkService.addRef();
|
||||||
NetworkService.autoRefreshEnabled = true;
|
NetworkService.autoRefreshEnabled = true;
|
||||||
if (NetworkService.wifiEnabled)
|
if (NetworkService.wifiEnabled)
|
||||||
NetworkService.scanWifi();
|
NetworkService.scanWifi();
|
||||||
// Start smart monitoring
|
// Start smart monitoring
|
||||||
wifiMonitorTimer.start();
|
wifiMonitorTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: {
|
||||||
|
NetworkService.removeRef();
|
||||||
|
NetworkService.autoRefreshEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Two-column layout for WiFi and Ethernet (WiFi on left, Ethernet on right)
|
// Two-column layout for WiFi and Ethernet (WiFi on left, Ethernet on right)
|
||||||
Row {
|
Row {
|
||||||
|
|||||||
@@ -46,18 +46,15 @@ Singleton {
|
|||||||
function addRef() {
|
function addRef() {
|
||||||
refCount++;
|
refCount++;
|
||||||
console.log("NetworkService: addRef, refCount now:", refCount);
|
console.log("NetworkService: addRef, refCount now:", refCount);
|
||||||
if (refCount === 1) {
|
// Reference counting affects WiFi scanning operations only
|
||||||
// Start monitoring when first consumer appears
|
// Basic network status monitoring always runs
|
||||||
networkStatusChecker.running = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeRef() {
|
function removeRef() {
|
||||||
refCount = Math.max(0, refCount - 1);
|
refCount = Math.max(0, refCount - 1);
|
||||||
console.log("NetworkService: removeRef, refCount now:", refCount);
|
console.log("NetworkService: removeRef, refCount now:", refCount);
|
||||||
|
// Stop intensive WiFi operations when no consumers
|
||||||
if (refCount === 0) {
|
if (refCount === 0) {
|
||||||
// Stop monitoring when no consumers
|
|
||||||
networkStatusChecker.running = false;
|
|
||||||
autoRefreshTimer.running = false;
|
autoRefreshTimer.running = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,7 +75,7 @@ Singleton {
|
|||||||
Process {
|
Process {
|
||||||
id: networkStatusChecker
|
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'"]
|
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 {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
|
|||||||
Reference in New Issue
Block a user