aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-search-bar.c
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc/e-search-bar.c')
-rw-r--r--widgets/misc/e-search-bar.c29
1 files changed, 24 insertions, 5 deletions
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);
}
}