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



Hi
this is a old patch , I have modified this patch follow anna's advice.
This is a patch for calendar keyboard navigation ( 45775).
in DayView, WeekView, Task: Alt+o, open the editing dialog for current
selected item.
Could you take some time to review it?
Thanks

? stamp-h1
? addressbook/gui/component/apps_evolution_addressbook-1.5.schemas
? calendar/gui/apps_evolution_calendar-1.5.schemas
? mail/evolution-mail-1.5.schemas
? shell/apps_evolution_shell-1.5.schemas
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2006
diff -u -b -B -r1.2006 ChangeLog
--- calendar/ChangeLog	10 Dec 2003 15:44:23 -0000	1.2006
+++ calendar/ChangeLog	13 Dec 2003 15:00:14 -0000
@@ -1,3 +1,15 @@
+2003-12-10 Andrew Wu <Yang Wu sun com>
+                                                                                                                             
+        * gui/calendar-commands.c
+        add a menuitem for "open appointment".
+        * gui/e-cal-view.c,e-cal-view.h
+          add a singal--"open_event", and bind it to "ctrl+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):"ctrl+o" to open a dialog
+        to edit the selected task.
+                                                                                                                             
 2003-12-10  Rodrigo Moya <rodrigo ximian com>
 
 	* gui/gnome-cal.c (gnome_calendar_add_event_uri): remove the client
Index: calendar/gui/calendar-commands.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-commands.c,v
retrieving revision 1.135
diff -u -b -B -r1.135 calendar-commands.c
--- calendar/gui/calendar-commands.c	3 Dec 2003 17:58:56 -0000	1.135
+++ calendar/gui/calendar-commands.c	13 Dec 2003 15:00:14 -0000
@@ -81,6 +81,17 @@
 	new_calendar_dialog (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))));
 }
 
+static void
+file_open_event_cb (BonoboUIComponent *uic, gpointer data, const char *path)
+{
+	GnomeCalendar *gcal;
+
+	gcal = GNOME_CALENDAR (data);
+
+	e_calendar_view_open_event (gnome_calendar_get_current_view_widget (gcal));
+}
+
+
 /* Prints the calendar at its current view and time range */
 static void
 print (GnomeCalendar *gcal, gboolean preview)
@@ -538,6 +549,9 @@
 			read_only = TRUE;
 	}
 
+	bonobo_ui_component_set_prop (uic, "/commands/EventOpen", "sensitive",
+				      n_selected == 0 || read_only ? "0" : "1",
+				      NULL);
 	bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive",
 				      n_selected == 0 || read_only ? "0" : "1",
 				      NULL);
@@ -692,6 +706,7 @@
 
 static BonoboUIVerb verbs [] = {
 	BONOBO_UI_VERB ("NewCalendar", file_new_calendar_cb),
+	BONOBO_UI_VERB ("EventOpen", file_open_event_cb),
 	BONOBO_UI_VERB ("CalendarPrint", file_print_cb),
 	BONOBO_UI_VERB ("CalendarPrintPreview", file_print_preview_cb),
 
Index: calendar/gui/e-cal-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-view.c,v
retrieving revision 1.26
diff -u -b -B -r1.26 e-cal-view.c
--- calendar/gui/e-cal-view.c	3 Dec 2003 17:58:56 -0000	1.26
+++ calendar/gui/e-cal-view.c	13 Dec 2003 15:00:15 -0000
@@ -25,6 +25,8 @@
 #include <string.h>
 #include <gtk/gtkimage.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"
@@ -97,6 +99,7 @@
 	TIMEZONE_CHANGED,
 	EVENT_CHANGED,
 	EVENT_ADDED,
+	OPEN_EVENT,
 	LAST_SIGNAL
 };
 
@@ -146,6 +149,8 @@
 	GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 	GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
 
+	GtkBindingSet *binding_set;
+
 	parent_class = g_type_class_peek_parent (klass);
 
 	/* Method override */
@@ -163,6 +168,7 @@
 	klass->set_selected_time_range = NULL;
 	klass->get_visible_time_range = NULL;
 	klass->update_query = NULL;
+	klass->open_event = e_calendar_view_open_event;
 
 	g_object_class_install_property (gobject_class, PROP_MODEL, 
 					 g_param_spec_object ("model", NULL, NULL, E_TYPE_CAL_MODEL,
@@ -205,6 +211,15 @@
 			      G_TYPE_NONE, 1,
 			      G_TYPE_POINTER);
 
+	e_calendar_view_signals[OPEN_EVENT] =
+		g_signal_new ("open_event",
+			      G_TYPE_FROM_CLASS (klass),
+			      G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+			      G_STRUCT_OFFSET (ECalendarViewClass, open_event),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
 	e_calendar_view_signals[EVENT_ADDED] =
 		g_signal_new ("event_added",
 			      G_TYPE_FROM_CLASS (object_class),
@@ -219,6 +234,17 @@
 	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_CONTROL_MASK,
+                                      "open_event", 0);
+
 	/* init the accessibility support for e_day_view */
  	e_cal_view_a11y_init ();
 }
@@ -1346,6 +1372,23 @@
 	return popup;
 }
 
+void 
+e_calendar_view_open_event (ECalendarView *cal_view)
+{
+	GList *selected;
+
+	selected = e_calendar_view_get_selected_events (cal_view);
+	if (selected) {
+		ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data;
+
+		if (event)
+			e_calendar_view_edit_appointment (cal_view, event->comp_data->client,
+						     event->comp_data->icalcomp, FALSE);
+
+		g_list_free (selected);
+	}
+}
+
 /**
  * e_calendar_view_new_appointment_for
  * @cal_view: A calendar view.
Index: calendar/gui/e-cal-view.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-view.h,v
retrieving revision 1.17
diff -u -b -B -r1.17 e-cal-view.h
--- calendar/gui/e-cal-view.h	7 Nov 2003 05:51:58 -0000	1.17
+++ calendar/gui/e-cal-view.h	13 Dec 2003 15:00:15 -0000
@@ -87,6 +87,7 @@
 	void (* set_selected_time_range) (ECalendarView *cal_view, time_t start_time, time_t end_time);
 	gboolean (* get_visible_time_range) (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
 	void (* update_query) (ECalendarView *cal_view);
+	void (* open_event) (ECalendarView *cal_view);
 };
 
 GType          e_calendar_view_get_type (void);
@@ -131,6 +132,8 @@
 					    ECal *client,
 					    icalcomponent *icalcomp,
 					    gboolean meeting);
+void           e_calendar_view_open_event (ECalendarView *cal_view);
+
 
 G_END_DECLS
 
Index: calendar/gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.102
diff -u -b -B -r1.102 e-calendar-table.c
--- calendar/gui/e-calendar-table.c	3 Dec 2003 17:58:56 -0000	1.102
+++ calendar/gui/e-calendar-table.c	13 Dec 2003 15:00:15 -0000
@@ -1249,6 +1249,10 @@
 	if (event->keyval == GDK_Delete) {
 		delete_cb (NULL, cal_table);
 		return TRUE;
+	} else if ((event->keyval == GDK_o)
+		   &&(event->state & GDK_CONTROL_MASK)) {
+		open_task_by_row (cal_table, row);
+		return TRUE;	
 	}
 
 	return FALSE;
Index: calendar/gui/e-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view.c,v
retrieving revision 1.229
diff -u -b -B -r1.229 e-day-view.c
--- calendar/gui/e-day-view.c	9 Dec 2003 01:23:48 -0000	1.229
+++ calendar/gui/e-day-view.c	13 Dec 2003 15:00:18 -0000
@@ -2101,7 +2101,7 @@
 	day_view->lower = start_time;
 	day_view->upper = day_view->day_starts[day_view->days_shown];
 
-	e_day_view_update_query (day_view);
+	e_day_view_update_query ((ECalendarView *) day_view);
 }
 
 
Index: ui/evolution-calendar.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-calendar.xml,v
retrieving revision 1.64
diff -u -b -B -r1.64 evolution-calendar.xml
--- ui/evolution-calendar.xml	18 Nov 2003 17:36:24 -0000	1.64
+++ ui/evolution-calendar.xml	13 Dec 2003 15:00:19 -0000
@@ -1,6 +1,7 @@
 <Root>
   <commands>
     <cmd name="NewCalendar" _tip="Create a new calendar"/>
+    <cmd name="EventOpen" _tip="View the current appointment" accel="*Control*o"/>
     <cmd name="CalendarPrint" _tip="Print this calendar" pixtype="stock" pixname="gtk-print"
 	 accel="*Control*p"/>
     <cmd name="CalendarPrintPreview" _tip="Previews the calendar to be printed" pixtype="stock" pixname="gtk-print-preview"/>
@@ -36,6 +37,9 @@
 	            _tip="Create a new calendar"/>
         </placeholder>
       </submenu>
+      <placeholder name="FileOps">
+        <menuitem name="EventOpen" verb="EventOpen" _label="_Open Appointment"/>
+      </placeholder>
       <placeholder name="Print">
 	<menuitem name="PrintPreview" verb="CalendarPrintPreview"
 		  _label="Print Pre_view"/>


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