diff options
author | JP Rosevear <jpr@ximian.com> | 2001-10-31 03:55:33 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-10-31 03:55:33 +0800 |
commit | 0c26a779918ea2188d2944f17e0213862acef21b (patch) | |
tree | 870dff3ca4b61b964afb5285b0b9d1d5d745fa81 | |
parent | b7443fb873ade1ac0f4bdd39b1c2d72fc545e52e (diff) | |
download | gsoc2013-evolution-0c26a779918ea2188d2944f17e0213862acef21b.tar.gz gsoc2013-evolution-0c26a779918ea2188d2944f17e0213862acef21b.tar.zst gsoc2013-evolution-0c26a779918ea2188d2944f17e0213862acef21b.zip |
move in whole day increments if we are in all day mode
2001-10-30 JP Rosevear <jpr@ximian.com>
* gui/e-meeting-time-sel-item.c
(e_meeting_time_selector_item_button_press): move in whole day
increments if we are in all day mode
* gui/e-meeting-time-sel.c
(e_meeting_time_selector_on_start_time_changed): get rid of
localtime call
(e_meeting_time_selector_on_end_time_changed): ditto
(e_meeting_time_selector_update_start_date_edit): set the date
editor using the meeting time fields directly
(e_meeting_time_selector_update_end_date_edit): ditto
* gui/dialogs/schedule-page.c (update_time): do the set_show_time
stuff first
* conduits/calendar/calendar-conduit.c (process_multi_day): don't
adjust the time, set the default timezone for date values
svn path=/trunk/; revision=14475
-rw-r--r-- | calendar/ChangeLog | 22 | ||||
-rw-r--r-- | calendar/conduits/calendar/calendar-conduit.c | 7 | ||||
-rw-r--r-- | calendar/gui/dialogs/schedule-page.c | 9 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel-item.c | 20 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel.c | 50 |
5 files changed, 65 insertions, 43 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 75b71b1736..a699e1e758 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,10 +1,30 @@ +2001-10-30 JP Rosevear <jpr@ximian.com> + + * gui/e-meeting-time-sel-item.c + (e_meeting_time_selector_item_button_press): move in whole day + increments if we are in all day mode + + * gui/e-meeting-time-sel.c + (e_meeting_time_selector_on_start_time_changed): get rid of + localtime call + (e_meeting_time_selector_on_end_time_changed): ditto + (e_meeting_time_selector_update_start_date_edit): set the date + editor using the meeting time fields directly + (e_meeting_time_selector_update_end_date_edit): ditto + + * gui/dialogs/schedule-page.c (update_time): do the set_show_time + stuff first + + * conduits/calendar/calendar-conduit.c (process_multi_day): don't + adjust the time, set the default timezone for date values + 2001-10-30 Dan Winship <danw@ximian.com> * gui/alarm-notify/Makefile.am (INCLUDES): s/BONOBO_HTML_GNOME_LIBS/BONOBO_HTML_GNOME_CFLAGS/ 2001-10-30 JP Rosevear <jpr@ximian.com> - + * gui/e-meeting-model.c (e_meeting_model_count_actual_attendees): count the actual attendees (doesn't include people delegating diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c index c845fc4516..552ba41e69 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -386,12 +386,10 @@ process_multi_day (ECalConduitContext *ctxt, CalClientChange *ccc, GList **multi event_start = icaltime_as_timet_with_zone (*dt_start.value, tz_start); cal_component_get_dtend (ccc->comp, &dt_end); - if (dt_end.value->is_date) { - icaltime_adjust (dt_end.value, 1, 0, 0, 0); + if (dt_end.value->is_date) tz_end = ctxt->timezone; - } else { + else tz_end = get_timezone (ctxt->client, dt_end.tzid); - } event_end = icaltime_as_timet_with_zone (*dt_end.value, tz_end); day_end = time_day_end_with_zone (event_start, ctxt->timezone); @@ -403,7 +401,6 @@ process_multi_day (ECalConduitContext *ctxt, CalClientChange *ccc, GList **multi goto cleanup; } - INFO ("Split info: %lu, %lu, %lu", event_start, event_end, day_end); old_start_value = dt_start.value; old_end_value = dt_end.value; while (!last) { diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index df7ca0c702..66614348df 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -276,6 +276,11 @@ update_time (SchedulePage *spage, CalComponentDateTime *start_date, CalComponent } } + e_date_edit_set_show_time (E_DATE_EDIT (priv->sel->start_date_edit), + !all_day); + e_date_edit_set_show_time (E_DATE_EDIT (priv->sel->end_date_edit), + !all_day); + e_date_edit_set_date (E_DATE_EDIT (priv->sel->start_date_edit), start_tt.year, start_tt.month, start_tt.day); e_date_edit_set_time_of_day (E_DATE_EDIT (priv->sel->start_date_edit), @@ -286,10 +291,6 @@ update_time (SchedulePage *spage, CalComponentDateTime *start_date, CalComponent e_date_edit_set_time_of_day (E_DATE_EDIT (priv->sel->end_date_edit), end_tt.hour, end_tt.minute); - e_date_edit_set_show_time (E_DATE_EDIT (priv->sel->start_date_edit), - !all_day); - e_date_edit_set_show_time (E_DATE_EDIT (priv->sel->end_date_edit), - !all_day); } diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c index 136b43e408..1cc2ac516b 100644 --- a/calendar/gui/e-meeting-time-sel-item.c +++ b/calendar/gui/e-meeting-time-sel-item.c @@ -857,16 +857,22 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, /* Find the nearest half-hour or hour interval, depending on whether zoomed_out is set. */ - if (mts->zoomed_out) { - start_time.minute = 0; - end_time = start_time; - end_time.hour += 1; + if (e_date_edit_get_show_time (E_DATE_EDIT (mts->end_date_edit))) { + if (mts->zoomed_out) { + start_time.minute = 0; + end_time = start_time; + end_time.hour += 1; + } else { + start_time.minute -= start_time.minute % 30; + end_time = start_time; + end_time.minute += 30; + } } else { - start_time.minute -= start_time.minute % 30; + start_time.hour = 0; + start_time.minute = 0; end_time = start_time; - end_time.minute += 30; } - + /* Fix any overflows. */ e_meeting_time_selector_fix_time_overflows (&end_time); diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index 25a2bbc22d..189072508d 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -2086,14 +2086,14 @@ e_meeting_time_selector_on_start_time_changed (GtkWidget *widget, gint duration_days, duration_hours, duration_minutes; EMeetingTime mtstime; time_t newtime; - struct tm *newtime_tm; + /* Date */ newtime = e_date_edit_get_time (E_DATE_EDIT (mts->start_date_edit)); - newtime_tm = localtime (&newtime); g_date_clear (&mtstime.date, 1); g_date_set_time (&mtstime.date, newtime); - mtstime.hour = newtime_tm->tm_hour; - mtstime.minute = newtime_tm->tm_min; + + /* Time */ + e_date_edit_get_time_of_day (E_DATE_EDIT (mts->start_date_edit), &mtstime.hour, &mtstime.minute); /* If the time hasn't changed, just return. */ if (e_meeting_time_selector_compare_times (&mtstime, &mts->meeting_start_time) == 0) @@ -2127,14 +2127,16 @@ e_meeting_time_selector_on_end_time_changed (GtkWidget *widget, { EMeetingTime mtstime; time_t newtime; - struct tm *newtime_tm; + /* Date */ newtime = e_date_edit_get_time (E_DATE_EDIT (mts->end_date_edit)); - newtime_tm = localtime (&newtime); g_date_clear (&mtstime.date, 1); g_date_set_time (&mtstime.date, newtime); - mtstime.hour = newtime_tm->tm_hour; - mtstime.minute = newtime_tm->tm_min; + if (!e_date_edit_get_show_time (E_DATE_EDIT (mts->end_date_edit))) + g_date_add_days (&mtstime.date, 1); + + /* Time */ + e_date_edit_get_time_of_day (E_DATE_EDIT (mts->end_date_edit), &mtstime.hour, &mtstime.minute); /* If the time hasn't changed, just return. */ if (e_meeting_time_selector_compare_times (&mtstime, &mts->meeting_end_time) == 0) @@ -2477,15 +2479,13 @@ e_meeting_time_selector_remove_timeout (EMeetingTimeSelector *mts) static void e_meeting_time_selector_update_start_date_edit (EMeetingTimeSelector *mts) { - struct tm start_tm; - time_t start_time_t; - - g_date_to_struct_tm (&mts->meeting_start_time.date, &start_tm); - start_tm.tm_hour = mts->meeting_start_time.hour; - start_tm.tm_min = mts->meeting_start_time.minute; - start_time_t = mktime (&start_tm); - e_date_edit_set_time (E_DATE_EDIT (mts->start_date_edit), - start_time_t); + e_date_edit_set_date (E_DATE_EDIT (mts->start_date_edit), + mts->meeting_start_time.date.year, + mts->meeting_start_time.date.month, + mts->meeting_start_time.date.day); + e_date_edit_set_time_of_day (E_DATE_EDIT (mts->start_date_edit), + mts->meeting_start_time.hour, + mts->meeting_start_time.minute); } @@ -2493,15 +2493,13 @@ e_meeting_time_selector_update_start_date_edit (EMeetingTimeSelector *mts) static void e_meeting_time_selector_update_end_date_edit (EMeetingTimeSelector *mts) { - struct tm end_tm; - time_t end_time_t; - - g_date_to_struct_tm (&mts->meeting_end_time.date, &end_tm); - end_tm.tm_hour = mts->meeting_end_time.hour; - end_tm.tm_min = mts->meeting_end_time.minute; - end_time_t = mktime (&end_tm); - e_date_edit_set_time (E_DATE_EDIT (mts->end_date_edit), - end_time_t); + e_date_edit_set_date (E_DATE_EDIT (mts->end_date_edit), + mts->meeting_end_time.date.year, + mts->meeting_end_time.date.month, + mts->meeting_end_time.date.day); + e_date_edit_set_time_of_day (E_DATE_EDIT (mts->end_date_edit), + mts->meeting_end_time.hour, + mts->meeting_end_time.minute); } |