From be3f9354aabf67e52eb5b064d1e24675c7669cb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Geulfucci?= Date: Sun, 31 May 2009 22:27:08 +0200 Subject: [PATCH] Edit search engines in the dialogue with Enter or double click --- midori/midori-searchaction.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/midori/midori-searchaction.c b/midori/midori-searchaction.c index 22790ff8..e5196249 100644 --- a/midori/midori-searchaction.c +++ b/midori/midori-searchaction.c @@ -1016,6 +1016,20 @@ midori_search_action_get_editor (MidoriSearchAction* search_action, gtk_widget_destroy (dialog); } +static void +midori_search_action_activate_edit_cb (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + MidoriSearchAction* search_action) +{ + GtkTreeSelection* selection; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)); + if (gtk_tree_selection_get_selected (selection, NULL, NULL)) + midori_search_action_get_editor (search_action, FALSE); +} + + static void midori_search_action_dialog_add_cb (GtkWidget* widget, MidoriSearchAction* search_action) @@ -1228,6 +1242,8 @@ midori_search_action_get_dialog (MidoriSearchAction* search_action) g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)), "changed", G_CALLBACK (midori_search_action_treeview_selection_cb), search_action); + g_signal_connect (treeview, "row-activated", + G_CALLBACK (midori_search_action_activate_edit_cb), search_action); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); g_object_set_data (G_OBJECT (treeview), "search-action", search_action); column = gtk_tree_view_column_new (); -- 2.39.5