]> spindle.queued.net Git - midori/commitdiff
Edit search engines in the dialogue with Enter or double click
authorJérôme Geulfucci <jeromeg@xfce.org>
Sun, 31 May 2009 20:27:08 +0000 (22:27 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 31 May 2009 20:27:08 +0000 (22:27 +0200)
midori/midori-searchaction.c

index 22790ff8f3626fe1df52225699b488056e3b6bb9..e519624946e8141aa6d742578ca543f42f2e4040 100644 (file)
@@ -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 ();