# HG changeset patch # User Mark Doliner # Date 1109444383 0 # Node ID 43ab987a0222875564317451d3e0902b787ac308 # Parent 84fb7beabb5c84ca12ee028aa8a44b36660e6ca2 [gaim-migrate @ 12145] sf patch #1151314, from Ephraim Double click to modify account in Accounts window committer: Tailor Script diff -r 84fb7beabb5c -r 43ab987a0222 src/gtkaccount.c --- a/src/gtkaccount.c Sat Feb 26 18:27:52 2005 +0000 +++ b/src/gtkaccount.c Sat Feb 26 18:59:43 2005 +0000 @@ -2168,6 +2168,32 @@ gtk_widget_set_sensitive(dialog->delete_button, selected); } +static gboolean +account_treeview_double_click_cb(GtkTreeView *treeview, GdkEventButton *event, gpointer user_data) +{ + AccountsWindow *dialog; + GtkTreePath *path; + GtkTreeIter iter; + GaimAccount *account; + + dialog = (AccountsWindow *)user_data; + + /* Figure out which node was clicked */ + if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, NULL, NULL, NULL)) + return FALSE; + gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path); + gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, COLUMN_DATA, &account, -1); + + if ((account != NULL) && (event->button == 1) && + (event->type == GDK_2BUTTON_PRESS)) + { + gaim_gtk_account_dialog_show(GAIM_GTK_MODIFY_ACCOUNT_DIALOG, account); + return TRUE; + } + + return FALSE; +} + static GtkWidget * create_accounts_list(AccountsWindow *dialog) { @@ -2201,6 +2227,10 @@ g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(account_selected_cb), dialog); + /* Handle double-clicking */ + g_signal_connect(G_OBJECT(treeview), "button_press_event", + G_CALLBACK(account_treeview_double_click_cb), dialog); + gtk_container_add(GTK_CONTAINER(sw), treeview); gtk_widget_show(treeview);