aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/gnome-cal.c37
-rw-r--r--calendar/gui/gnome-cal.h2
2 files changed, 39 insertions, 0 deletions
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 {