diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2002-07-18 00:57:38 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2002-07-18 00:57:38 +0800 |
commit | 6dee50394a99a1d1e2e95309764bfedbcd95275d (patch) | |
tree | 4d7d1745e379482cfc108bcdfc24842c7d94e34c | |
parent | 60a6928a18ccbab616f7d6c8ad52fc5995a99fb9 (diff) | |
download | gsoc2013-evolution-6dee50394a99a1d1e2e95309764bfedbcd95275d.tar gsoc2013-evolution-6dee50394a99a1d1e2e95309764bfedbcd95275d.tar.gz gsoc2013-evolution-6dee50394a99a1d1e2e95309764bfedbcd95275d.tar.bz2 gsoc2013-evolution-6dee50394a99a1d1e2e95309764bfedbcd95275d.tar.lz gsoc2013-evolution-6dee50394a99a1d1e2e95309764bfedbcd95275d.tar.xz gsoc2013-evolution-6dee50394a99a1d1e2e95309764bfedbcd95275d.tar.zst gsoc2013-evolution-6dee50394a99a1d1e2e95309764bfedbcd95275d.zip |
(setup_standard_verbs): Set the <commands> 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
-rw-r--r-- | widgets/misc/ChangeLog | 17 | ||||
-rw-r--r-- | widgets/misc/e-search-bar.c | 29 |
2 files changed, 41 insertions, 5 deletions
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 <ettore@ximian.com> + + [Fix #27854, spurious warnings from ESearchBar.] + + * e-search-bar.c (setup_standard_verbs): Set the <commands> 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 <ettore@ximian.com> * 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, "/", + ("<commands>" + " <cmd name=\"ESearchBar:Clear\"/>" + " <cmd name=\"ESearchBar:FindNow\"/>" + "</commands>"), + 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")); @@ -538,6 +543,18 @@ update_bonobo_menus (ESearchBar *esb) } 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); } } |