[evolution-patches] new patch for review (bug#45775)
- From: wu yang <Yang Wu sun com>
- To: Rodrigo Moya <rodrigo ximian com>
- Cc: evolution-patches ximian com
- Subject: [evolution-patches] new patch for review (bug#45775)
- Date: Mon, 28 Jul 2003 01:50:39 +0800
Hi Rodrigo,
Please review the new patch for evolution calendar keyboard navigation. Thanks.
bug#:
45775
Short Summary:
in DayView, WeekView, Task: Alt+o, open the editing dialog for current selected item
-Andrew Wu
Index: e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.93
diff -u -b -B -r1.93 e-calendar-table.c
--- e-calendar-table.c 13 Jul 2003 19:29:40 -0000 1.93
+++ e-calendar-table.c 27 Jul 2003 17:43:06 -0000
@@ -1204,6 +1204,10 @@
if (event->keyval == GDK_Delete) {
delete_cb (NULL, cal_table);
return TRUE;
+ } else if ((event->keyval == GDK_o)
+ &&(event->state & GDK_MOD1_MASK)) {
+ open_task_by_row (cal_table, row);
+ return TRUE;
}
return FALSE;
Index: e-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view.c,v
retrieving revision 1.212
diff -u -b -B -r1.212 e-day-view.c
--- e-day-view.c 24 Jul 2003 16:02:54 -0000 1.212
+++ e-day-view.c 27 Jul 2003 17:43:18 -0000
@@ -254,7 +254,7 @@
ECalViewPosition pos,
gint event_x,
gint event_y);
-static void e_day_view_on_event_double_click (EDayView *day_view,
+static void e_day_view_on_open_event (EDayView *day_view,
gint day,
gint event_num);
static void e_day_view_on_event_right_click (EDayView *day_view,
@@ -2961,8 +2961,7 @@
event_x, event_y);
return TRUE;
} else if (event->type == GDK_2BUTTON_PRESS) {
- e_day_view_on_event_double_click (day_view, -1,
- event_num);
+ e_day_view_on_open_event (day_view, E_DAY_VIEW_LONG_EVENT, event_num);
gtk_signal_emit_stop_by_name (GTK_OBJECT (day_view->top_canvas),
"button_press_event");
return TRUE;
@@ -3010,8 +3009,7 @@
event_x, event_y);
return TRUE;
} else if (event->type == GDK_2BUTTON_PRESS) {
- e_day_view_on_event_double_click (day_view, day,
- event_num);
+ e_day_view_on_open_event (day_view, day, event_num);
gtk_signal_emit_stop_by_name (GTK_OBJECT (day_view->main_canvas),
"button_press_event");
return TRUE;
@@ -3291,16 +3289,16 @@
gnome_canvas_item_show (day_view->resize_bar_item);
}
-
+/* open a dialog to edit the event */
static void
-e_day_view_on_event_double_click (EDayView *day_view,
+e_day_view_on_open_event (EDayView *day_view,
gint day,
gint event_num)
{
EDayViewEvent *event;
gboolean destroyed;
- if (day == -1)
+ if (day == E_DAY_VIEW_LONG_EVENT)
event = &g_array_index (day_view->long_events, EDayViewEvent,
event_num);
else
@@ -5589,6 +5587,12 @@
gtk_signal_emit_stop_by_name (GTK_OBJECT (item), "event");
/* focus should go to day view when stop editing */
gtk_widget_grab_focus (GTK_WIDGET (day_view));
+ return TRUE;
+ } else if ((event->key.keyval == GDK_o)
+ &&(event->key.state & GDK_MOD1_MASK)) {
+ e_day_view_on_open_event (day_view,
+ day_view->editing_event_day,
+ day_view->editing_event_num);
return TRUE;
}
break;
Index: e-week-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-week-view.c,v
retrieving revision 1.178
diff -u -b -B -r1.178 e-week-view.c
--- e-week-view.c 24 Jul 2003 16:02:54 -0000 1.178
+++ e-week-view.c 27 Jul 2003 17:43:31 -0000
@@ -172,6 +172,7 @@
static gboolean e_week_view_on_text_item_event (GnomeCanvasItem *item,
GdkEvent *event,
EWeekView *week_view);
+static gboolean e_week_view_on_open_event (GnomeCanvasItem *item, EWeekView *week_view);
static gboolean e_week_view_on_jump_button_event (GnomeCanvasItem *item,
GdkEvent *event,
EWeekView *week_view);
@@ -2910,16 +2911,12 @@
GdkEvent *gdkevent,
EWeekView *week_view)
{
- EWeekViewEvent *event;
gint event_num, span_num;
- GnomeCalendar *calendar;
#if 0
g_print ("In e_week_view_on_text_item_event\n");
#endif
- calendar = e_cal_view_get_calendar (E_CAL_VIEW (week_view));
-
switch (gdkevent->type) {
case GDK_KEY_PRESS:
if (gdkevent && gdkevent->key.keyval == GDK_Return) {
@@ -2938,23 +2935,13 @@
/* focus should go to week view when stop editing */
gtk_widget_grab_focus (GTK_WIDGET (week_view));
return TRUE;
+ } else if ((gdkevent->key.keyval == GDK_o)
+ &&(gdkevent->key.state & GDK_MOD1_MASK)) {
+ return e_week_view_on_open_event (item, week_view);
}
break;
case GDK_2BUTTON_PRESS:
- if (!e_week_view_find_event_from_item (week_view, item,
- &event_num, &span_num))
- return FALSE;
-
- event = &g_array_index (week_view->events, EWeekViewEvent,
- event_num);
-
- if (calendar)
- gnome_calendar_edit_object (calendar, event->comp, FALSE);
- else
- g_warning ("Calendar not set");
-
- gtk_signal_emit_stop_by_name (GTK_OBJECT (item), "event");
- return TRUE;
+ return e_week_view_on_open_event (item, week_view);
case GDK_BUTTON_PRESS:
if (!e_week_view_find_event_from_item (week_view, item,
&event_num, &span_num))
@@ -3051,6 +3038,31 @@
return FALSE;
}
+/* open a dialog to edit the event */
+static gboolean e_week_view_on_open_event (GnomeCanvasItem *item,
+ EWeekView *week_view)
+{
+ EWeekViewEvent *event;
+ gint event_num, span_num;
+ GnomeCalendar *calendar;
+
+ calendar = e_cal_view_get_calendar (E_CAL_VIEW (week_view));
+
+ if (!e_week_view_find_event_from_item (week_view, item,
+ &event_num, &span_num))
+ return FALSE;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ event_num);
+
+ if (calendar)
+ gnome_calendar_edit_object (calendar, event->comp, FALSE);
+ else
+ g_warning ("Calendar not set");
+
+ gtk_signal_emit_stop_by_name (GTK_OBJECT (item), "event");
+ return TRUE;
+}
static void
e_week_view_on_editing_started (EWeekView *week_view,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]