[evolution-patches] patch for bug #272920 [Calendar]



Hi,

Attached is the fix for bug
http://bugzilla.gnome.org/show_bug.cgi?id=272920



Thanks,
Viren


Index: gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.387
diff -u -p -r1.387 gnome-cal.c
--- gui/gnome-cal.c	29 Sep 2005 13:02:55 -0000	1.387
+++ gui/gnome-cal.c	30 Sep 2005 07:47:46 -0000
@@ -218,6 +218,7 @@ static void gnome_calendar_update_date_n
 static void gnome_calendar_hpane_realized (GtkWidget *w, GnomeCalendar *gcal);
 static void gnome_calendar_vpane_realized (GtkWidget *w, GnomeCalendar *gcal);
 static gboolean gnome_calendar_vpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal);
+static void gnome_calendar_vpane_scrolled (GtkWidget *widget, GdkEventScroll *event, gpointer user_data);
 static gboolean gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal);
 
 static void gnome_calendar_on_date_navigator_date_range_changed (ECalendarItem *calitem,
@@ -1361,6 +1362,8 @@ setup_widgets (GnomeCalendar *gcal)
 				G_CALLBACK(gnome_calendar_vpane_realized), gcal);
 	g_signal_connect (priv->vpane, "button_release_event",
 			  G_CALLBACK (gnome_calendar_vpane_resized), gcal);
+	g_signal_connect (priv->vpane, "scroll-event",
+			  G_CALLBACK (gnome_calendar_vpane_scrolled), gcal);
 	gtk_widget_show (priv->vpane);
 	gtk_paned_pack2 (GTK_PANED (priv->hpane), priv->vpane, TRUE, TRUE);
 
@@ -3153,6 +3156,32 @@ gnome_calendar_vpane_resized (GtkWidget 
 	}
 
 	return FALSE;
+}
+
+static void 
+gnome_calendar_vpane_scrolled (GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
+{
+	GnomeCalendar *gcal = user_data;
+	ECalendarItem *calitem = gcal->priv->date_navigator->calitem;	
+	GDate start_date, end_date;
+	
+	if (e_calendar_item_get_selection (calitem, &start_date, &end_date)) {
+		switch (event->direction) {
+		case GDK_SCROLL_UP:
+			g_date_subtract_months (&start_date, 1);
+			g_date_subtract_months (&end_date, 1);
+			break;
+		case GDK_SCROLL_DOWN:
+			g_date_add_months (&start_date, 1);
+			g_date_add_months (&end_date, 1);
+			break;
+		default:
+			break;	
+		
+		}
+		e_calendar_item_set_selection (calitem, &start_date, &end_date);
+		gnome_calendar_on_date_navigator_selection_changed (calitem, gcal);
+	}
 }
 
 static gboolean
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2808
diff -u -p -r1.2808 ChangeLog
--- ChangeLog	29 Sep 2005 13:02:55 -0000	1.2808
+++ ChangeLog	30 Sep 2005 07:47:49 -0000
@@ -1,3 +1,10 @@
+2005-09-30  Viren.L  <lviren novell com>
+	Fixes #272920
+
+	* gui/gnome-cal.c (setup_widgets):
+	Connect signal to catch the scroll-event on the vpane of date navigator
+	and handle the GDK_SCROLL_UP,GDK_SCROLL_DOWN in the callback.
+
 2005-08-29  Chenthill Palanisamy  <pchenthill novell com>
 
 	* gui/e-calendar-table.c (e_calendar_table_open_task): Set the 


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