summaryrefslogtreecommitdiff
path: root/modules/controlcenter/network/WirelessDetails.qml
diff options
context:
space:
mode:
authorATMDA <atdma2600@gmail.com>2025-11-12 22:31:11 -0500
committerATMDA <atdma2600@gmail.com>2025-11-12 22:31:11 -0500
commit6ae1313b6b61c965ccc5f2d9d61458d7a5ed21b8 (patch)
treeb08ec89e8c44db6ff0e31f7254e1a010487e981d /modules/controlcenter/network/WirelessDetails.qml
parentcontrolcenter: wireless panel refactoring (diff)
downloadcaelestia-shell-6ae1313b6b61c965ccc5f2d9d61458d7a5ed21b8.tar.gz
caelestia-shell-6ae1313b6b61c965ccc5f2d9d61458d7a5ed21b8.tar.bz2
caelestia-shell-6ae1313b6b61c965ccc5f2d9d61458d7a5ed21b8.zip
controlcenter: wireless panel refactoring
Diffstat (limited to 'modules/controlcenter/network/WirelessDetails.qml')
-rw-r--r--modules/controlcenter/network/WirelessDetails.qml24
1 files changed, 21 insertions, 3 deletions
diff --git a/modules/controlcenter/network/WirelessDetails.qml b/modules/controlcenter/network/WirelessDetails.qml
index 418c463..3e48b55 100644
--- a/modules/controlcenter/network/WirelessDetails.qml
+++ b/modules/controlcenter/network/WirelessDetails.qml
@@ -19,10 +19,22 @@ Item {
Component.onCompleted: {
updateDeviceDetails();
+ checkSavedProfile();
}
onNetworkChanged: {
updateDeviceDetails();
+ checkSavedProfile();
+ }
+
+ function checkSavedProfile(): void {
+ // Refresh saved connections list to ensure it's up to date
+ // This ensures the "Forget Network" button visibility is accurate
+ if (network && network.ssid) {
+ // Always refresh to ensure we have the latest saved connections
+ // This is important when networks are selected or changed
+ Network.listConnectionsProc.running = true;
+ }
}
Connections {
@@ -80,7 +92,13 @@ Item {
SimpleButton {
Layout.fillWidth: true
Layout.topMargin: Appearance.spacing.normal
- visible: root.network && root.network.ssid && Network.savedConnections.includes(root.network.ssid)
+ visible: {
+ if (!root.network || !root.network.ssid) {
+ return false;
+ }
+ // Check if profile exists - this will update reactively when savedConnectionSsids changes
+ return Network.hasSavedProfile(root.network.ssid);
+ }
color: Colours.palette.m3errorContainer
onColor: Colours.palette.m3onErrorContainer
text: qsTr("Forget Network")
@@ -164,8 +182,8 @@ Item {
function connectToNetwork(): void {
if (root.network.isSecure) {
- // Check if we have a saved connection profile for this network
- const hasSavedProfile = Network.savedConnections.includes(root.network.ssid);
+ // Check if we have a saved connection profile for this network (by SSID)
+ const hasSavedProfile = Network.hasSavedProfile(root.network.ssid);
if (hasSavedProfile) {
// Try connecting with saved password - don't show dialog if it fails