From 7b5415e5005aa1b7142d288af466b58b7e95ac42 Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Sat, 27 Oct 2001 00:07:29 +0000 Subject: convert the formatted date to UTF-8. 2001-10-26 Damon Chaplin * gui/e-itip-control.c (write_label_piece): convert the formatted date to UTF-8. * cal-util/cal-recur.c (CAL_OBJ_DEBUG): turn off debug functions. * gui/dialogs/comp-editor-util.c (parse_contact_string): handle UTF8 correctly. Bug #4450. Good enough for 1.0. * gui/e-week-view-event-item.c (e_week_view_draw_time): set the gc color before drawing. Should fix bug #11469. * gui/dialogs/task-editor.c (task_editor_edit_comp): show or hide the meeting page as appropriate. Note this may be called more than once, if the task gets updated somewhere else and the user clicks 'Update the object'. Hopefully fixes bug #12930. * gui/print.c (print_comp_item): printed more fields and made a little prettier. Fixes bug #9352. (print_date_label): used the correct timezones for each date field. * *.c: removed several debug messages. svn path=/trunk/; revision=14187 --- calendar/gui/dialogs/comp-editor-util.c | 30 +++++++++++++++++++----------- calendar/gui/dialogs/comp-editor.c | 4 ++-- calendar/gui/dialogs/event-page.c | 3 ++- calendar/gui/dialogs/recurrence-page.c | 2 ++ calendar/gui/dialogs/task-editor.c | 9 +++++++-- calendar/gui/dialogs/task-page.c | 1 - 6 files changed, 32 insertions(+), 17 deletions(-) (limited to 'calendar/gui/dialogs') diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index 77939beee8..f031f35556 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -359,8 +360,7 @@ comp_editor_show_contacts_dialog (GNOME_Evolution_Addressbook_SelectNames corba_ /* A simple 'name ' parser. Input should be UTF8. - FIXME: Should probably use camel functions or something. - Also note that this is broken wrt UTF8 - can't use strchr etc. */ + FIXME: Should probably use camel functions or something. */ static void parse_contact_string (const char *value, char **name, char **email) { @@ -372,8 +372,8 @@ parse_contact_string (const char *value, char **name, char **email) return; } - lbracket = strchr (value, '<'); - rbracket = strchr (value, '>'); + lbracket = g_utf8_strchr (value, '<'); + rbracket = g_utf8_strchr (value, '>'); if (!lbracket || !rbracket || rbracket < lbracket) { *name = g_strdup (value); @@ -381,9 +381,9 @@ parse_contact_string (const char *value, char **name, char **email) return; } - name_end = lbracket - 1; - while (name_end > value && isspace (*name_end)) - name_end--; + name_end = g_utf8_prev_char (lbracket); + while (name_end > value && g_unichar_isspace (g_utf8_get_char (name_end))) + name_end = g_utf8_prev_char (name_end); tmp_name = g_malloc (name_end - value + 2); strncpy (tmp_name, value, name_end - value + 1); @@ -395,8 +395,10 @@ parse_contact_string (const char *value, char **name, char **email) tmp_email[rbracket - lbracket - 1] = '\0'; *email = tmp_email; +#if 0 g_print ("Parsed: %s\n Name:'%s'\nEmail:'%s'\n", value, *name, *email); +#endif } @@ -431,7 +433,9 @@ comp_editor_contacts_to_widget (GtkWidget *contacts_entry, g_ptr_array_add (dest_array, NULL); contacts_string = e_destination_exportv ((EDestination**) dest_array->pdata); +#if 0 g_print ("Destinations: %s\n", contacts_string ? contacts_string : ""); +#endif bonobo_widget_set_property (BONOBO_WIDGET (contacts_entry), "destinations", contacts_string, NULL); @@ -460,7 +464,9 @@ comp_editor_contacts_to_component (GtkWidget *contacts_entry, bonobo_widget_get_property (BONOBO_WIDGET (contacts_entry), "destinations", &contacts_string, NULL); +#if 0 g_print ("Contacts string: %s\n", contacts_string ? contacts_string : ""); +#endif contact_destv = e_destination_importv (contacts_string); if (contact_destv) { @@ -472,16 +478,18 @@ comp_editor_contacts_to_component (GtkWidget *contacts_entry, t->altrep = NULL; /* If both name and email are given, use the standard - 'name ' form, otherwise use just the name + '"name" ' form, otherwise use just the name or the email address. FIXME: I'm not sure this is correct syntax etc. */ if (name && name[0] && email && email[0]) - t->value = g_strdup_printf ("%s <%s>", + t->value = g_strdup_printf ("\"%s\" <%s>", name, email); else if (name && name[0]) - t->value = g_strdup (name); + t->value = g_strdup_printf ("\"%s\"", + name); else - t->value = g_strdup (email); + t->value = g_strdup_printf ("<%s>", + email); contact_list = g_slist_prepend (contact_list, t); diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 077bff879c..6b5b78252c 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -1133,7 +1133,7 @@ print_cmd (GtkWidget *widget, gpointer data) CalComponent *comp; comp = comp_editor_get_current_comp (editor); - print_comp (comp, FALSE); + print_comp (comp, editor->priv->client, FALSE); gtk_object_unref (GTK_OBJECT (comp)); } @@ -1144,7 +1144,7 @@ print_preview_cmd (GtkWidget *widget, gpointer data) CalComponent *comp; comp = comp_editor_get_current_comp (editor); - print_comp (comp, TRUE); + print_comp (comp, editor->priv->client, TRUE); gtk_object_unref (GTK_OBJECT (comp)); } diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 9c89fbdf53..57fd3ac0ef 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -445,7 +445,9 @@ contacts_changed_cb (BonoboListener *listener, epage = EVENT_PAGE (data); priv = epage->priv; +#if 0 g_print ("In contacts_changed_cb\n"); +#endif if (!priv->updating) comp_editor_page_notify_changed (COMP_EDITOR_PAGE (epage)); @@ -1171,7 +1173,6 @@ contacts_clicked_cb (GtkWidget *button, gpointer data) epage = EVENT_PAGE (data); priv = epage->priv; - g_print ("In contacts_clicked_cb\n"); comp_editor_show_contacts_dialog (priv->corba_select_names); /* FIXME: Currently we aren't getting the changed event from the diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index c76b6dd970..02ce2ed064 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -831,7 +831,9 @@ fill_component (RecurrencePage *rpage, CalComponent *comp) *cdt->value = *dt->value; cdt->tzid = g_strdup (dt->tzid); +#if 0 g_print ("Adding exception is_date: %i\n", cdt->value->is_date); +#endif list = g_slist_prepend (list, cdt); } diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 5db5597e65..863977192c 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -218,12 +218,17 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp) cal_component_get_attendee_list (comp, &attendees); if (attendees == NULL) { - comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->meet_page)); + if (priv->meeting_shown) + comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->meet_page)); priv->meeting_shown = FALSE; - set_menu_sens (te); } else { GSList *l; + if (!priv->meeting_shown) + comp_editor_append_page (COMP_EDITOR (te), + COMP_EDITOR_PAGE (priv->meet_page), + _("Assignment")); + for (l = attendees; l != NULL; l = l->next) { CalComponentAttendee *ca = l->data; EMeetingAttendee *ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_cal_component_attendee (ca)); diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index d60ca5ba5b..084bbcbde8 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -754,7 +754,6 @@ contacts_clicked_cb (GtkWidget *button, gpointer data) tpage = TASK_PAGE (data); priv = tpage->priv; - g_print ("In contacts_clicked_cb\n"); comp_editor_show_contacts_dialog (priv->corba_select_names); /* FIXME: Currently we aren't getting the changed event from the -- cgit v1.2.3