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



Made changes and the signal is connected to the widget.


Thanks,
Viren

>>> chen <pchenthill novell com> 10/01/05 21:06 PM >>>
The signal should be connected to the date navigator instead of the v
pane.

thanks, Chenthill.

On Fri, 2005-09-30 at 02:02 -0600, Viren L wrote:
> Hi,
> 
> Attached is the fix for bug
> http://bugzilla.gnome.org/show_bug.cgi?id=272920
> 
> 
> 
> Thanks,
> Viren
> 
> 
> _______________________________________________
> Evolution-patches mailing list
> Evolution-patches gnome org
> http://mail.gnome.org/mailman/listinfo/evolution-patches

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2826
diff -u -p -r1.2826 ChangeLog
--- ChangeLog	6 Oct 2005 18:21:50 -0000	1.2826
+++ ChangeLog	7 Oct 2005 10:16:52 -0000
@@ -1,3 +1,10 @@
+2005-09-07  Viren.L  <lviren novell com>
+	Fixes #272920
+
+	* gui/gnome-cal.c (setup_widgets):
+	Connect signal to catch the scroll-event on the widget of date navigator
+	and handle the GDK_SCROLL_UP,GDK_SCROLL_DOWN in the callback.
+
 2005-10-06  Srinivasa Ragavan <sragavan novell com>
 
 	* calendar.error.xml: Added accels to the Disard new event/
Index: gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.389
diff -u -p -r1.389 gnome-cal.c
--- gui/gnome-cal.c	3 Oct 2005 11:20:51 -0000	1.389
+++ gui/gnome-cal.c	7 Oct 2005 10:16:53 -0000
@@ -219,6 +219,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_date_navigator_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,
@@ -1400,6 +1401,8 @@ setup_widgets (GnomeCalendar *gcal)
 			  G_CALLBACK (gnome_calendar_on_date_navigator_selection_changed), gcal);
 	g_signal_connect (priv->date_navigator->calitem, "date_range_changed",
 			  G_CALLBACK (gnome_calendar_on_date_navigator_date_range_changed), gcal);
+	g_signal_connect (w, "scroll-event",
+			  G_CALLBACK (gnome_calendar_date_navigator_scrolled), gcal);
 
 	/* The ToDo list. */
 	priv->todo = e_calendar_table_new ();
@@ -3172,6 +3175,32 @@ gnome_calendar_vpane_resized (GtkWidget 
 	}
 
 	return FALSE;
+}
+
+static void 
+gnome_calendar_date_navigator_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


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