diff options
author | Kidd Wang <kiddwang@src.gnome.org> | 2004-03-29 14:16:47 +0800 |
---|---|---|
committer | Kidd Wang <kiddwang@src.gnome.org> | 2004-03-29 14:16:47 +0800 |
commit | fa9c9db0a6b3281b62b2fd38c536872df4206c60 (patch) | |
tree | 7816df223d795b97416373253e6e7330fdd00d62 /calendar/gui/e-day-view.c | |
parent | d4b41af00d2cee605499381395af3c19ba2a3081 (diff) | |
download | gsoc2013-evolution-fa9c9db0a6b3281b62b2fd38c536872df4206c60.tar.gz gsoc2013-evolution-fa9c9db0a6b3281b62b2fd38c536872df4206c60.tar.zst gsoc2013-evolution-fa9c9db0a6b3281b62b2fd38c536872df4206c60.zip |
remove the EVENT_MOVE signal which was binded to Alt + Arrows. ditto.
* gui/e-calendar-view.c: (e_calendar_view_class_init): remove the
EVENT_MOVE signal which was binded to Alt + Arrows.
* gui/e-calendar-view.h: ditto.
* gui/e-day-view.c: (e_day_view_class_init),
(e_day_view_do_key_press), (e_day_view_event_move): handle Alt + Arrows
in the more general place e_day_view_do_key_press so that we can avoid
the conflicting accessible key. When an appointment is selected,
pressing Alt + Arrows causes it to be moved around. Otherwise, pressing
Alt + LEFT/RIGHT will move the focus to the same day in the
previous/next week.
* gui/e-week-view.c: (e_week_view_class_init),
(e_week_view_event_move), (e_week_view_do_key_press): ditto.
svn path=/trunk/; revision=25219
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r-- | calendar/gui/e-day-view.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index a13c059b15..f79f1d9ddd 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -344,7 +344,7 @@ static void e_day_view_stop_editing_event (EDayView *day_view); static gboolean e_day_view_on_text_item_event (GnomeCanvasItem *item, GdkEvent *event, EDayView *day_view); -static void e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction); +static gboolean e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction); static void e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt); static void e_day_view_change_event_end_time_up (EDayView *day_view); @@ -480,7 +480,6 @@ e_day_view_class_init (EDayViewClass *class) view_class->get_selected_time_range = e_day_view_get_selected_time_range; view_class->set_selected_time_range = e_day_view_set_selected_time_range; view_class->get_visible_time_range = e_day_view_get_visible_time_range; - view_class->event_move = e_day_view_event_move; /* init the accessibility support for e_day_view */ e_day_view_a11y_init (); @@ -4682,12 +4681,26 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) } return FALSE; } + + /* Alt + Arrow Keys to move a selected event through time lines */ + if (((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) + &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) + &&((event->state & GDK_MOD1_MASK) == GDK_MOD1_MASK)) { + if (keyval == GDK_Up || keyval == GDK_KP_Up) + return e_day_view_event_move ((ECalendarView *) day_view, E_CAL_VIEW_MOVE_UP); + else if (keyval == GDK_Down || keyval == GDK_KP_Down) + return e_day_view_event_move ((ECalendarView *) day_view, E_CAL_VIEW_MOVE_DOWN); + else if (keyval == GDK_Left || keyval == GDK_KP_Left) + return e_day_view_event_move ((ECalendarView *) day_view, E_CAL_VIEW_MOVE_LEFT); + else if (keyval == GDK_Right || keyval == GDK_KP_Right) + return e_day_view_event_move ((ECalendarView *) day_view, E_CAL_VIEW_MOVE_RIGHT); + } /*Go to the start/end of a work day*/ if ((keyval == GDK_Home) - &&((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) - &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) - &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) { + &&((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) + &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) + &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) { e_day_view_goto_start_of_work_day (day_view); return TRUE; } @@ -5689,7 +5702,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, return FALSE; } -static void +static gboolean e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) { EDayViewEvent *event; @@ -5703,7 +5716,7 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) event_num = day_view->editing_event_num; if ((day == -1) || (day == E_DAY_VIEW_LONG_EVENT)) - return; + return FALSE; event = &g_array_index (day_view->events[day], EDayViewEvent, event_num); @@ -5719,7 +5732,7 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) switch (direction) { case E_CAL_VIEW_MOVE_UP: if (resize_start_row <= 0) - return; + return FALSE; resize_start_row--; resize_end_row--; start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row); @@ -5727,7 +5740,7 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) break; case E_CAL_VIEW_MOVE_DOWN: if (resize_end_row >= day_view->rows - 1) - return; + return FALSE; resize_start_row++; resize_end_row++; start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row); @@ -5735,7 +5748,7 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) break; case E_CAL_VIEW_MOVE_LEFT: if (day <= 0) - return; + return TRUE; start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row); end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1); start_time = icaltime_from_timet (start_dt, 0); @@ -5747,7 +5760,7 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) break; case E_CAL_VIEW_MOVE_RIGHT: if (day + 1 >= day_view->days_shown) - return; + return TRUE; start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row); end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1); start_time = icaltime_from_timet (start_dt, 0); @@ -5758,11 +5771,13 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) end_dt = icaltime_as_timet (end_time); break; default: - return; + return FALSE; } e_day_view_change_event_time (day_view, start_dt, end_dt); e_day_view_ensure_rows_visible (day_view, resize_start_row, resize_end_row); + + return TRUE; } static void |