[evolution/kill-bonobo] Bug #203853 - Cut/Copy key bindings don't work in day and week views



commit 741d49c900ecc01002513060826b43dc26d4e55d
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jul 27 17:43:02 2009 +0200

    Bug #203853 - Cut/Copy key bindings don't work in day and week views

 calendar/gui/calendar-commands.c        |    4 ++--
 calendar/gui/dialogs/comp-editor-util.c |    1 -
 calendar/gui/e-day-view.c               |    2 ++
 modules/calendar/e-cal-shell-content.c  |    9 +++++++++
 4 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index e849bf2..32bf54e 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -209,7 +209,7 @@ sensitize_items(BonoboUIComponent *uic, struct _sensitize_item *items, guint32 m
 }
 
 static struct _sensitize_item taskpad_sensitize_table[] = {
-	{ "Cut", E_CAL_MENU_SELECT_EDITABLE },
+	{ "Cut", E_CAL_MENU_SELECT_EDITABLE | E_CAL_MENU_SELECT_ANY },
 	{ "Copy", E_CAL_MENU_SELECT_ANY },
 	{ "Paste", E_CAL_MENU_SELECT_EDITABLE },
 	{ "Delete", E_CAL_MENU_SELECT_EDITABLE },
@@ -245,7 +245,7 @@ sensitize_taskpad_commands (GnomeCalendar *gcal, BonoboControl *control, gboolea
 
 	t = e_cal_menu_target_new_select(menu, model, events);
 	if (!enable)
-		t->target.mask = ~0;
+		t->target.mask = ~((~t->target.mask) & E_CAL_MENU_SELECT_EDITABLE);
 
 	sensitize_items(uic, taskpad_sensitize_table, t->target.mask);
 }
diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c
index d8e05ca..6fc05d4 100644
--- a/calendar/gui/dialogs/comp-editor-util.c
+++ b/calendar/gui/dialogs/comp-editor-util.c
@@ -35,7 +35,6 @@
 #include "e-util/e-binding.h"
 #include "widgets/misc/e-dateedit.h"
 #include "../calendar-config.h"
-#include "../e-date-edit-config.h"
 #include "../itip-utils.h"
 #include "comp-editor-util.h"
 
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 75f7f7a..879155f 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -2112,9 +2112,11 @@ e_day_view_remove_event_cb (EDayView *day_view,
 	if (day == E_DAY_VIEW_LONG_EVENT) {
 		g_array_remove_index (day_view->long_events, event_num);
 		day_view->long_events_need_layout = TRUE;
+		gtk_widget_grab_focus (GTK_WIDGET (day_view->top_canvas));
 	} else {
 		g_array_remove_index (day_view->events[day], event_num);
 		day_view->need_layout[day] = TRUE;
+		gtk_widget_grab_focus (GTK_WIDGET (day_view->main_canvas));
 	}
 	return TRUE;
 }
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c
index 7a8e659..4409c1f 100644
--- a/modules/calendar/e-cal-shell-content.c
+++ b/modules/calendar/e-cal-shell-content.c
@@ -177,6 +177,9 @@ cal_shell_content_get_focus_location (ECalShellContent *cal_shell_content)
 		if (GNOME_CANVAS (day_view->main_canvas)->focused_item != NULL)
 			return FOCUS_CALENDAR;
 
+		if (GTK_WIDGET_HAS_FOCUS (day_view))
+			return FOCUS_CALENDAR;
+
 	} else if (E_IS_WEEK_VIEW (calendar_view)) {
 		EWeekView *week_view = E_WEEK_VIEW (calendar_view);
 
@@ -186,12 +189,18 @@ cal_shell_content_get_focus_location (ECalShellContent *cal_shell_content)
 		if (GNOME_CANVAS (week_view->main_canvas)->focused_item != NULL)
 			return FOCUS_CALENDAR;
 
+		if (GTK_WIDGET_HAS_FOCUS (week_view))
+			return FOCUS_CALENDAR;
+
 	} else if (E_IS_CAL_LIST_VIEW (calendar_view)) {
 		ECalListView *list_view = E_CAL_LIST_VIEW (widget);
 
 		table = e_table_scrolled_get_table (list_view->table_scrolled);
 		if (GTK_WIDGET_HAS_FOCUS (table))
 			return FOCUS_CALENDAR;
+
+		if (GTK_WIDGET_HAS_FOCUS (list_view))
+			return FOCUS_CALENDAR;
 	}
 
 	return FOCUS_OTHER;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]