aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-10-31 03:55:33 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-10-31 03:55:33 +0800
commit0c26a779918ea2188d2944f17e0213862acef21b (patch)
tree870dff3ca4b61b964afb5285b0b9d1d5d745fa81 /calendar/gui
parentb7443fb873ade1ac0f4bdd39b1c2d72fc545e52e (diff)
downloadgsoc2013-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
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/schedule-page.c9
-rw-r--r--calendar/gui/e-meeting-time-sel-item.c20
-rw-r--r--calendar/gui/e-meeting-time-sel.c50
3 files changed, 42 insertions, 37 deletions
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);
}