aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorAndrew Wu <Yang.Wu@sun.com>2003-07-16 17:20:28 +0800
committerBolian Yin <byin@src.gnome.org>2003-07-16 17:20:28 +0800
commit65e1b7029afd1232d7f88b263d592f203c70c1f3 (patch)
treec0e2ea95601ca80944d89287568eaeccd08c8223 /calendar
parentd706bab5418aefe14c0994f25b05464cd140fc24 (diff)
downloadgsoc2013-evolution-65e1b7029afd1232d7f88b263d592f203c70c1f3.tar
gsoc2013-evolution-65e1b7029afd1232d7f88b263d592f203c70c1f3.tar.gz
gsoc2013-evolution-65e1b7029afd1232d7f88b263d592f203c70c1f3.tar.bz2
gsoc2013-evolution-65e1b7029afd1232d7f88b263d592f203c70c1f3.tar.lz
gsoc2013-evolution-65e1b7029afd1232d7f88b263d592f203c70c1f3.tar.xz
gsoc2013-evolution-65e1b7029afd1232d7f88b263d592f203c70c1f3.tar.zst
gsoc2013-evolution-65e1b7029afd1232d7f88b263d592f203c70c1f3.zip
Fixes #45774
2003-07-16 Andrew Wu <Yang.Wu@sun.com> Fixes #45774 * gui/e-day-view.c (e_day_view_goto_start_of_work_day): implemented select the time that begins a work day. (e_day_view_goto_end_of_work_day): implemented select the time that ends a work day. svn path=/trunk/; revision=21839
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/e-day-view.c67
2 files changed, 76 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index f4d63df1af..01cd31d988 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,4 +1,13 @@
2003-07-16 Andrew Wu <Yang.Wu@sun.com>
+
+ Fixes #45774
+
+ * gui/e-day-view.c (e_day_view_goto_start_of_work_day):
+ implemented select the time that begins a work day.
+ (e_day_view_goto_end_of_work_day):
+ implemented select the time that ends a work day.
+
+2003-07-16 Andrew Wu <Yang.Wu@sun.com>
Fixes #45772
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index bd3f4fd513..223a2fe3bd 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -164,6 +164,8 @@ static gboolean e_day_view_get_extreme_event (EDayView *day_view,
static gboolean e_day_view_do_key_press (GtkWidget *widget,
GdkEventKey *event);
static gboolean e_day_view_popup_menu (GtkWidget *widget);
+static void e_day_view_goto_start_of_work_day (EDayView *day_view);
+static void e_day_view_goto_end_of_work_day (EDayView *day_view);
static void e_day_view_cursor_key_up_shifted (EDayView *day_view,
GdkEventKey *event);
static void e_day_view_cursor_key_down_shifted (EDayView *day_view,
@@ -5671,6 +5673,22 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
return FALSE;
}
+ /*Go to the start/end of a work day*/
+ if ((keyval == GDK_Home)
+ &&((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK)
+ &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK)
+ &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) {
+ e_day_view_goto_start_of_work_day (day_view);
+ return TRUE;
+ }
+ if ((keyval == GDK_End)
+ &&((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK)
+ &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK)
+ &&((event->state & GDK_MOD1_MASK) != GDK_MOD1_MASK)) {
+ e_day_view_goto_end_of_work_day (day_view);
+ return TRUE;
+ }
+
/* Handle the cursor keys for moving & extending the selection. */
stop_emission = TRUE;
if (event->state & GDK_SHIFT_MASK) {
@@ -5806,6 +5824,55 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event)
return handled;
}
+/* Select the time that begins a work day*/
+static void
+e_day_view_goto_start_of_work_day (EDayView *day_view)
+{
+ g_return_if_fail(day_view!=NULL);
+
+ if (day_view->selection_in_top_canvas)
+ return;
+ else
+ day_view->selection_start_row =
+ e_day_view_convert_time_to_row (day_view,
+ day_view->work_day_start_hour,
+ day_view->work_day_start_minute);
+ day_view->selection_end_row = day_view->selection_start_row;
+
+ e_day_view_ensure_rows_visible (day_view,
+ day_view->selection_start_row,
+ day_view->selection_end_row);
+
+ e_day_view_update_calendar_selection_time (day_view);
+
+ gtk_widget_queue_draw (day_view->top_canvas);
+ gtk_widget_queue_draw (day_view->main_canvas);
+}
+
+
+/* Select the time that ends a work day*/
+static void
+e_day_view_goto_end_of_work_day (EDayView *day_view)
+{
+ if (day_view->selection_in_top_canvas)
+ return;
+ else
+ day_view->selection_start_row =
+ e_day_view_convert_time_to_row (day_view,
+ day_view->work_day_end_hour-1,
+ day_view->work_day_end_minute+30);
+ day_view->selection_end_row = day_view->selection_start_row;
+
+ e_day_view_ensure_rows_visible (day_view,
+ day_view->selection_start_row,
+ day_view->selection_end_row);
+
+ e_day_view_update_calendar_selection_time (day_view);
+
+ gtk_widget_queue_draw (day_view->top_canvas);
+ gtk_widget_queue_draw (day_view->main_canvas);
+}
+
static void
e_day_view_cursor_key_up_shifted (EDayView *day_view, GdkEventKey *event)
{