[evolution-patches] patch for review(45775 calendar keyboard navigation)



I have revised it follow your advice.
This patch is for evolution calendar keyboard navigation.
Bug#45775
"in DayView, WeekView, Task: Alt+o, open the editing dialog for current selected item"
The same bug has fix in 1.4 a month ago.
This patch is for HEAD.

Thanks


? autom4te.cache
? stamp-h1
? help/C/evolution-1.4-C.omf.out
? help/C/omf_timestamp
? libical/src/libicalvcal/vcc.c
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1873
diff -u -b -B -r1.1873 ChangeLog
--- calendar/ChangeLog	22 Sep 2003 07:32:25 -0000	1.1873
+++ calendar/ChangeLog	28 Sep 2003 13:49:27 -0000
@@ -1,3 +1,14 @@
+2003-09-28 Andrew Wu <Yang Wu sun com>
+	
+	* gui/e-cal-view.c,e-cal-view.h
+	  add a singal--"open_event", and bind it to "alt+o".
+	(e_cal_view_open_event):open a dialog to edit the selected event.
+
+	* gui/e-calendar-table.c
+	(e_calendar_table_on_key_press):"alt+o" to open a dialog 
+	to edit the selected task.
+
+	
 2003-09-22  Hans Petter Jansson  <hpj ximian com>
 
 	* cal-util/Makefile.am (libical_util_la_LIBADD):
Index: calendar/gui/e-cal-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-view.c,v
retrieving revision 1.15
diff -u -b -B -r1.15 e-cal-view.c
--- calendar/gui/e-cal-view.c	20 Aug 2003 12:02:32 -0000	1.15
+++ calendar/gui/e-cal-view.c	28 Sep 2003 13:49:29 -0000
@@ -26,6 +26,8 @@
 #include <gtk/gtkimage.h>
 #include <gtk/gtkinvisible.h>
 #include <gtk/gtkstock.h>
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtkbindings.h>
 #include <libgnome/gnome-i18n.h>
 #include <gal/util/e-util.h>
 #include "e-util/e-dialog-utils.h"
@@ -75,6 +77,7 @@
 static void e_cal_view_class_init (ECalViewClass *klass);
 static void e_cal_view_init (ECalView *cal_view, ECalViewClass *klass);
 static void e_cal_view_destroy (GtkObject *object);
+static void e_cal_view_open_event (ECalView *cal_view);
 
 static GObjectClass *parent_class = NULL;
 static GdkAtom clipboard_atom = GDK_NONE;
@@ -85,6 +88,7 @@
 	TIMEZONE_CHANGED,
 	EVENT_CHANGED,
 	EVENT_ADDED,
+	OPEN_EVENT,
 	LAST_SIGNAL
 };
 
@@ -95,6 +99,8 @@
 {
 	GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
 
+	GtkBindingSet *binding_set;
+
 	parent_class = g_type_class_peek_parent (klass);
 
 	/* Create class' signals */
@@ -134,6 +139,14 @@
 			      g_cclosure_marshal_VOID__POINTER,
 			      G_TYPE_NONE, 1,
 			      G_TYPE_POINTER);
+	e_cal_view_signals[OPEN_EVENT] =
+		g_signal_new ("open_event",
+			      G_TYPE_FROM_CLASS (klass),
+			      G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+			      G_STRUCT_OFFSET (ECalViewClass, open_event),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
 
 	/* Method override */
 	object_class->destroy = e_cal_view_destroy;
@@ -147,11 +160,23 @@
 	klass->set_selected_time_range = NULL;
 	klass->get_visible_time_range = NULL;
 	klass->update_query = NULL;
+	klass->open_event = e_cal_view_open_event;
 
 	/* clipboard atom */
 	if (!clipboard_atom)
 		clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
 
+
+       /*
+        * Key bindings
+        */
+
+	binding_set = gtk_binding_set_by_class (klass);
+	
+	gtk_binding_entry_add_signal (binding_set, GDK_o,
+				      GDK_MOD1_MASK,
+				      "open_event", 0);
+	
 	/* init the accessibility support for e_day_view */
  	e_cal_view_a11y_init ();
 }
@@ -1271,4 +1296,21 @@
 	g_signal_connect (popup, "selection-done", G_CALLBACK (free_view_popup), cal_view);
 
 	return popup;
+}
+
+
+static void 
+e_cal_view_open_event (ECalView *cal_view)
+{
+	GList *selected;
+
+	selected = e_cal_view_get_selected_events (cal_view);
+	if (selected) {
+		ECalViewEvent *event = (ECalViewEvent *) selected->data;
+
+		if (event)
+			gnome_calendar_edit_object (cal_view->priv->calendar, event->comp_data->client, event->comp_data->icalcomp, FALSE);
+
+		g_list_free (selected);
+	}
 }
Index: calendar/gui/e-cal-view.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-view.h,v
retrieving revision 1.11
diff -u -b -B -r1.11 e-cal-view.h
--- calendar/gui/e-cal-view.h	20 Aug 2003 10:16:59 -0000	1.11
+++ calendar/gui/e-cal-view.h	28 Sep 2003 13:49:29 -0000
@@ -86,6 +86,7 @@
 	void (* set_selected_time_range) (ECalView *cal_view, time_t start_time, time_t end_time);
 	gboolean (* get_visible_time_range) (ECalView *cal_view, time_t *start_time, time_t *end_time);
 	void (* update_query) (ECalView *cal_view);
+	void (* open_event) (ECalView *cal_view);
 };
 
 GType          e_cal_view_get_type (void);
Index: calendar/gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.95
diff -u -b -B -r1.95 e-calendar-table.c
--- calendar/gui/e-calendar-table.c	20 Aug 2003 12:14:02 -0000	1.95
+++ calendar/gui/e-calendar-table.c	28 Sep 2003 13:49:33 -0000
@@ -1246,6 +1246,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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]