Re-add "Connect Automatically" toggle for WireGuard VPN
Hi,
On Fedora 40 with Gnome Settings 46, the "Connect Automatically" toggle is no longer present, at least for my WireGuard VPNs. This feature was useful for me, as it allowed for having a VPN always enabled. The VPN I had configured to auto-connect in Gnome 45 still do so, but I am unable to disable it (short of removing the VPN) or enable it for another VPN.
As far as I can tell, this was disabled as part of !1996 (merged), specifically this change.
After editing out the check g_str_equal(type, NM_SETTING_WIREGUARD_SETTING_NAME)
and building in a toolbox, the setting reappears. After installing network-manager-applet
in the toolbox, I am able to toggle and save the setting. That said, removing the check also makes it appear on the Add VPN dialog, which seems to be the reason for the check in the first place. If that is the intention, changing it out with a check of self->is_new_connection
keeps it hidden there.
Here is a diff of the proposed behaviour:
diff --git a/panels/network/connection-editor/ce-page-details.c b/panels/network/connection-editor/ce-page-details.c
index 534c01a96..c6c42eb7f 100644
--- a/panels/network/connection-editor/ce-page-details.c
+++ b/panels/network/connection-editor/ce-page-details.c
@@ -485,8 +485,7 @@ connect_details_page (CEPageDetails *self)
}
/* Auto connect check */
- if (g_str_equal (type, NM_SETTING_VPN_SETTING_NAME) ||
- g_str_equal(type, NM_SETTING_WIREGUARD_SETTING_NAME)) {
+ if (g_str_equal (type, NM_SETTING_VPN_SETTING_NAME) || self->is_new_connection) {
gtk_widget_set_visible (GTK_WIDGET (self->auto_connect_check), FALSE);
} else {
g_object_bind_property (sc, "autoconnect",