nm: Make server port configurable in GUI
[strongswan.git] / src / frontends / gnome / properties / nm-strongswan.c
index 5204d9a..7f12a26 100644 (file)
@@ -305,6 +305,12 @@ init_plugin_ui (StrongswanPluginUiWidget *self, NMConnection *connection, GError
                gtk_entry_set_text (GTK_ENTRY (widget), value);
        g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (settings_changed_cb), self);
 
                gtk_entry_set_text (GTK_ENTRY (widget), value);
        g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (settings_changed_cb), self);
 
+       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "server-port-entry"));
+       value = nm_setting_vpn_get_data_item (settings, "server-port");
+       if (value)
+               gtk_entry_set_text (GTK_ENTRY (widget), value);
+       g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (settings_changed_cb), self);
+
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user-entry"));
        value = nm_setting_vpn_get_data_item (settings, "user");
        if (value)
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user-entry"));
        value = nm_setting_vpn_get_data_item (settings, "user");
        if (value)
@@ -495,6 +501,12 @@ update_connection (NMVpnEditor *iface,
                nm_setting_vpn_add_data_item (settings, "remote-identity", str);
        }
 
                nm_setting_vpn_add_data_item (settings, "remote-identity", str);
        }
 
+       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "server-port-entry"));
+       str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
+       if (str && strlen (str)) {
+               nm_setting_vpn_add_data_item (settings, "server-port", str);
+       }
+
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "method-combo"));
        switch (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)))
        {
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "method-combo"));
        switch (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)))
        {