aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-06-21 21:56:34 +0800
committerMilan Crha <mcrha@redhat.com>2013-06-21 21:56:34 +0800
commit4a101290fdb546296f7bc0a9a34ba342e741895a (patch)
tree3a5cecac900e672a87f2865a8288f30dbeea4c34 /calendar/gui/e-day-view.c
parent97c70105b71adc9b7cb9f4db15bf44f98133a82c (diff)
downloadgsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.gz
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.bz2
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.lz
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.xz
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.tar.zst
gsoc2013-evolution-4a101290fdb546296f7bc0a9a34ba342e741895a.zip
Calendar views inline text edit with Ctrl+C/V/X does not work
The shortcuts Ctrl+C/V/X are used for whole calendar items copy/paste/cut, not for text when editing event details inline, either in a day/week view or in a list view. By tracking the is-editing property of respective cell editor and using it when enabling/disabling clipboard actions makes the respective text operations work as expected.
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 541b62ac20..6dae27fa18 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -434,7 +434,8 @@ enum {
PROP_0,
PROP_MARCUS_BAINS_SHOW_LINE,
PROP_MARCUS_BAINS_DAY_VIEW_COLOR,
- PROP_MARCUS_BAINS_TIME_BAR_COLOR
+ PROP_MARCUS_BAINS_TIME_BAR_COLOR,
+ PROP_IS_EDITING
};
G_DEFINE_TYPE (EDayView, e_day_view, E_TYPE_CALENDAR_VIEW)
@@ -755,6 +756,10 @@ day_view_get_property (GObject *object,
e_day_view_marcus_bains_get_time_bar_color (
E_DAY_VIEW (object)));
return;
+
+ case PROP_IS_EDITING:
+ g_value_set_boolean (value, e_day_view_is_editing (E_DAY_VIEW (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -1595,6 +1600,11 @@ e_day_view_class_init (EDayViewClass *class)
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
+ g_object_class_override_property (
+ object_class,
+ PROP_IS_EDITING,
+ "is-editing");
+
/* init the accessibility support for e_day_view */
e_day_view_a11y_init ();
}
@@ -2570,6 +2580,7 @@ e_day_view_remove_event_cb (EDayView *day_view,
if (day_view->editing_event_num == event_num && day_view->editing_event_day == day) {
day_view->editing_event_num = -1;
day_view->editing_event_day = -1;
+ g_object_notify (G_OBJECT (day_view), "is-editing");
}
if (day_view->popup_event_num == event_num && day_view->popup_event_day == day) {
@@ -4920,6 +4931,7 @@ static void
e_day_view_free_events (EDayView *day_view)
{
gint day;
+ gboolean did_editing = day_view->editing_event_day != -1;
/* Reset all our indices. */
day_view->editing_event_day = -1;
@@ -4935,6 +4947,9 @@ e_day_view_free_events (EDayView *day_view)
for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++)
e_day_view_free_event_array (day_view, day_view->events[day]);
+
+ if (did_editing)
+ g_object_notify (G_OBJECT (day_view), "is-editing");
}
static void
@@ -7066,6 +7081,8 @@ e_day_view_on_editing_started (EDayView *day_view,
}
g_signal_emit_by_name (day_view, "selection_changed");
+
+ g_object_notify (G_OBJECT (day_view), "is-editing");
}
static void
@@ -7259,6 +7276,8 @@ e_day_view_on_editing_stopped (EDayView *day_view,
g_free (text);
g_signal_emit_by_name (day_view, "selection_changed");
+
+ g_object_notify (G_OBJECT (day_view), "is-editing");
}
/* FIXME: It is possible that we may produce an invalid time due to daylight
@@ -8894,3 +8913,10 @@ e_day_view_get_num_events_selected (EDayView *day_view)
return (day_view->editing_event_day != -1) ? 1 : 0;
}
+gboolean
+e_day_view_is_editing (EDayView *day_view)
+{
+ g_return_val_if_fail (E_IS_DAY_VIEW (day_view), FALSE);
+
+ return day_view->editing_event_day != -1;
+}