diff options
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 37 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.h | 2 |
3 files changed, 47 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 2f6c22a5cf..f4d63df1af 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2003-07-16 Andrew Wu <Yang.Wu@sun.com> + + 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. + 2003-07-14 Rodrigo Moya <rodrigo@ximian.com> Fixes #41676 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; } diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index ce25f4544b..22bae4f735 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -65,6 +65,8 @@ typedef enum GNOME_CAL_GOTO_LAST_DAY_OF_MONTH, GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK, GNOME_CAL_GOTO_LAST_DAY_OF_WEEK, + GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK, + GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK } GnomeCalendarGotoDateType; struct _GnomeCalendar { |