From 6dee50394a99a1d1e2e95309764bfedbcd95275d Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 17 Jul 2002 16:57:38 +0000 Subject: (setup_standard_verbs): Set the part of the XML manually with bonobo_ui_component_set() otherwise the verbs don't get added on the other side for us to be able to do bonobo_ui_component_set_prop(). (setup_bonobo_menus): New, menu setup code taken from update_bonobo_menus(). (remove_bonobo_menus): New; removes the Bonobo menus. (update_bonobo_menus): Rewritten, just call remove_bonobo_menus() first and setup_bonobo_menus() then. (e_search_bar_set_ui_component): Call setup_bonobo_menus() and remove_bonobo_menus() as appropriate instead of just update_bonobo_menus(). svn path=/trunk/; revision=17490 --- widgets/misc/ChangeLog | 17 +++++++++++++++++ widgets/misc/e-search-bar.c | 29 ++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 5 deletions(-) (limited to 'widgets') diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index c4e2f0d5ed..dab760980f 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,20 @@ +2002-07-17 Ettore Perazzoli + + [Fix #27854, spurious warnings from ESearchBar.] + + * e-search-bar.c (setup_standard_verbs): Set the part + of the XML manually with bonobo_ui_component_set() otherwise the + verbs don't get added on the other side for us to be able to do + bonobo_ui_component_set_prop(). + (setup_bonobo_menus): New, menu setup code taken from + update_bonobo_menus(). + (remove_bonobo_menus): New; removes the Bonobo menus. + (update_bonobo_menus): Rewritten, just call remove_bonobo_menus() + first and setup_bonobo_menus() then. + (e_search_bar_set_ui_component): Call setup_bonobo_menus() and + remove_bonobo_menus() as appropriate instead of just + update_bonobo_menus(). + 2002-07-02 Ettore Perazzoli * e-search-bar.c (update_sensitivity): Removed. diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index ec7891f770..93896a1a72 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -210,6 +210,13 @@ setup_standard_verbs (ESearchBar *search_bar) bonobo_ui_component_add_verb (search_bar->ui_component, "ESearchBar:FindNow", search_now_verb_cb, search_bar); + bonobo_ui_component_set (search_bar->ui_component, "/", + ("" + " " + " " + ""), + NULL); + /* Make sure the entries are created with the correct sensitivity. */ set_find_now_sensitive (search_bar, FALSE); } @@ -493,15 +500,13 @@ append_xml_menu_item (GString *xml, } static void -update_bonobo_menus (ESearchBar *esb) +setup_bonobo_menus (ESearchBar *esb) { GString *xml; GSList *p; char *verb_name; char *encoded_title; - bonobo_ui_component_rm (esb->ui_component, "/menu/SearchPlaceholder/Search", NULL); - xml = g_string_new (""); encoded_title = bonobo_ui_util_encode_str (_("_Search")); @@ -537,6 +542,18 @@ update_bonobo_menus (ESearchBar *esb) g_string_free (xml, TRUE); } +static void +remove_bonobo_menus (ESearchBar *esb) +{ + bonobo_ui_component_rm (esb->ui_component, "/menu/SearchPlaceholder/Search", NULL); +} + +static void +update_bonobo_menus (ESearchBar *esb) +{ + setup_bonobo_menus (esb); +} + static void set_menu (ESearchBar *esb, ESearchBarItem *items) @@ -994,14 +1011,16 @@ e_search_bar_set_ui_component (ESearchBar *search_bar, { g_return_if_fail (E_IS_SEARCH_BAR (search_bar)); - if (search_bar->ui_component != NULL) + if (search_bar->ui_component != NULL) { + remove_bonobo_menus (search_bar); bonobo_object_unref (BONOBO_OBJECT (search_bar->ui_component)); + } search_bar->ui_component = ui_component; if (ui_component != NULL) { bonobo_object_ref (BONOBO_OBJECT (ui_component)); setup_standard_verbs (search_bar); - update_bonobo_menus (search_bar); + setup_bonobo_menus (search_bar); } } -- cgit v1.2.3