aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-06-21 12:36:23 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-06-21 12:36:23 +0800
commitabd592ea8ca85828357e47a01ac9c433741b9825 (patch)
treeb048e483631d619fb3276d47c15bbc13475f899c /calendar/gui/gnome-cal.c
parent259ccb8fe525a279b9c0ed74fdad16b332888e4a (diff)
downloadgsoc2013-evolution-abd592ea8ca85828357e47a01ac9c433741b9825.tar
gsoc2013-evolution-abd592ea8ca85828357e47a01ac9c433741b9825.tar.gz
gsoc2013-evolution-abd592ea8ca85828357e47a01ac9c433741b9825.tar.bz2
gsoc2013-evolution-abd592ea8ca85828357e47a01ac9c433741b9825.tar.lz
gsoc2013-evolution-abd592ea8ca85828357e47a01ac9c433741b9825.tar.xz
gsoc2013-evolution-abd592ea8ca85828357e47a01ac9c433741b9825.tar.zst
gsoc2013-evolution-abd592ea8ca85828357e47a01ac9c433741b9825.zip
changed so it keeps the selection range. It just moves it on one day/week
2000-06-21 Damon Chaplin <damon@helixcode.com> * gui/gnome-cal.c (gnome_calendar_direction): changed so it keeps the selection range. It just moves it on one day/week etc. This makes it very handy for the keyboard shortcut code. * gui/calendar-commands.c (calendar_control_activate): fixed bug setting the radio button active. * gui/e-day-view.[hc]: added support for keyboard navigation and selection of the time range. svn path=/trunk/; revision=3665
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 6f05c7ec60..ed9ad98484 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -319,25 +319,35 @@ static void
gnome_calendar_direction (GnomeCalendar *gcal, int direction)
{
GtkWidget *cp = get_current_page (gcal);
- time_t current_time, new_time;
-
- current_time = gcal->selection_start_time;
-
- if (cp == gcal->day_view)
- new_time = time_add_day (current_time, direction);
- else if (cp == gcal->work_week_view)
- new_time = time_add_week (current_time, direction);
- else if (cp == gcal->week_view)
- new_time = time_add_week (current_time, direction);
- else if (cp == gcal->month_view)
- new_time = time_add_month (current_time, direction);
- else {
+ time_t start_time, end_time;
+
+ start_time = gcal->selection_start_time;
+ end_time = gcal->selection_end_time;
+
+ if (cp == gcal->day_view) {
+ start_time = time_add_day (start_time, direction);
+ end_time = time_add_day (end_time, direction);
+ } else if (cp == gcal->work_week_view) {
+ start_time = time_add_week (start_time, direction);
+ end_time = time_add_week (end_time, direction);
+ } else if (cp == gcal->week_view) {
+ start_time = time_add_week (start_time, direction);
+ end_time = time_add_week (end_time, direction);
+ } else if (cp == gcal->month_view) {
+ start_time = time_add_month (start_time, direction);
+ end_time = time_add_month (end_time, direction);
+ } else {
g_warning ("Weee! Where did the penguin go?");
g_assert_not_reached ();
- new_time = 0;
+ start_time = 0;
+ end_time = 0;
}
- gnome_calendar_goto (gcal, new_time);
+ gcal->selection_start_time = start_time;
+ gcal->selection_end_time = end_time;
+
+ gnome_calendar_update_view_times (gcal, NULL);
+ gnome_calendar_update_gtk_calendar (gcal);
}
void