If you want here is a patch. t. Tomas Kovacik wrote: Hi, |
diff -ur network-manager-openvpn-0.7~~svn20081015t024626/properties/auth-helpers.c network-manager-openvpn-0.7~~svn20081015t024626.static/properties/auth-helpers.c --- network-manager-openvpn-0.7~~svn20081015t024626/properties/auth-helpers.c 2008-10-02 21:41:09.000000000 +0200 +++ network-manager-openvpn-0.7~~svn20081015t024626.static/properties/auth-helpers.c 2008-10-30 18:10:13.132375413 +0100 @@ -301,6 +301,16 @@ if (value && strlen (value)) gtk_entry_set_text (GTK_ENTRY (widget), value); } + + widget = glade_xml_get_widget (xml, "sk_remote_address_entry"); + gtk_size_group_add_widget (group, widget); + g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (changed_cb), user_data); + if (s_vpn && s_vpn->data) { + value = g_hash_table_lookup (s_vpn->data, NM_OPENVPN_KEY_REMOTE_IP); + if (value && strlen (value)) + gtk_entry_set_text (GTK_ENTRY (widget), value); + } + } static gboolean @@ -415,6 +425,17 @@ NM_OPENVPN_KEY_LOCAL_IP); return FALSE; } + + widget = glade_xml_get_widget (xml, "sk_remote_address_entry"); + str = gtk_entry_get_text (GTK_ENTRY (widget)); + if (!str || !strlen (str)) { + g_set_error (error, + OPENVPN_PLUGIN_UI_ERROR, + OPENVPN_PLUGIN_UI_ERROR_INVALID_PROPERTY, + NM_OPENVPN_KEY_REMOTE_IP); + return FALSE; + } + } else g_assert_not_reached (); @@ -487,6 +508,7 @@ GtkTreeModel *model; GtkTreeIter iter; GtkWidget *widget; + const char *value; if (!strcmp (contype, NM_OPENVPN_CONTYPE_TLS)) { update_tls (xml, "tls", s_vpn); @@ -511,6 +527,25 @@ g_free (tmp); } } + + widget = glade_xml_get_widget (xml, "sk_local_address_entry"); + value = (char *) gtk_entry_get_text (GTK_ENTRY (widget)); + + if (value && strlen (value)) { + g_hash_table_insert (s_vpn->data, + g_strdup (NM_OPENVPN_KEY_LOCAL_IP), + g_strdup (value)); + } + + widget = glade_xml_get_widget (xml, "sk_remote_address_entry"); + value = (char *) gtk_entry_get_text (GTK_ENTRY (widget)); + + if (value && strlen (value)) { + g_hash_table_insert (s_vpn->data, + g_strdup (NM_OPENVPN_KEY_REMOTE_IP), + g_strdup (value)); + } + } else g_assert_not_reached (); diff -ur network-manager-openvpn-0.7~~svn20081015t024626/properties/nm-openvpn-dialog.glade network-manager-openvpn-0.7~~svn20081015t024626.static/properties/nm-openvpn-dialog.glade --- network-manager-openvpn-0.7~~svn20081015t024626/properties/nm-openvpn-dialog.glade 2008-10-02 21:41:09.000000000 +0200 +++ network-manager-openvpn-0.7~~svn20081015t024626.static/properties/nm-openvpn-dialog.glade 2008-10-30 18:28:00.468406458 +0100 @@ -610,7 +610,7 @@ <child> <widget class="GtkTable" id="table6"> <property name="visible">True</property> - <property name="n_rows">4</property> + <property name="n_rows">5</property> <property name="n_columns">2</property> <property name="column_spacing">6</property> <property name="row_spacing">6</property> @@ -729,6 +729,36 @@ <property name="y_options"></property> </packing> </child> + <child> + <widget class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes">Remote IP Address:</property> + </widget> + <packing> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + </packing> + </child> + <child> + <widget class="GtkAlignment" id="alignment18"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="xscale">0</property> + <child> + <widget class="GtkEntry" id="sk_remote_address_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </widget> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="y_options"></property> + </packing> + </child> </widget> <packing> <property name="position">3</property>