diff --git a/quickshell/Modules/Settings/NetworkTab.qml b/quickshell/Modules/Settings/NetworkTab.qml index 87ed9705..b9b25661 100644 --- a/quickshell/Modules/Settings/NetworkTab.qml +++ b/quickshell/Modules/Settings/NetworkTab.qml @@ -1935,11 +1935,6 @@ Item { label: I18n.tr("Auth Type"), value: data["connection-type"] }); - fields.push({ - label: I18n.tr("Autoconnect"), - value: configData.autoconnect ? I18n.tr("Yes") : I18n.tr("No") - }); - return fields; } @@ -1978,6 +1973,16 @@ Item { } } + DankToggle { + width: parent.width + text: I18n.tr("Autoconnect") + checked: configData ? (configData.autoconnect || false) : false + visible: !VPNService.configLoading && configData !== null + onToggled: checked => { + VPNService.updateConfig(modelData.uuid, {autoconnect: checked}); + } + } + Item { width: 1 height: Theme.spacingXS diff --git a/quickshell/Services/VPNService.qml b/quickshell/Services/VPNService.qml index e32a64a2..effc54ea 100644 --- a/quickshell/Services/VPNService.qml +++ b/quickshell/Services/VPNService.qml @@ -142,6 +142,7 @@ Singleton { } ToastService.showInfo(I18n.tr("VPN configuration updated")); DMSNetworkService.refreshVpnProfiles(); + getConfig(uuid); configUpdated(); }); } diff --git a/quickshell/Widgets/VpnProfileDelegate.qml b/quickshell/Widgets/VpnProfileDelegate.qml index 0f40e015..060c07f1 100644 --- a/quickshell/Widgets/VpnProfileDelegate.qml +++ b/quickshell/Widgets/VpnProfileDelegate.qml @@ -75,11 +75,6 @@ Rectangle { "label": I18n.tr("Auth Type"), "value": data["connection-type"] }); - fields.push({ - "key": "auto", - "label": I18n.tr("Autoconnect"), - "value": configData.autoconnect ? I18n.tr("Yes") : I18n.tr("No") - }); return fields; } @@ -271,6 +266,16 @@ Rectangle { } } + DankToggle { + width: parent.width + text: I18n.tr("Autoconnect") + checked: configData ? (configData.autoconnect || false) : false + visible: !VPNService.configLoading && configData !== null + onToggled: checked => { + VPNService.updateConfig(profile.uuid, {autoconnect: checked}); + } + } + Item { width: 1 height: Theme.spacingXS