Network/Wi-Fi: Removed auto polling every 30sec. Factorized more code and cleaned logs
This commit is contained in:
parent
fc1ee9fb2f
commit
7860c41959
4 changed files with 21 additions and 33 deletions
|
|
@ -15,14 +15,6 @@ NIconButton {
|
|||
|
||||
sizeRatio: 0.8
|
||||
|
||||
Component.onCompleted: {
|
||||
Logger.log("WiFi", "Widget component completed")
|
||||
Logger.log("WiFi", "NetworkService available:", !!NetworkService)
|
||||
if (NetworkService) {
|
||||
Logger.log("WiFi", "NetworkService.networks available:", !!NetworkService.networks)
|
||||
}
|
||||
}
|
||||
|
||||
colorBg: Color.mSurfaceVariant
|
||||
colorFg: Color.mOnSurface
|
||||
colorBorder: Color.transparent
|
||||
|
|
@ -44,7 +36,7 @@ NIconButton {
|
|||
}
|
||||
return connected ? NetworkService.signalIcon(signalStrength) : "wifi_find"
|
||||
} catch (error) {
|
||||
Logger.error("WiFi", "Error getting icon:", error)
|
||||
Logger.error("Wi-Fi", "Error getting icon:", error)
|
||||
return "signal_wifi_bad"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,22 +12,14 @@ ColumnLayout {
|
|||
spacing: Style.marginL * scaling
|
||||
|
||||
NToggle {
|
||||
label: "WiFi Enabled"
|
||||
description: "Enable WiFi connectivity."
|
||||
label: "Enable Wi-Fi"
|
||||
description: "Enable Wi-Fi connectivity."
|
||||
checked: Settings.data.network.wifiEnabled
|
||||
onToggled: checked => {
|
||||
Settings.data.network.wifiEnabled = checked
|
||||
NetworkService.setWifiEnabled(checked)
|
||||
if (checked) {
|
||||
ToastService.showNotice("WiFi", "Enabled")
|
||||
} else {
|
||||
ToastService.showNotice("WiFi", "Disabled")
|
||||
}
|
||||
}
|
||||
onToggled: checked => NetworkService.setWifiEnabled(checked)
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: "Bluetooth Enabled"
|
||||
label: "Enable Bluetooth"
|
||||
description: "Enable Bluetooth connectivity."
|
||||
checked: Settings.data.network.bluetoothEnabled
|
||||
onToggled: checked => {
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ NPanel {
|
|||
}
|
||||
|
||||
NText {
|
||||
text: "Scanning for networks..."
|
||||
text: "Searching for nearby networks..."
|
||||
font.pointSize: Style.fontSizeNormal * scaling
|
||||
color: Color.mOnSurfaceVariant
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
|
@ -584,7 +584,7 @@ NPanel {
|
|||
}
|
||||
|
||||
NButton {
|
||||
text: "Scan Again"
|
||||
text: "Scan again"
|
||||
icon: "refresh"
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
onClicked: NetworkService.scan()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue