[evolution-patches] 70000 "Today" button not switching to single day view



It switches to the right time, but of the current view.

-JP
-- 
JP Rosevear <jpr novell com>
Novell, Inc.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2671
diff -u -r1.2671 ChangeLog
--- ChangeLog	23 Feb 2005 01:33:18 -0000	1.2671
+++ ChangeLog	23 Feb 2005 16:46:04 -0000
@@ -1,3 +1,10 @@
+2005-02-23  JP Rosevear  <jpr novell com>
+
+	Fixes #70000
+	
+	* gui/gnome-cal.c (gnome_calendar_goto_today): set the view type
+	to day view
+
 2005-02-21  JP Rosevear  <jpr novell com>
  
  	Fixes #63866, #67714, #62089, #47747, #61495, #28947
Index: gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.366
diff -u -r1.366 gnome-cal.c
--- gui/gnome-cal.c	18 Feb 2005 05:41:06 -0000	1.366
+++ gui/gnome-cal.c	23 Feb 2005 16:46:05 -0000
@@ -194,8 +194,7 @@
 /* Used to indicate who has the focus within the calendar view */
 typedef enum {
 	FOCUS_CALENDAR,
-	FOCUS_TASKPAD,
-	FOCUS_OTHER
+	FOCUS_TASKPAD
 } FocusLocation;
 
 static guint gnome_calendar_signals[LAST_SIGNAL];
@@ -593,50 +592,8 @@
 
 	if (GTK_WIDGET_HAS_FOCUS (etable->table_canvas))
 		return FOCUS_TASKPAD;
-	else {
-		GtkWidget *widget;
-		EDayView *dv;
-		EWeekView *wv;
-		ECalListView *lv;
-
-		widget = gnome_calendar_get_current_view_widget (gcal);
-
-		switch (priv->current_view_type) {
-		case GNOME_CAL_DAY_VIEW:
-		case GNOME_CAL_WORK_WEEK_VIEW:
-			dv = E_DAY_VIEW (widget);
-
-			if (GTK_WIDGET_HAS_FOCUS (dv->top_canvas)
-			    || GNOME_CANVAS (dv->top_canvas)->focused_item != NULL
-			    || GTK_WIDGET_HAS_FOCUS (dv->main_canvas)
-			    || GNOME_CANVAS (dv->main_canvas)->focused_item != NULL)
-				return FOCUS_CALENDAR;
-			else
-				return FOCUS_OTHER;
-
-		case GNOME_CAL_WEEK_VIEW:
-		case GNOME_CAL_MONTH_VIEW:
-			wv = E_WEEK_VIEW (widget);
-
-			if (GTK_WIDGET_HAS_FOCUS (wv->main_canvas)
-			    || GNOME_CANVAS (wv->main_canvas)->focused_item != NULL)
-				return FOCUS_CALENDAR;
-			else
-				return FOCUS_OTHER;
-
-		case GNOME_CAL_LIST_VIEW:
-			lv = E_CAL_LIST_VIEW (widget);
-
-			if (GTK_WIDGET_HAS_FOCUS (e_table_scrolled_get_table (lv->table_scrolled)))
-				return FOCUS_CALENDAR;
-			else
-				return FOCUS_OTHER;
-
-		default:
-			g_assert_not_reached ();
-			return FOCUS_OTHER;
-		}
-	}
+	else
+		return FOCUS_CALENDAR;
 }
 
 /* Computes the range of time that the date navigator is showing */
@@ -1723,6 +1680,7 @@
 	g_return_if_fail (GNOME_IS_CALENDAR (gcal));
 
 	gnome_calendar_goto (gcal, time (NULL));
+	gnome_calendar_set_view (gcal, GNOME_CAL_DAY_VIEW);	
 	focus_current_view (gcal);
 }
 
@@ -3034,8 +2992,10 @@
 
 	if (location == FOCUS_CALENDAR) {
 		e_calendar_view_cut_clipboard (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)));
-	} else if (location == FOCUS_TASKPAD)
+		focus_current_view (gcal);
+	} else if (location == FOCUS_TASKPAD) {
 		e_calendar_table_cut_clipboard (E_CALENDAR_TABLE (priv->todo));
+	}
 }
 
 void
@@ -3050,6 +3010,7 @@
 
 	if (location == FOCUS_CALENDAR) {
 		e_calendar_view_copy_clipboard (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)));
+		focus_current_view (gcal);
 	} else if (location == FOCUS_TASKPAD)
 		e_calendar_table_copy_clipboard (E_CALENDAR_TABLE (priv->todo));
 }
@@ -3066,6 +3027,7 @@
 
 	if (location == FOCUS_CALENDAR) {
 		e_calendar_view_paste_clipboard (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)));
+		focus_current_view (gcal);
 	} else if (location == FOCUS_TASKPAD)
 		e_calendar_table_paste_clipboard (E_CALENDAR_TABLE (priv->todo));
 }


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