pragma ComponentBehavior: Bound import QtQuick import QtQuick.Layouts import Quickshell.Networking import "../controls" import "../../components" import "../../services" SettingsPage { Component.onCompleted: NetworkService.scanning = true Component.onDestruction: NetworkService.scanning = false SettingsSection { SettingRow { title: "Wi-Fi" description: NetworkService.available ? NetworkService.summary : "No Wi-Fi adapter. Wired connections and advanced options are available in your network manager." icon: "󰖩" GlassToggle { checked: NetworkService.enabled enabled: NetworkService.available && NetworkService.backend.wifiHardwareEnabled onClicked: { NetworkService.toggle(); checked = Qt.binding(() => NetworkService.enabled); } Accessible.name: "Wi-Fi" } } SettingRow { title: "Advanced connections" description: "VPN, enterprise and wired settings in your network manager" icon: "󰒓" GlassButton { text: "Open…" enabled: !SystemService.acting onClicked: SystemService.action("manager", "network", false) } } } SettingsSection { title: "Networks" visible: networks.count > 0 Repeater { id: networks model: NetworkService.networks SettingRow { id: entry required property var modelData readonly property bool psk: [WifiSecurityType.WpaPsk, WifiSecurityType.Wpa2Psk, WifiSecurityType.Sae].includes(modelData.security) readonly property bool supported: modelData.known || modelData.device.type === DeviceType.Wired || modelData.security === WifiSecurityType.Open || psk title: modelData.name + " · " + modelData.device.name description: modelData.connected ? "Connected" : modelData.stateChanging ? "Connecting…" : modelData.known ? "Saved connection" : supported ? "Available" : "Use advanced connections for this security type" icon: modelData.connected ? "󰤨" : "󰤟" GlassTextField { id: password visible: entry.psk && !entry.modelData.known && !entry.modelData.connected echoMode: TextInput.Password placeholderText: "Wi-Fi password" Layout.preferredWidth: 180 inputMethodHints: Qt.ImhSensitiveData | Qt.ImhNoPredictiveText Accessible.name: "Wi-Fi password" } GlassButton { text: entry.modelData.connected ? "Disconnect" : "Connect" accented: !entry.modelData.connected enabled: entry.supported && !entry.modelData.stateChanging && !NetworkService.pending onClicked: { NetworkService.connectNetwork(entry.modelData, password.text); password.clear(); } } } } } SettingNote { warning: true text: NetworkService.error } SettingNote { warning: true text: SystemService.error } }