mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-21 21:30:39 +01:00
2006-11-19 Dan Williams <dcbw@redhat.com>
Patch from Dan Berrange <dan@berrange.com> Gnome.org #377262 * gnome/vpn-properties/nm-vpn-properties.c - clean up after renamed VPN connection git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2114 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
9eb18fcedf
commit
1f69789fcd
2 changed files with 19 additions and 4 deletions
|
|
@ -1,3 +1,9 @@
|
|||
2006-11-19 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Patch from Dan Berrange <dan@berrange.com> Gnome.org #377262
|
||||
* gnome/vpn-properties/nm-vpn-properties.c
|
||||
- clean up after renamed VPN connection
|
||||
|
||||
2006-11-19 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Patch from Dan Berrange <dan@berrange.com> Gnome.org #377205
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ static gboolean
|
|||
add_vpn_connection (const char *conn_name, const char *service_name, GSList *conn_data, GSList *routes)
|
||||
{
|
||||
char *gconf_key;
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreeIter iter;
|
||||
char conn_gconf_path[PATH_MAX];
|
||||
char *escaped_conn_name;
|
||||
|
|
@ -148,7 +149,10 @@ add_vpn_connection (const char *conn_name, const char *service_name, GSList *con
|
|||
|
||||
if (gconf_client_dir_exists (gconf_client, conn_gconf_path, NULL))
|
||||
goto out;
|
||||
|
||||
|
||||
if ((selection = gtk_tree_view_get_selection (vpn_conn_view)) == NULL)
|
||||
goto out;
|
||||
|
||||
/* User-visible name of connection */
|
||||
gconf_key = g_strdup_printf ("%s/name", conn_gconf_path);
|
||||
gconf_client_set_string (gconf_client, gconf_key, conn_name, NULL);
|
||||
|
|
@ -190,6 +194,7 @@ add_vpn_connection (const char *conn_name, const char *service_name, GSList *con
|
|||
VPNCONN_GCONF_COLUMN, conn_gconf_path,
|
||||
VPNCONN_USER_CAN_EDIT_COLUMN, &conn_user_can_edit,
|
||||
-1);
|
||||
gtk_tree_selection_select_iter (selection, &iter);
|
||||
|
||||
ret = TRUE;
|
||||
|
||||
|
|
@ -635,12 +640,19 @@ edit_cb (GtkButton *button, gpointer user_data)
|
|||
const char *conn_name;
|
||||
char key[PATH_MAX];
|
||||
char *conn_gconf_path;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeSelection *selection;
|
||||
|
||||
/*printf ("edit_cb\n");*/
|
||||
|
||||
if (!retrieve_data_from_selected_connection (¤t_vpn_ui, &conn_vpn_data, &conn_routes, &conn_name, &conn_gconf_path))
|
||||
goto out;
|
||||
|
||||
if ((selection = gtk_tree_view_get_selection (vpn_conn_view)) == NULL)
|
||||
goto out;
|
||||
|
||||
if (!gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
goto out;
|
||||
|
||||
vpn_details_widget_get_current(conn_vpn_data, conn_routes, conn_name);
|
||||
g_slist_free (conn_vpn_data);
|
||||
|
|
@ -679,9 +691,6 @@ edit_cb (GtkButton *button, gpointer user_data)
|
|||
|
||||
gconf_client_suggest_sync (gconf_client, NULL);
|
||||
} else {
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreeIter iter;
|
||||
|
||||
selection = gtk_tree_view_get_selection (vpn_conn_view);
|
||||
gtk_tree_selection_get_selected (selection, NULL, &iter);
|
||||
remove_vpn_connection (conn_gconf_path, &iter);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue