diff options
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-editor.c')
-rw-r--r-- | src/bookmarks/ephy-bookmarks-editor.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index 05a226005..1dbcac36a 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -80,6 +80,8 @@ static void ephy_bookmarks_editor_get_property (GObject *object, GValue *value, GParamSpec *pspec); +static void search_entry_changed_cb (GtkWidget *entry, + EphyBookmarksEditor *editor); static void cmd_open_bookmarks_in_tabs (EggAction *action, EphyBookmarksEditor *editor); static void cmd_open_bookmarks_in_browser (EggAction *action, @@ -674,6 +676,20 @@ key_pressed_cb (GtkWidget *widget, } static void +reset_search_entry (EphyBookmarksEditor *editor) +{ + g_signal_handlers_block_by_func + (G_OBJECT (editor->priv->search_entry), + G_CALLBACK (search_entry_changed_cb), + editor); + gtk_entry_set_text (GTK_ENTRY (editor->priv->search_entry), ""); + g_signal_handlers_unblock_by_func + (G_OBJECT (editor->priv->search_entry), + G_CALLBACK (search_entry_changed_cb), + editor); +} + +static void keyword_node_selected_cb (EphyNodeView *view, EphyNode *node, EphyBookmarksEditor *editor) @@ -687,6 +703,7 @@ keyword_node_selected_cb (EphyNodeView *view, } else { + reset_search_entry (editor); bookmarks_filter (editor, node); } @@ -707,8 +724,21 @@ keyword_node_show_popup_cb (GtkWidget *view, EphyBookmarksEditor *editor) static void search_entry_changed_cb (GtkWidget *entry, EphyBookmarksEditor *editor) { + EphyNode *all; char *search_text; + g_signal_handlers_block_by_func + (G_OBJECT (editor->priv->key_view), + G_CALLBACK (keyword_node_selected_cb), + editor); + all = ephy_bookmarks_get_bookmarks (editor->priv->bookmarks); + ephy_node_view_select_node (EPHY_NODE_VIEW (editor->priv->key_view), + all); + g_signal_handlers_unblock_by_func + (G_OBJECT (editor->priv->key_view), + G_CALLBACK (keyword_node_selected_cb), + editor); + search_text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1); GDK_THREADS_ENTER (); |