mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
prevent duplicate scan triggers
This commit is contained in:
@@ -36,6 +36,7 @@ SmartPanel {
|
|||||||
ethernetInfoExpanded = false;
|
ethernetInfoExpanded = false;
|
||||||
if (NetworkService.wifiEnabled && !NetworkService.scanningActive) {
|
if (NetworkService.wifiEnabled && !NetworkService.scanningActive) {
|
||||||
NetworkService.scan();
|
NetworkService.scan();
|
||||||
|
NetworkService.refreshActiveWifiDetails();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (NetworkService.ethernetConnected) {
|
if (NetworkService.ethernetConnected) {
|
||||||
@@ -50,11 +51,13 @@ SmartPanel {
|
|||||||
onEffectivelyVisibleChanged: {
|
onEffectivelyVisibleChanged: {
|
||||||
if (effectivelyVisible) {
|
if (effectivelyVisible) {
|
||||||
SystemStatService.registerComponent("network-panel");
|
SystemStatService.registerComponent("network-panel");
|
||||||
NetworkService.scan();
|
if (NetworkService.wifiEnabled && !NetworkService.scanningActive) {
|
||||||
// Preload active Wi‑Fi details so Info shows instantly
|
NetworkService.scan();
|
||||||
NetworkService.refreshActiveWifiDetails();
|
NetworkService.refreshActiveWifiDetails();
|
||||||
// Also fetch Ethernet details if connected
|
}
|
||||||
NetworkService.refreshActiveEthernetDetails();
|
if (NetworkService.ethernetConnected) {
|
||||||
|
NetworkService.refreshActiveEthernetDetails();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SystemStatService.unregisterComponent("network-panel");
|
SystemStatService.unregisterComponent("network-panel");
|
||||||
}
|
}
|
||||||
@@ -178,14 +181,12 @@ SmartPanel {
|
|||||||
text: I18n.tr("common.wifi")
|
text: I18n.tr("common.wifi")
|
||||||
tabIndex: 0
|
tabIndex: 0
|
||||||
checked: modeTabBar.currentIndex === 0
|
checked: modeTabBar.currentIndex === 0
|
||||||
enabled: NetworkService.wifiAvailable
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NTabButton {
|
NTabButton {
|
||||||
text: I18n.tr("common.ethernet")
|
text: I18n.tr("common.ethernet")
|
||||||
tabIndex: 1
|
tabIndex: 1
|
||||||
checked: modeTabBar.currentIndex === 1
|
checked: modeTabBar.currentIndex === 1
|
||||||
enabled: NetworkService.ethernetAvailable
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,26 +75,17 @@ Item {
|
|||||||
onEffectivelyVisibleChanged: {
|
onEffectivelyVisibleChanged: {
|
||||||
if (effectivelyVisible) {
|
if (effectivelyVisible) {
|
||||||
SystemStatService.registerComponent("wifi-subtab");
|
SystemStatService.registerComponent("wifi-subtab");
|
||||||
if (NetworkService.wifiEnabled && !NetworkService.scanningActive) {
|
if (NetworkService.wifiEnabled && !NetworkService.scanningActive && !showOnlyLists) {
|
||||||
NetworkService.scan();
|
NetworkService.scan();
|
||||||
|
NetworkService.refreshActiveWifiDetails();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SystemStatService.unregisterComponent("wifi-subtab");
|
SystemStatService.unregisterComponent("wifi-subtab");
|
||||||
NetworkService.scanningActive = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (effectivelyVisible) {
|
|
||||||
SystemStatService.registerComponent("wifi-subtab");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
SystemStatService.unregisterComponent("wifi-subtab");
|
SystemStatService.unregisterComponent("wifi-subtab");
|
||||||
if (effectivelyVisible) {
|
|
||||||
NetworkService.scanningActive = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
|||||||
Reference in New Issue
Block a user