From 24f0de634028297d3647779cffa082f8ff6a230a Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sat, 18 Apr 1998 21:37:45 +0000 Subject: Add Quoted printable property to items containing new lines. (duration): 1998-04-18 Miguel de Icaza * calobj.c (ical_object_to_vobject): Add Quoted printable property to items containing new lines. (duration): Use unsigned integers, to work around buggy calendar files generated by korganizer. * main.c (save_calendar_cmd): Do not ask for file name if we are saving. (save_as_calendar_cmd): New command. svn path=/trunk/; revision=158 --- calendar/gui/calendar.c | 11 +++++++++-- calendar/gui/main.c | 18 ++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c index 28f37f78eb..a32efae1e0 100644 --- a/calendar/gui/calendar.c +++ b/calendar/gui/calendar.c @@ -256,6 +256,9 @@ calendar_load_from_vobject (Calendar *cal, VObject *vcal) if (strcmp (object_name, VCVersionProp) == 0) continue; /* FIXME: implement */ + + if (strcmp (object_name, VCTimeZoneProp) == 0) + continue; /* FIXME: implement */ ical = ical_object_create_from_vobject (this, object_name); @@ -296,13 +299,17 @@ calendar_save (Calendar *cal, char *fname) { VObject *vcal; GList *l; - + time_t now = time (NULL); + if (fname == NULL) fname = cal->filename; + + /* WE call localtime for the side effect of setting tzname */ + localtime (&now); vcal = newVObject (VCCalProp); addPropValue (vcal, VCProdIdProp, "-//GNOME//NONSGML GnomeCalendar//EN"); - addPropValue (vcal, VCTimeZoneProp, "NONE"); + addPropValue (vcal, VCTimeZoneProp, tzname [0]); addPropValue (vcal, VCVersionProp, VERSION); cal->temp = vcal; diff --git a/calendar/gui/main.c b/calendar/gui/main.c index a3b9ce2bcc..cc7a0ecd85 100644 --- a/calendar/gui/main.c +++ b/calendar/gui/main.c @@ -229,7 +229,7 @@ close_save (GtkWidget *w) } void -save_calendar_cmd (GtkWidget *widget, void *data) +save_as_calendar_cmd (GtkWidget *widget, void *data) { GtkFileSelection *fs; @@ -251,6 +251,17 @@ save_calendar_cmd (GtkWidget *widget, void *data) gtk_widget_destroy (GTK_WIDGET (fs)); } +void +save_calendar_cmd (GtkWidget *widget, void *data) +{ + GnomeCalendar *gcal = data; + + if (gcal->cal->filename) + calendar_save (gcal->cal, gcal->cal->filename); + else + save_as_calendar_cmd (widget, data); +} + GnomeUIInfo gnome_cal_file_menu [] = { { GNOME_APP_UI_ITEM, N_("New calendar"), NULL, new_calendar_cmd }, @@ -260,6 +271,9 @@ GnomeUIInfo gnome_cal_file_menu [] = { { GNOME_APP_UI_ITEM, N_("Save calendar..."), NULL, save_calendar_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE }, + { GNOME_APP_UI_ITEM, N_("Save calendar as..."), NULL, save_as_calendar_cmd, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE }, + { GNOME_APP_UI_SEPARATOR }, { GNOME_APP_UI_ITEM, N_("Close this calendar"), NULL, close_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT }, @@ -284,7 +298,7 @@ GnomeUIInfo gnome_cal_edit_menu [] = { GnomeUIInfo gnome_cal_menu [] = { { GNOME_APP_UI_SUBTREE, N_("File"), NULL, &gnome_cal_file_menu }, - { GNOME_APP_UI_SUBTREE, N_("Edit"), NULL, &gnome_cal_edit_menu }, + { GNOME_APP_UI_SUBTREE, N_("Calendar"), NULL, &gnome_cal_edit_menu }, { GNOME_APP_UI_SUBTREE, N_("Help"), NULL, &gnome_cal_about_menu }, GNOMEUIINFO_END }; -- cgit v1.2.3