# HG changeset patch # User Richard Laager # Date 1132336654 0 # Node ID 44104dfce57bae3eae2f089ae3152c62588d2ac5 # Parent 370f9d7868f925876c09df31c05e735d91a328c8 [gaim-migrate @ 14437] Double-clicking on pounces in the pounce manager is now supported. committer: Tailor Script diff -r 370f9d7868f9 -r 44104dfce57b src/gtkpounce.c --- a/src/gtkpounce.c Fri Nov 18 16:37:51 2005 +0000 +++ b/src/gtkpounce.c Fri Nov 18 17:57:34 2005 +0000 @@ -1034,6 +1034,31 @@ gtk_widget_set_sensitive(dialog->delete_button, (num_selected > 0)); } +static gboolean +pounce_double_click_cb(GtkTreeView *treeview, GdkEventButton *event, gpointer user_data) +{ + PouncesManager *dialog = user_data; + GtkTreePath *path; + GtkTreeIter iter; + GaimPounce *pounce; + + /* 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_path_free(path); + gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, POUNCES_MANAGER_COLUMN_POUNCE, &pounce, -1); + + if ((pounce != NULL) && (event->button == 1) && + (event->type == GDK_2BUTTON_PRESS)) + { + gaim_gtk_pounce_editor_show(NULL, NULL, pounce); + return TRUE; + } + + return FALSE; +} + static void pounces_manager_persists_cb(GtkCellRendererToggle *renderer, gchar *path_str, gpointer user_data) @@ -1107,6 +1132,11 @@ g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(pounce_selected_cb), dialog); + /* Handle double-clicking */ + g_signal_connect(G_OBJECT(treeview), "button_press_event", + G_CALLBACK(pounce_double_click_cb), dialog); + + gtk_container_add(GTK_CONTAINER(sw), treeview); gtk_widget_show(treeview);