diff options
author | Damon Chaplin <damon@ximian.com> | 2001-08-15 09:13:37 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-08-15 09:13:37 +0800 |
commit | 6684b4627d4767f6ea5d2969d70ae6f2cf863a79 (patch) | |
tree | 89d7a6fba9713ff48fe44ed4bad3ee94471030e6 /calendar/gui/gnome-cal.c | |
parent | 84f12a913e4a46c198a951dd2b10512fb87ce0a3 (diff) | |
download | gsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.tar.gz gsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.tar.zst gsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.zip |
added support for the Contacts field. Note that I'm not sure what we
2001-08-14 Damon Chaplin <damon@ximian.com>
* gui/dialogs/task-page.c:
* gui/dialogs/event-page.c: added support for the Contacts field.
Note that I'm not sure what we should put in the iCalendar CONTACT
properties. Currently we put "name <email>", but it isn't recognized
as a contact when we reopen the dialog, so we may need more info here.
Also we currently use a simple parser to parse the above format, and
we should maybe use some camel function.
* gui/dialogs/task-page.glade:
* gui/dialogs/event-page.glade: replaced the GtkEntry fields for the
Contacts with a GtkEventBox which we put the BonoboControl in at
runtime.
* gui/dialogs/meeting-page.c (invite_entry_changed): added FIXMEs
since it doesn't seem to be freeing the EDestination stuff. JP?
* gui/dialogs/comp-editor-util.c: added bunch of utility functions to
handle the Contacts field in the main Event and Task pages.
* gui/gnome-cal.c: added visible_start and visible_end fields, so we
only emit the 'dates-shown-changed' signal when really necessary.
Currently changing the folder title bar label results in a complete
redraw of the Evolution window (silly GtkLabel queueing a resize),
so we want to avoid that as much as possible.
(gnome_calendar_new_appointment_for): only move the event's end time
to the end of the day if it is not already 00:00:00.
* gui/e-week-view-event-item.c:
* gui/e-week-view.c:
* gui/e-day-view.c: added support for double-clicking on an event to
open it, and for double-clicking on the background to create a new
event. There is still a minor problem to sort out, but it basically
works.
* cal-util/cal-component.c: added support for CONTACT properties,
mainly by copying the code for COMMENT properties which are exactly
the same type.
* gui/e-day-view.c (e_day_view_realize): use the same color for the
top canvas background as the shortcut bar, to make it look a little
nicer (I think). Although we still have the theme problem with
hard-coded colors.
svn path=/trunk/; revision=12039
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 2af032b184..e26150a86f 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -139,6 +139,12 @@ struct _GnomeCalendarPrivate { /* Our current timezone. */ icaltimezone *zone; + + /* The dates currently shown. If they are -1 then we have no dates + shown. We only use these to check if we need to emit a + 'dates-shown-changed' signal.*/ + time_t visible_start; + time_t visible_end; }; /* Signal IDs */ @@ -677,6 +683,9 @@ gnome_calendar_init (GnomeCalendar *gcal) priv->view_collection = NULL; priv->view_menus = NULL; + + priv->visible_start = -1; + priv->visible_end = -1; } /* Frees a set of categories */ @@ -1902,8 +1911,12 @@ gnome_calendar_new_appointment_for (GnomeCalendar *cal, itt = icaltime_from_timet_with_zone (dtend, FALSE, priv->zone); if (all_day) { - itt.hour = itt.minute = itt.second = 0; - icaltime_adjust (&itt, 1, 0, 0, 0); + /* If we want an all-day event and the end time isn't on a + day boundary, we move it to the end of the day it is in. */ + if (itt.hour != 0 || itt.minute != 0 || itt.second != 0) { + itt.hour = itt.minute = itt.second = 0; + icaltime_adjust (&itt, 1, 0, 0, 0); + } } cal_component_set_dtend (comp, &dt); @@ -2374,8 +2387,24 @@ gnome_calendar_get_timezone (GnomeCalendar *gcal) static void gnome_calendar_notify_dates_shown_changed (GnomeCalendar *gcal) { + GnomeCalendarPrivate *priv; + time_t start_time, end_time; + g_return_if_fail (GNOME_IS_CALENDAR (gcal)); - gtk_signal_emit (GTK_OBJECT (gcal), - gnome_calendar_signals[DATES_SHOWN_CHANGED]); + priv = gcal->priv; + + gnome_calendar_get_visible_time_range (gcal, &start_time, &end_time); + + /* We check if the visible date range has changed, and only emit the + signal if it has. (This makes sure we only change the folder title + bar label in the shell when we need to.) */ + if (priv->visible_start != start_time + || priv->visible_end != end_time) { + priv->visible_start = start_time; + priv->visible_end = end_time; + + gtk_signal_emit (GTK_OBJECT (gcal), + gnome_calendar_signals[DATES_SHOWN_CHANGED]); + } } |