summary refs log tree commit diff stats
path: root/src/fe-gtk/menu.c
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-09-15 02:55:18 -0400
committerTingPing <tingping@tingping.se>2013-09-15 02:55:18 -0400
commitbc8eaf6588dabc759dd90cf53668168f2388c018 (patch)
treee8c15050dca2875f10291d55ac1f6e5af8b14d1c /src/fe-gtk/menu.c
parent59b19bac70d6504c63ce745233077b63d261dc7f (diff)
parentb0b8f40791de39eb6a7ee301d2edada80ad32338 (diff)
Replace search window with a searchbar
Diffstat (limited to 'src/fe-gtk/menu.c')
-rw-r--r--src/fe-gtk/menu.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c
index b1f1333d..8d87f84e 100644
--- a/src/fe-gtk/menu.c
+++ b/src/fe-gtk/menu.c
@@ -1236,41 +1236,19 @@ menu_quit (GtkWidget * wid, gpointer none)
 static void
 menu_search ()
 {
-	search_open (current_sess);
+	mg_search_toggle (current_sess);
 }
 
 static void
-menu_search_next ()
+menu_search_next (GtkWidget *wid)
 {
-	GtkXText *xtext = GTK_XTEXT (current_sess->gui->xtext);
-	xtext_buffer *buf = xtext->buffer;
-
-	if (!gtk_xtext_search (xtext, buf->search_text,
-		(buf->search_flags & (case_match | follow | regexp)), NULL))
-	{
-		fe_message (_("Search hit end, not found."), FE_MSG_ERROR);
-	}
+	mg_search_handle_next(wid, current_sess);
 }
 
 static void
-menu_search_prev ()
+menu_search_prev (GtkWidget *wid)
 {
-	GtkXText *xtext = GTK_XTEXT (current_sess->gui->xtext);
-	xtext_buffer *buf = xtext->buffer;
-
-	if (!gtk_xtext_search(xtext, buf->search_text,
-		(buf->search_flags & (case_match | follow | regexp)) | backward, NULL))
-	{
-		fe_message (_("Search hit end, not found."), FE_MSG_ERROR);
-	}
-}
-
-static void
-menu_search_reset ()
-{
-	GtkXText *xtext = GTK_XTEXT (current_sess->gui->xtext);
-
-	gtk_xtext_search (xtext, "", 0, NULL);
+	mg_search_handle_previous(wid, current_sess);
 }
 
 static void
@@ -1787,7 +1765,6 @@ static struct mymenu mymenu[] = {
 #define SEARCH_OFFSET 68
 	{N_("Search"), 0, GTK_STOCK_JUSTIFY_LEFT, M_MENUSUB, 0, 0, 1},
 		{N_("Search Text..."), menu_search, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_f},
-		{N_("Reset Search"), menu_search_reset, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_F},
 		{N_("Search Next"   ), menu_search_next, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_g},
 		{N_("Search Previous"   ), menu_search_prev, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_G},
 		{0, 0, 0, M_END, 0, 0, 0},