aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-commands.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-08-07 08:46:56 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-08-07 08:46:56 +0800
commit9d8f94804917a0338a08be9f36a8e047ccedd939 (patch)
tree4e29f6218af7cbdc4a84933d9cffddd1b7caa61c /calendar/gui/calendar-commands.c
parent5949b39e3437ebbf7e7461c58df50424e0993809 (diff)
downloadgsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.gz
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.bz2
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.lz
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.xz
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.tar.zst
gsoc2013-evolution-9d8f94804917a0338a08be9f36a8e047ccedd939.zip
added 'different_timezone' fields to EDayViewEvent and EWeekViewEvent, to
2001-08-06 Damon Chaplin <damon@ximian.com> * gui/e-week-view.h: * gui/e-day-view.h: added 'different_timezone' fields to EDayViewEvent and EWeekViewEvent, to note that the event is in a different timezone. We now compute this once when we add the event to the array, rather than each time we draw the event. If it is set, we will draw the timezone icon next to the event. * gui/e-day-view-main-item.c: take transparency into account when drawing the blue vertical bars to represent busy time. * gui/tag-calendar.c: take transparency into account when tagging the mini calendar. * gui/e-calendar-table.c (e_calendar_table_init): removed the "None" options for transparency and classification, since these properties have defaults anyway, so we may as well use those to keep it simple. Also use "Free" and "Busy" for transparency, rather than "Transparent" and "Opaque". * gui/calendar-model.c: updated classification & transparency code as above. * gui/e-calendar-table.etspec: changed "Transparency" to "Show Time As" since people have a chance of understanding that. * gui/e-week-view.c: * gui/e-day-view.c: * gui/gnome-cal.c: added functions to get the visible time range. * gui/calendar-commands.c: finished stuff to set the folder bar label to the dates currently displayed. * gui/control-factory.c (control_factory_new_control): connected signal to update the folder title bar label when the dates shown are changed. I had to connect it here since we need the BonoboControl in the callback, and I don't know how to get the control from the widget. * gui/tasks-control.c (tasks_control_activate): clear the folder bar label. We could display something here at some point. * gui/dialogs/recurrence-page.glade: changed "_Add" to "A_dd", since we have an "_Actions" menu. (These also use Alt+key, right?) * gui/dialogs/event-page.glade: * gui/dialogs/event-page.c: added 'Show Time As' field, which is really the TRANSP property but with a better name! Also changed one of the "_Confidential" to "Con_fidential" since we already have "_Contacts" using the same 'C' key. * pcs/cal-backend-file.c (cal_backend_file_get_free_busy): skip events that are TRANSPARENT. Also added comment as this code looks inefficient. * cal-util/cal-component.c: removed stuff for comparing timezones. * gui/comp-util.c (cal_comp_util_compare_event_timezones): moved the above function here, and updated it to compare the UTC offsets of the times as well as the TZIDs. svn path=/trunk/; revision=11717
Diffstat (limited to 'calendar/gui/calendar-commands.c')
-rw-r--r--calendar/gui/calendar-commands.c68
1 files changed, 35 insertions, 33 deletions
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index 22640d2629..8fd3bb038e 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -356,11 +356,9 @@ get_shell_view_interface (BonoboControl *control)
/* Displays the currently displayed time range in the folder bar label on the
shell view, according to which view we are showing. */
-static void
-clear_folder_bar_label (GnomeCalendar *gcal, BonoboControl *control)
+void
+calendar_set_folder_bar_label (GnomeCalendar *gcal, BonoboControl *control)
{
- GNOME_Evolution_ShellView shell_view;
- CORBA_Environment ev;
icaltimezone *zone;
struct icaltimetype start_tt, end_tt;
time_t start_time, end_time;
@@ -368,8 +366,7 @@ clear_folder_bar_label (GnomeCalendar *gcal, BonoboControl *control)
char buffer[512], end_buffer[256];
GnomeCalendarViewType view;
- /* FIXME: This isn't the same as the currently visible time range. */
- gnome_calendar_get_selected_time_range (gcal, &start_time, &end_time);
+ gnome_calendar_get_visible_time_range (gcal, &start_time, &end_time);
zone = gnome_calendar_get_timezone (gcal);
start_tt = icaltime_from_timet_with_zone (start_time, FALSE, zone);
@@ -383,7 +380,8 @@ clear_folder_bar_label (GnomeCalendar *gcal, BonoboControl *control)
start_tm.tm_wday = time_day_of_week (start_tt.day, start_tt.month - 1,
start_tt.year);
- end_tt = icaltime_from_timet_with_zone (end_time, FALSE, zone);
+ /* Take one off end_time so we don't get an extra day. */
+ end_tt = icaltime_from_timet_with_zone (end_time - 1, FALSE, zone);
end_tm.tm_year = end_tt.year - 1900;
end_tm.tm_mon = end_tt.month - 1;
end_tm.tm_mday = end_tt.day;
@@ -398,12 +396,14 @@ clear_folder_bar_label (GnomeCalendar *gcal, BonoboControl *control)
switch (view) {
case GNOME_CAL_DAY_VIEW:
- strftime (buffer, sizeof (buffer),
- _("%A %d %B %Y"), &start_tm);
- break;
case GNOME_CAL_WORK_WEEK_VIEW:
case GNOME_CAL_WEEK_VIEW:
- if (start_tm.tm_year == end_tm.tm_year) {
+ if (start_tm.tm_year == end_tm.tm_year
+ && start_tm.tm_mon == end_tm.tm_mon
+ && start_tm.tm_mday == end_tm.tm_mday) {
+ strftime (buffer, sizeof (buffer),
+ _("%A %d %B %Y"), &start_tm);
+ } else if (start_tm.tm_year == end_tm.tm_year) {
strftime (buffer, sizeof (buffer),
_("%a %d %b"), &start_tm);
strftime (end_buffer, sizeof (end_buffer),
@@ -421,12 +421,17 @@ clear_folder_bar_label (GnomeCalendar *gcal, BonoboControl *control)
break;
case GNOME_CAL_MONTH_VIEW:
if (start_tm.tm_year == end_tm.tm_year) {
- strftime (buffer, sizeof (buffer),
- _("%B"), &start_tm);
- strftime (end_buffer, sizeof (end_buffer),
- _("%B %Y"), &end_tm);
- strcat (buffer, " - ");
- strcat (buffer, end_buffer);
+ if (start_tm.tm_mon == end_tm.tm_mon) {
+ strftime (buffer, sizeof (buffer),
+ _("%B %Y"), &start_tm);
+ } else {
+ strftime (buffer, sizeof (buffer),
+ _("%B"), &start_tm);
+ strftime (end_buffer, sizeof (end_buffer),
+ _("%B %Y"), &end_tm);
+ strcat (buffer, " - ");
+ strcat (buffer, end_buffer);
+ }
} else {
strftime (buffer, sizeof (buffer),
_("%B %Y"), &start_tm);
@@ -440,17 +445,24 @@ clear_folder_bar_label (GnomeCalendar *gcal, BonoboControl *control)
g_assert_not_reached ();
}
+ control_util_set_folder_bar_label (control, buffer);
+}
+
+void
+control_util_set_folder_bar_label (BonoboControl *control, char *label)
+{
+ GNOME_Evolution_ShellView shell_view;
+ CORBA_Environment ev;
+
shell_view = get_shell_view_interface (control);
if (shell_view == CORBA_OBJECT_NIL)
return;
CORBA_exception_init (&ev);
-#if 0
- GNOME_Evolution_ShellView_setFolderBarLabel (shell_view, buffer, &ev);
-#endif
- GNOME_Evolution_ShellView_setFolderBarLabel (shell_view, "", &ev);
+ GNOME_Evolution_ShellView_setFolderBarLabel (shell_view, label, &ev);
+
if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("clear_folder_bar_label(): Could not set the folder bar label");
+ g_message ("control_util_set_folder_bar_label(): Could not set the folder bar label");
CORBA_exception_free (&ev);
}
@@ -531,7 +543,7 @@ calendar_control_activate (BonoboControl *control,
a default timezone already. */
calendar_config_check_timezone_set ();
- clear_folder_bar_label (gcal, control);
+ calendar_set_folder_bar_label (gcal, control);
}
void
@@ -553,13 +565,6 @@ on_calendar_destroyed (GnomeCalendar *gcal)
all_calendars = g_list_remove (all_calendars, gcal);
}
-static void
-on_calendar_dates_shown_changed (GnomeCalendar *gcal)
-{
- g_print ("In on_calendar_dates_shown_changed\n");
-}
-
-
GnomeCalendar *
new_calendar (void)
{
@@ -574,9 +579,6 @@ new_calendar (void)
gtk_signal_connect (GTK_OBJECT (gcal), "destroy",
GTK_SIGNAL_FUNC (on_calendar_destroyed), NULL);
- gtk_signal_connect (GTK_OBJECT (gcal), "dates_shown_changed",
- GTK_SIGNAL_FUNC (on_calendar_dates_shown_changed),
- NULL);
all_calendars = g_list_prepend (all_calendars, gcal);