From d706bab5418aefe14c0994f25b05464cd140fc24 Mon Sep 17 00:00:00 2001 From: Andrew Wu Date: Wed, 16 Jul 2003 08:05:05 +0000 Subject: Fixes #45772 2003-07-16 Andrew Wu Fixes #45772 * gui/gnome-cal.c(gnome_calendar_goto_date): implemented Alt+Left/Right to go to the same day of the previous/next week. * gui/gnome-cal.h:add two element in GnomeCalendarGotoDateType. svn path=/trunk/; revision=21836 --- calendar/gui/gnome-cal.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 417dd5d5a7..66d1c38d0f 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -326,6 +326,28 @@ gnome_calendar_class_init (GnomeCalendarClass *class) "goto_date", 1, G_TYPE_ENUM, GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); + + /*Alt+Left/Right, go to the same day of the previous/next week*/ + gtk_binding_entry_add_signal (binding_set,GDK_Left, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); + gtk_binding_entry_add_signal (binding_set,GDK_KP_Left, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); + gtk_binding_entry_add_signal (binding_set,GDK_Right, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); + gtk_binding_entry_add_signal (binding_set,GDK_KP_Right, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); } /* Callback used when the calendar query reports of an updated object */ @@ -1121,6 +1143,21 @@ gnome_calendar_goto_date (GnomeCalendar *gcal, 1, priv->zone); need_updating = TRUE; break; + case GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK: + priv->selection_start_time = time_add_day_with_zone (start_time, + -7, priv->zone); + priv->selection_end_time = time_add_day_with_zone (end_time, + -7,priv->zone); + need_updating = TRUE; + break; + case GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK: + priv->selection_start_time = time_add_day_with_zone (start_time, + 7, priv->zone); + priv->selection_end_time = time_add_day_with_zone (end_time, + 7,priv->zone); + need_updating = TRUE; + break; + default: break; } -- cgit