diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-10-24 09:48:20 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-10-24 09:48:20 +0800 |
commit | 4b68843dfa4f807b5b768e65d353b30d3ca91d1a (patch) | |
tree | de10c105fc9cf0029268ead7e572c0678a889165 /widgets/misc/e-search-bar.c | |
parent | d45b7b4852ed7972f40f65af0b04b02de8b696a5 (diff) | |
download | gsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.tar.gz gsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.tar.zst gsoc2013-evolution-4b68843dfa4f807b5b768e65d353b30d3ca91d1a.zip |
If the clear button was pressed, we want the entry to be sensitive (not
2002-10-23 Jeffrey Stedfast <fejj@ximian.com>
* e-filter-bar.c (option_changed): If the clear button was
pressed, we want the entry to be sensitive (not insensitive).
* e-search-bar.c (e_search_bar_set_item_id): If the item id is
CLEAR_ID, we want to select the first item (0) but still set the
esb->item_id to CLEAR_ID.
(set_find_now_sensitive): Don't bother getting the GtkEntry text,
we don't even use it?
(clear_search): Set the item id as E_SEARCHBAR_CLEAR_ID rather
than 0 so that it can be checked for.
svn path=/trunk/; revision=18421
Diffstat (limited to 'widgets/misc/e-search-bar.c')
-rw-r--r-- | widgets/misc/e-search-bar.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 784ff94979..76a26f0e98 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -78,15 +78,11 @@ static void set_find_now_sensitive (ESearchBar *search_bar, gboolean sensitive) { - const char *text; - - text = gtk_entry_get_text (GTK_ENTRY (search_bar->entry)); - if (search_bar->ui_component != NULL) bonobo_ui_component_set_prop (search_bar->ui_component, "/commands/ESearchBar:FindNow", "sensitive", sensitive ? "1" : "0", NULL); - + gtk_widget_set_sensitive (search_bar->activate_button, sensitive); } @@ -103,7 +99,7 @@ static void clear_search (ESearchBar *esb) { e_search_bar_set_text (esb, ""); - e_search_bar_set_item_id (esb, 0); + e_search_bar_set_item_id (esb, E_SEARCHBAR_CLEAR_ID); } /* Frees an array of subitem information */ @@ -966,10 +962,9 @@ e_search_bar_set_suboption (ESearchBar *search_bar, int option_id, ESearchBarSub GtkWidget *item; ESearchBarSubitem *old_subitems; ESearchBarSubitem *new_subitems; - - g_return_if_fail (search_bar != NULL); + g_return_if_fail (E_IS_SEARCH_BAR (search_bar)); - + row = find_id (search_bar->option_menu, option_id, "EsbChoiceId", &item); g_return_if_fail (row != -1); g_assert (item != NULL); @@ -1079,13 +1074,13 @@ void e_search_bar_set_item_id (ESearchBar *search_bar, int id) { int row; - - g_return_if_fail (search_bar != NULL); + g_return_if_fail (E_IS_SEARCH_BAR (search_bar)); - - row = find_id (search_bar->option_menu, id, "EsbChoiceId", NULL); + + row = id == E_SEARCHBAR_CLEAR_ID ? 0 : id; + row = find_id (search_bar->option_menu, row, "EsbChoiceId", NULL); g_return_if_fail (row != -1); - + search_bar->item_id = id; gtk_option_menu_set_history (GTK_OPTION_MENU (search_bar->option), row); emit_query_changed (search_bar); @@ -1185,7 +1180,6 @@ e_search_bar_set_ids (ESearchBar *search_bar, int item_id, int subitem_id) void e_search_bar_set_text (ESearchBar *search_bar, const char *text) { - g_return_if_fail (search_bar != NULL); g_return_if_fail (E_IS_SEARCH_BAR (search_bar)); e_utf8_gtk_editable_set_text (GTK_EDITABLE (search_bar->entry), text); |