From c65fbd94c0daff4ed02df7447e8eeaddd9cff9c0 Mon Sep 17 00:00:00 2001 From: Harry Lu Date: Fri, 5 Dec 2003 02:01:46 +0000 Subject: Fix for bugzilla bug #51624 and #51627. 2003-12-04 Harry Lu Fix for bugzilla bug #51624 and #51627. * e-calendar-item.c: (e_calendar_item_selection_add_days): set the date to the first day of the month so that user can use keyboard's arrow key to select a date. (e_calendar_item_set_selection_if_emission): only set selection_changed if emission is TRUE. * e-calendar.c: (e_calendar_init): add back the "clicked" handler so that user can use keyboard to click the button. (e_calendar_start_auto_move): no need to move since it is already handled by the clicked handler (e_calendar_on_prev_clicked), (e_calendar_on_next_clicked): move the month here. * e-dateedit.c: (e_date_edit_show_date_popup): use gdk_window_focus instead of gdk_keyboard_grab so that the focus won't lost if user click the button with keyboard. (hide_date_popup): no need to call gdk_keyboard_ungrab. svn path=/trunk/; revision=23642 --- widgets/misc/e-calendar-item.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'widgets/misc/e-calendar-item.c') diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index 83bdbab49e..bde45441f6 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -1624,8 +1624,12 @@ e_calendar_item_selection_add_days (ECalendarItem *calitem, gint n_days, g_return_if_fail (E_IS_CALENDAR_ITEM (calitem)); - if (!e_calendar_item_get_selection (calitem, &gdate_start, &gdate_end)) - return; + if (!e_calendar_item_get_selection (calitem, &gdate_start, &gdate_end)) { + /* We set the date to the first day of the month */ + g_date_set_dmy (&gdate_start, 1, calitem->month + 1, calitem->year); + gdate_end = gdate_start; + } + if (multi_selection && calitem->max_days_selected > 1) { gint days_between; @@ -2898,9 +2902,10 @@ e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, || calitem->selection_end_month_offset != new_end_month_offset || calitem->selection_end_day != new_end_day) { need_update = TRUE; - calitem->selection_changed = TRUE; - if (emission) + if (emission) { + calitem->selection_changed = TRUE; e_calendar_item_queue_signal_emission (calitem); + } calitem->selection_set = TRUE; calitem->selection_start_month_offset = new_start_month_offset; calitem->selection_start_day = new_start_day; -- cgit v1.2.3