From 7e0741f407bbcdbd58c2f07acbba03d06f5c0928 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Sat, 29 Mar 2003 02:16:56 +0000 Subject: set the sub item to the default as well 2003-03-28 JP Rosevear * e-search-bar.c (clear_search): set the sub item to the default as well svn path=/trunk/; revision=20572 --- widgets/misc/ChangeLog | 5 +++++ widgets/misc/e-search-bar.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 45c2e10737..ba73f83a99 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,8 @@ +2003-03-28 JP Rosevear + + * e-search-bar.c (clear_search): set the sub item to the default + as well + 2003-03-25 Dan Winship * e-calendar.c: #include gtkarrow.h diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 9845f76320..484fb12c42 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -73,6 +73,9 @@ enum { /* Forward decls. */ +static int find_id (GtkWidget *menu, int idin, const char *type, GtkWidget **widget); +static void activate_by_subitems (ESearchBar *esb, gint item_id, ESearchBarSubitem *subitems); + static void emit_search_activated (ESearchBar *esb); static void emit_query_changed (ESearchBar *esb); @@ -103,8 +106,18 @@ verb_name_from_id (int id) static void clear_search (ESearchBar *esb) { + int item_row; + GtkWidget *widget; + ESearchBarSubitem *subitems; + e_search_bar_set_text (esb, ""); e_search_bar_set_item_id (esb, 0); + + item_row = find_id (esb->option_menu, 0, "EsbChoiceId", &widget); + + subitems = g_object_get_data (G_OBJECT (widget), "EsbChoiceSubitems"); + activate_by_subitems (esb, 0, subitems); + emit_search_activated (esb); } -- cgit