From abc0e4c694fb3d9624e890384880def730769fa0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 7 Dec 2009 11:31:17 -0500 Subject: Introduce ESelectable and EFocusTracker. EFocusTracker tracks the input focus within a window and helps keep the sensitivity of "selectable" actions in the main menu up-to-date. Selectable actions include Cut, Copy, Paste, Select All and Delete. EFocusTracker has built-in support for widgets that implement the GtkEditable interface such as GtkEntry and GtkTextView. It also supports custom widgets that implement the ESelectable interface, which is a subset of GtkEditable and can apply to anything that displays selectable content (esp. tree views and ETables). This commit integrates EFocusTracker with EShellWindow, CompEditor, EMsgComposer, and ESignatureManager. It also bumps the GtkHTML requirement to 2.29.5 to utilize the new GtkhtmlEditor:html constructor property. --- modules/calendar/e-cal-shell-content.c | 108 --------------------------------- 1 file changed, 108 deletions(-) (limited to 'modules/calendar/e-cal-shell-content.c') diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index c3112cf42c..4946972efd 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -720,114 +720,6 @@ e_cal_shell_content_get_view_instance (ECalShellContent *cal_shell_content) return cal_shell_content->priv->view_instance; } -void -e_cal_shell_content_copy_clipboard (ECalShellContent *cal_shell_content) -{ - GnomeCalendar *calendar; - EMemoTable *memo_table; - ECalendarTable *task_table; - GnomeCalendarViewType view_type; - ECalendarView *calendar_view; - - g_return_if_fail (E_IS_CAL_SHELL_CONTENT (cal_shell_content)); - - calendar = e_cal_shell_content_get_calendar (cal_shell_content); - memo_table = e_cal_shell_content_get_memo_table (cal_shell_content); - task_table = e_cal_shell_content_get_task_table (cal_shell_content); - - view_type = gnome_calendar_get_view (calendar); - calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); - - switch (cal_shell_content_get_focus_location (cal_shell_content)) { - case FOCUS_CALENDAR: - e_calendar_view_copy_clipboard (calendar_view); - break; - - case FOCUS_MEMO_TABLE: - e_memo_table_copy_clipboard (memo_table); - break; - - case FOCUS_TASK_TABLE: - e_calendar_table_copy_clipboard (task_table); - break; - - default: - g_return_if_reached (); - } -} - -void -e_cal_shell_content_cut_clipboard (ECalShellContent *cal_shell_content) -{ - GnomeCalendar *calendar; - EMemoTable *memo_table; - ECalendarTable *task_table; - GnomeCalendarViewType view_type; - ECalendarView *calendar_view; - - g_return_if_fail (E_IS_CAL_SHELL_CONTENT (cal_shell_content)); - - calendar = e_cal_shell_content_get_calendar (cal_shell_content); - memo_table = e_cal_shell_content_get_memo_table (cal_shell_content); - task_table = e_cal_shell_content_get_task_table (cal_shell_content); - - view_type = gnome_calendar_get_view (calendar); - calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); - - switch (cal_shell_content_get_focus_location (cal_shell_content)) { - case FOCUS_CALENDAR: - e_calendar_view_cut_clipboard (calendar_view); - break; - - case FOCUS_MEMO_TABLE: - e_memo_table_copy_clipboard (memo_table); - break; - - case FOCUS_TASK_TABLE: - e_calendar_table_copy_clipboard (task_table); - break; - - default: - g_return_if_reached (); - } -} - -void -e_cal_shell_content_paste_clipboard (ECalShellContent *cal_shell_content) -{ - GnomeCalendar *calendar; - EMemoTable *memo_table; - ECalendarTable *task_table; - GnomeCalendarViewType view_type; - ECalendarView *calendar_view; - - g_return_if_fail (E_IS_CAL_SHELL_CONTENT (cal_shell_content)); - - calendar = e_cal_shell_content_get_calendar (cal_shell_content); - memo_table = e_cal_shell_content_get_memo_table (cal_shell_content); - task_table = e_cal_shell_content_get_task_table (cal_shell_content); - - view_type = gnome_calendar_get_view (calendar); - calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); - - switch (cal_shell_content_get_focus_location (cal_shell_content)) { - case FOCUS_CALENDAR: - e_calendar_view_paste_clipboard (calendar_view); - break; - - case FOCUS_MEMO_TABLE: - e_memo_table_paste_clipboard (memo_table); - break; - - case FOCUS_TASK_TABLE: - e_calendar_table_paste_clipboard (task_table); - break; - - default: - g_return_if_reached (); - } -} - void e_cal_shell_content_delete_selection (ECalShellContent *cal_shell_content) { -- cgit v1.2.3