From f446063c572a9278fa3ce8e6b359c541ace68814 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 25 Feb 2003 07:03:46 +0000 Subject: Same as below. 2003-02-25 Jeffrey Stedfast * e-dateedit.c (on_date_popup_date_selected): Same as below. * e-cell-date-edit.c (e_cell_date_edit_on_ok_clicked): Also updated to use the new GDate API from glib 2.0 * test-calendar.c (on_selection_changed): Fixed to use glib 2.0's GDate API. * e-calendar-item.c (e_calendar_item_get_week_number): Port to glib 2.0's GDate API. (e_calendar_item_set_selection): Same. * e-search-bar.c (append_xml_menu_item): Use g_string_append_printf instead of g_string_sprintfa since the latter is now deprecated. (setup_bonobo_menus): Same. * e-filter-bar.c (do_advanced): Use gtk_window_set_resizable() * e-charset-picker.c: Fixes to make it build cleanly with -DG_DISABLE_DEPRECATED (add_charset): Escape _'s so we don't get underline weirdness due to GtkLabel thinking the _ means to underline the next char. (e_charset_picker_bonobo_ui_populate): Same here. svn path=/trunk/; revision=20048 --- widgets/misc/e-search-bar.c | 47 ++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 22 deletions(-) (limited to 'widgets/misc/e-search-bar.c') diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 2b58d98421..9845f76320 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -25,7 +25,10 @@ * Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H #include +#endif #include #include @@ -490,16 +493,16 @@ append_xml_menu_item (GString *xml, const char *accelerator) { char *encoded_label; - + encoded_label = bonobo_ui_util_encode_str (label); - g_string_sprintfa (xml, ""); + g_string_append_printf (xml, " accel=\"%s\"", accelerator); + + g_string_append (xml, "/>"); } static void @@ -509,37 +512,37 @@ setup_bonobo_menus (ESearchBar *esb) GSList *p; char *verb_name; char *encoded_title; - + xml = g_string_new (""); - + encoded_title = bonobo_ui_util_encode_str (_("_Search")); - g_string_sprintfa (xml, "", encoded_title); + g_string_append_printf (xml, "", encoded_title); g_free (encoded_title); - - g_string_sprintfa (xml, ""); - + + g_string_append (xml, ""); + append_xml_menu_item (xml, "FindNow", _("_Find Now"), "ESearchBar:FindNow", NULL); append_xml_menu_item (xml, "Clear", _("_Clear"), "ESearchBar:Clear", "*Control**Shift*b"); - + for (p = esb->menu_items; p != NULL; p = p->next) { const ESearchBarItem *item; - + item = (const ESearchBarItem *) p->data; - + verb_name = verb_name_from_id (item->id); bonobo_ui_component_add_verb (esb->ui_component, verb_name, search_verb_cb, esb); - + if (item->text == NULL) g_string_append (xml, ""); else append_xml_menu_item (xml, verb_name, item->text, verb_name, NULL); - + g_free (verb_name); } - - g_string_sprintfa (xml, ""); - g_string_sprintfa (xml, ""); - + + g_string_append (xml, ""); + g_string_append (xml, ""); + bonobo_ui_component_set (esb->ui_component, "/menu/SearchPlaceholder", xml->str, NULL); g_string_free (xml, TRUE); -- cgit v1.2.3