aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-10-27 08:07:29 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-10-27 08:07:29 +0800
commit7b5415e5005aa1b7142d288af466b58b7e95ac42 (patch)
tree0204cc0c59e6c3b8bbb5c1fb556fed1b3a04f6d7 /calendar/gui/dialogs
parent067aaf149ec31e530a344167f59a895eefb350b8 (diff)
downloadgsoc2013-evolution-7b5415e5005aa1b7142d288af466b58b7e95ac42.tar
gsoc2013-evolution-7b5415e5005aa1b7142d288af466b58b7e95ac42.tar.gz
gsoc2013-evolution-7b5415e5005aa1b7142d288af466b58b7e95ac42.tar.bz2
gsoc2013-evolution-7b5415e5005aa1b7142d288af466b58b7e95ac42.tar.lz
gsoc2013-evolution-7b5415e5005aa1b7142d288af466b58b7e95ac42.tar.xz
gsoc2013-evolution-7b5415e5005aa1b7142d288af466b58b7e95ac42.tar.zst
gsoc2013-evolution-7b5415e5005aa1b7142d288af466b58b7e95ac42.zip
convert the formatted date to UTF-8.
2001-10-26 Damon Chaplin <damon@ximian.com> * 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
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/comp-editor-util.c30
-rw-r--r--calendar/gui/dialogs/comp-editor.c4
-rw-r--r--calendar/gui/dialogs/event-page.c3
-rw-r--r--calendar/gui/dialogs/recurrence-page.c2
-rw-r--r--calendar/gui/dialogs/task-editor.c9
-rw-r--r--calendar/gui/dialogs/task-page.c1
6 files changed, 32 insertions, 17 deletions
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 <liboaf/liboaf.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-widget.h>
+#include <gal/unicode/gunicode.h>
#include <e-destination.h>
#include <e-util/e-time-utils.h>
#include <cal-util/timeutil.h>
@@ -359,8 +360,7 @@ comp_editor_show_contacts_dialog (GNOME_Evolution_Addressbook_SelectNames corba_
/* A simple 'name <email>' 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 <email>' form, otherwise use just the name
+ '"name" <email>' 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