Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2213
diff -u -r1.2213 ChangeLog
--- calendar/ChangeLog	26 Mar 2004 04:45:39 -0000	1.2213
+++ calendar/ChangeLog	26 Mar 2004 06:52:54 -0000
@@ -1,3 +1,12 @@
+2004-03-26  Kidd Wang  <kidd.wang@sun.com>
+
+	Fixes #45331
+
+	* gui/gnome-cal.c: (gnome_calendar_class_init),
+	(gnome_calendar_view_changed): add a new key binding for
+	Ctrl+Shift+Alt+D/W/K/M to switch between different views.
+	* gui/gnome-cal.h: ditto.
+
 2004-03-25  JP Rosevear <jpr@ximian.com>
 
 	* gui/e-cal-model.c (remove_client): fix off by one error when
Index: calendar/gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.312
diff -u -r1.312 gnome-cal.c
--- calendar/gui/gnome-cal.c	25 Mar 2004 17:56:07 -0000	1.312
+++ calendar/gui/gnome-cal.c	26 Mar 2004 06:52:55 -0000
@@ -174,6 +174,7 @@
 	CALENDAR_FOCUS_CHANGE,
 	TASKPAD_FOCUS_CHANGE,
 	GOTO_DATE,
+	VIEW_CHANGED,
 	LAST_SIGNAL
 };
 
@@ -194,6 +195,8 @@
 static void gnome_calendar_destroy (GtkObject *object);
 static void gnome_calendar_goto_date (GnomeCalendar *gcal,
 				      GnomeCalendarGotoDateType goto_date);
+static void gnome_calendar_view_changed (GnomeCalendar *gcal,
+					 GnomeCalendarViewType view_type);
 
 static void gnome_calendar_set_pane_positions	(GnomeCalendar	*gcal);
 static void update_view_times (GnomeCalendar *gcal, time_t start_time);
@@ -286,6 +289,16 @@
 			      1,
 			      G_TYPE_INT);
 
+	gnome_calendar_signals[VIEW_CHANGED] =
+		g_signal_new ("view_changed",
+			      G_TYPE_FROM_CLASS (object_class),
+			      G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+			      G_STRUCT_OFFSET (GnomeCalendarClass, view_changed),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__INT,
+			      G_TYPE_NONE,
+			      1,
+			      G_TYPE_INT);
 
 	object_class->destroy = gnome_calendar_destroy;
 
@@ -295,6 +308,7 @@
 	class->calendar_focus_change = NULL;
 	class->taskpad_focus_change = NULL;
 	class->goto_date = gnome_calendar_goto_date;
+	class->view_changed = gnome_calendar_view_changed;
 
 	/*
 	 * Key bindings
@@ -367,6 +381,29 @@
 				      "goto_date",1,
 				      G_TYPE_ENUM,
 				      GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK);
+
+	/* Ctrl+Alt+Shift+D/W/K/M to switch between DayView/WorkWeekView/WeekView/MonthView */
+   	gtk_binding_entry_add_signal (binding_set, GDK_d,
+				      GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK,
+				      "view_changed", 1,
+				      G_TYPE_ENUM,
+				      GNOME_CAL_DAY_VIEW);
+	gtk_binding_entry_add_signal (binding_set, GDK_w,
+				      GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK,
+				      "view_changed", 1,
+				      G_TYPE_ENUM,
+				      GNOME_CAL_WORK_WEEK_VIEW);
+	gtk_binding_entry_add_signal (binding_set, GDK_k,
+				      GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK,
+				      "view_changed", 1,
+				      G_TYPE_ENUM,
+				      GNOME_CAL_WEEK_VIEW);
+	gtk_binding_entry_add_signal (binding_set, GDK_m,
+				      GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK,
+				      "view_changed", 1,
+				      G_TYPE_ENUM,
+				      GNOME_CAL_MONTH_VIEW);
+
 	/* init the accessibility support for gnome_calendar */
 	gnome_calendar_a11y_init ();
 
@@ -1543,6 +1580,14 @@
 	gnome_calendar_notify_dates_shown_changed (gcal);
 }
 
+static void gnome_calendar_view_changed (GnomeCalendar *gcal, GnomeCalendarViewType view_type)
+{
+	if (gnome_calendar_get_view(gcal) == view_type)
+		return;
+	
+	gnome_calendar_set_view(gcal, view_type, FALSE, TRUE);
+}
+
 /* Callback used when the view collection asks us to display a particular view */
 static void
 display_view_cb (GalViewInstance *view_instance, GalView *view, gpointer data)
Index: calendar/gui/gnome-cal.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.h,v
retrieving revision 1.96
diff -u -r1.96 gnome-cal.h
--- calendar/gui/gnome-cal.h	27 Feb 2004 15:56:28 -0000	1.96
+++ calendar/gui/gnome-cal.h	26 Mar 2004 06:52:55 -0000
@@ -90,6 +90,8 @@
 	void (* taskpad_focus_change)   (GnomeCalendar *gcal, gboolean in);
         void (* goto_date)         (GnomeCalendar *gcal,
 				    GnomeCalendarGotoDateType date);
+	void (* view_changed) (GnomeCalendar *gcal,
+			       GnomeCalendarViewType view_type);
 
 };
 
