From 00f836ea75d6cbcf116aa5223f6123409f395a1d Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 15 Oct 2002 16:47:38 +0000 Subject: try to preserve the work week view setting if it makes sense (set_view): 2002-10-11 JP Rosevear * gui/gnome-cal.c (gnome_calendar_on_date_navigator_selection_changed): try to preserve the work week view setting if it makes sense (set_view): don't update the info again based on our view change call svn path=/trunk/; revision=18369 --- calendar/ChangeLog | 8 ++++++++ calendar/gui/gnome-cal.c | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index edaaa58c14..b2d7b87ca5 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2002-10-11 JP Rosevear + + * gui/gnome-cal.c + (gnome_calendar_on_date_navigator_selection_changed): try to + preserve the work week view setting if it makes sense + (set_view): don't update the info again based on our view change + call + 2002-10-08 Rodrigo Moya Fixes #11434 diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 5885185e73..18dacc89ef 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1219,7 +1219,11 @@ set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type, gboolean round_selection; GtkWidget *focus_widget; const char *view_id; - + static gboolean updating = FALSE; + + if (updating) + return; + priv = gcal->priv; round_selection = FALSE; @@ -1269,8 +1273,10 @@ set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type, calendar_config_set_default_view (view_type); + updating = TRUE; gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), (int) view_type); gal_view_instance_set_current_view_id (priv->view_instance, view_id); + updating = FALSE; if (grab_focus) gtk_widget_grab_focus (focus_widget); @@ -2602,9 +2608,14 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem, tt.day = end_day; icaltime_adjust (&tt, 1, 0, 0, 0); priv->selection_end_time = icaltime_as_timet_with_zone (tt, priv->zone); - + e_day_view_set_days_shown (E_DAY_VIEW (priv->day_view), new_days_shown); - gnome_calendar_set_view (gcal, GNOME_CAL_DAY_VIEW, TRUE, FALSE); + + if (new_days_shown == 5 && priv->current_view_type == GNOME_CAL_WORK_WEEK_VIEW) + gnome_calendar_set_view (gcal, GNOME_CAL_WORK_WEEK_VIEW, TRUE, FALSE); + else + gnome_calendar_set_view (gcal, GNOME_CAL_DAY_VIEW, TRUE, FALSE); + } focus_current_view (gcal); -- cgit v1.2.3