[epiphany] Use GtkSeachEntry instead of EphySearchEntry



commit 52b87722689ed8a124b6cafcf51f7309b7c7104c
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Nov 6 12:19:00 2012 +0100

    Use GtkSeachEntry instead of EphySearchEntry
    
    Does pretty the same thing, without the cut'n'paste.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687744

 src/bookmarks/ephy-bookmarks-editor.c |   14 ++++++++------
 src/ephy-history-window.c             |   12 +++++-------
 2 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index d74e060..81b03aa 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -33,7 +33,6 @@
 #include "ephy-node-common.h"
 #include "ephy-node-view.h"
 #include "ephy-prefs.h"
-#include "ephy-search-entry.h"
 #include "ephy-session.h"
 #include "ephy-settings.h"
 #include "ephy-shell.h"
@@ -1323,7 +1322,7 @@ keyword_node_selected_cb (EphyNodeView *view,
 	}
 	else
 	{
-		ephy_search_entry_clear (EPHY_SEARCH_ENTRY (editor->priv->search_entry));
+		gtk_entry_set_text (GTK_ENTRY (editor->priv->search_entry), "");
 		bookmarks_filter (editor, node);
 	}
 }
@@ -1341,9 +1340,10 @@ keyword_node_show_popup_cb (GtkWidget *view, EphyBookmarksEditor *editor)
 }
 
 static void
-search_entry_search_cb (GtkWidget *entry, const char *search_text, EphyBookmarksEditor *editor)
+search_entry_changed_cb (GtkWidget *entry, EphyBookmarksEditor *editor)
 {
 	EphyNode *all;
+	const char *search_text;
 
 	g_signal_handlers_block_by_func
 		(G_OBJECT (editor->priv->key_view),
@@ -1357,6 +1357,8 @@ search_entry_search_cb (GtkWidget *entry, const char *search_text, EphyBookmarks
 		 G_CALLBACK (keyword_node_selected_cb),
 		 editor);
 
+	search_text = gtk_entry_get_text (GTK_ENTRY (entry));
+
 	ephy_node_filter_empty (editor->priv->bookmarks_filter);
 	ephy_node_filter_add_expression (editor->priv->bookmarks_filter,
 					 ephy_node_filter_expression_new (EPHY_NODE_FILTER_EXPRESSION_STRING_PROP_CONTAINS,
@@ -1388,11 +1390,11 @@ build_search_box (EphyBookmarksEditor *editor)
 	gtk_container_set_border_width (GTK_CONTAINER (box), 6);
 	gtk_widget_show (box);
 
-	entry = ephy_search_entry_new ();
+	entry = gtk_search_entry_new ();
 	editor->priv->search_entry = entry;
 	
-	g_signal_connect (G_OBJECT (entry), "search",
-			  G_CALLBACK (search_entry_search_cb),
+	g_signal_connect (G_OBJECT (entry), "changed",
+			  G_CALLBACK (search_entry_changed_cb),
 			  editor);
 	add_entry_monitor (editor, entry);
 	add_focus_monitor (editor, entry);
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index c657275..f845017 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -31,7 +31,6 @@
 #include "ephy-hosts-store.h"
 #include "ephy-hosts-view.h"
 #include "ephy-prefs.h"
-#include "ephy-search-entry.h"
 #include "ephy-session.h"
 #include "ephy-settings.h"
 #include "ephy-shell.h"
@@ -90,8 +89,7 @@ static void cmd_select_all		  (GtkAction *action,
 					   EphyHistoryWindow *editor);
 static void cmd_help_contents		  (GtkAction *action,
 					   EphyHistoryWindow *editor);
-static void search_entry_search_cb	  (GtkWidget *entry,
-					   char *search_text,
+static void search_entry_changed_cb	  (GtkWidget *entry,
 					   EphyHistoryWindow *editor);
 static void
 filter_now (EphyHistoryWindow *editor, gboolean hosts, gboolean pages);
@@ -764,7 +762,7 @@ key_pressed_cb (GtkWidget *view,
 }
 
 static void
-search_entry_search_cb (GtkWidget *entry, char *search_text, EphyHistoryWindow *editor)
+search_entry_changed_cb (GtkWidget *entry, EphyHistoryWindow *editor)
 {
 	filter_now (editor, FALSE, TRUE);
 }
@@ -786,7 +784,7 @@ build_search_box (EphyHistoryWindow *editor)
 	gtk_container_set_border_width (GTK_CONTAINER (box), 6);
 	gtk_widget_show (box);
 
-	entry = ephy_search_entry_new ();
+	entry = gtk_search_entry_new ();
 	add_focus_monitor (editor, entry);
 	add_entry_monitor (editor, entry);
 	editor->priv->search_entry = entry;
@@ -840,8 +838,8 @@ build_search_box (EphyHistoryWindow *editor)
 	g_signal_connect (combo, "changed",
 			  G_CALLBACK (time_combo_changed_cb),
 			  editor);
-	g_signal_connect (G_OBJECT (entry), "search",
-			  G_CALLBACK (search_entry_search_cb),
+	g_signal_connect (G_OBJECT (entry), "changed",
+			  G_CALLBACK (search_entry_changed_cb),
 			  editor);
 
 	return box;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]