Re: [evolution-patches] patch for calendar keyboard navigation (45776)
- From: Rodrigo Moya <rodrigo ximian com>
- To: wu yang <Yang Wu sun com>
- Cc: JP Rosevear <jpr ximian com>, Evolution Patches <evolution-patches ximian com>, sceri-evolution-acc sun com
- Subject: Re: [evolution-patches] patch for calendar keyboard navigation (45776)
- Date: Sun, 14 Dec 2003 20:08:51 +0100
On Sun, 2003-12-07 at 17:23, wu yang wrote:
> Hi
> I had sent this patch for three times since 2 months ago.
> Once I resended it, I had to modify something to adapt the current code :(
> Could you take some time to review it?
> It fixed bug 45776.
> In DayView and WeekView, Alt + Arrow Keys with the event is selected,
> Move a selected event through time lines.
> Thanks
>
>
> ______________________________________________________________________
>
> @@ -4290,12 +4298,17 @@
>
> for (event_num = 0; event_num < day_view->events[day]->len;
> event_num++) {
> - e_day_view_reshape_day_event (day_view, day, event_num);
> - if (event_num == day_view->resize_event_num) {
> EDayViewEvent *event;
> - event = &g_array_index (day_view->events[day], EDayViewEvent,
> - event_num);
> + gchar *current_comp_string;
> +
> + e_day_view_reshape_day_event (day_view, day, event_num);
> + event = &g_array_index (day_view->events[day], EDayViewEvent, event_num);
> + current_comp_string = icalcomponent_as_ical_string (event->comp_data->icalcomp);
> + if (day_view->last_edited_comp_string == NULL)
> + continue;
> + if (strncmp(current_comp_string, day_view->last_edited_comp_string,50) == 0) {
>
here please use our coding standards, which is to leave a space before
the opening '(' in function calls.
> @@ -5543,6 +5556,153 @@
> }
>
> return FALSE;
> +}
> +
> +static void
> +e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction)
> +{
> + EDayViewEvent *event;
> + EDayView *day_view;
> + gint day, event_num, resize_start_row, resize_end_row;
> + time_t start_dt, end_dt;
> + struct icaltimetype start_time,end_time;
> +
> + day_view = E_DAY_VIEW (cal_view);
> + day = day_view->editing_event_day;
> + event_num = day_view->editing_event_num;
> +
> + if ((day == -1) || (day == E_DAY_VIEW_LONG_EVENT))
> + return;
> +
> + event = &g_array_index (day_view->events[day], EDayViewEvent,
> + event_num);
> + day_view->resize_event_day = day;
> + day_view->resize_event_num = event_num;
> + day_view->resize_bars_event_day = day;
> + day_view->resize_bars_event_num = event_num;
> + resize_start_row = event->start_minute / day_view->mins_per_row;
> + resize_end_row = (event->end_minute - 1) / day_view->mins_per_row;
> + if (resize_end_row < resize_start_row)
> + resize_end_row = resize_start_row;
> +
> + switch (direction) {
> + case E_CAL_VIEW_MOVE_UP:
> + if (resize_start_row <= 0) return;
>
here again, use the coding standars, putting the 'return' statement in
its own line. The same happens in other places.
> + /* Hide the horizontal bars. */
> + day_view->resize_bars_event_day = -1;
> + day_view->resize_bars_event_num = -1;
> + gnome_canvas_item_hide (day_view->main_canvas_top_resize_bar_item);
> + gnome_canvas_item_hide (day_view->main_canvas_bottom_resize_bar_item);
> +
>
do the horizontal bars need to be hidden always when changing times?
> + e_cal_component_commit_sequence (comp);
> + if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) {
> + if (itip_organizer_is_user (comp, client) &&
> + send_component_dialog (toplevel, client, comp, TRUE)) {
> + itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, client, NULL);
>
I guess we are going to need to put this code in a function, since it's
used (exactly the same) in many places.
cheers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]