aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-table-group-leaf.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-06-21 22:22:15 +0800
committerMilan Crha <mcrha@redhat.com>2013-06-21 22:22:15 +0800
commit2a3580e43deb40eca14ed7ff16ad5cac6a7a5e2b (patch)
tree402d45d600bd36c44deca42f35340a439b1cef33 /e-util/e-table-group-leaf.c
parent0c18d2e755acbb84f48dd3b4ba783dac047ec4a2 (diff)
downloadgsoc2013-evolution-2a3580e43deb40eca14ed7ff16ad5cac6a7a5e2b.tar
gsoc2013-evolution-2a3580e43deb40eca14ed7ff16ad5cac6a7a5e2b.tar.gz
gsoc2013-evolution-2a3580e43deb40eca14ed7ff16ad5cac6a7a5e2b.tar.bz2
gsoc2013-evolution-2a3580e43deb40eca14ed7ff16ad5cac6a7a5e2b.tar.lz
gsoc2013-evolution-2a3580e43deb40eca14ed7ff16ad5cac6a7a5e2b.tar.xz
gsoc2013-evolution-2a3580e43deb40eca14ed7ff16ad5cac6a7a5e2b.tar.zst
gsoc2013-evolution-2a3580e43deb40eca14ed7ff16ad5cac6a7a5e2b.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 'e-util/e-table-group-leaf.c')
-rw-r--r--e-util/e-table-group-leaf.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/e-util/e-table-group-leaf.c b/e-util/e-table-group-leaf.c
index 8d1a91da69..3f50d00f64 100644
--- a/e-util/e-table-group-leaf.c
+++ b/e-util/e-table-group-leaf.c
@@ -54,10 +54,21 @@ enum {
PROP_CURSOR_MODE,
PROP_LENGTH_THRESHOLD,
PROP_SELECTION_MODEL,
- PROP_UNIFORM_ROW_HEIGHT
+ PROP_UNIFORM_ROW_HEIGHT,
+ PROP_IS_EDITING
};
static void
+etgl_item_is_editing_changed_cb (ETableItem *item,
+ GParamSpec *param,
+ ETableGroupLeaf *etgl)
+{
+ g_return_if_fail (E_IS_TABLE_GROUP_LEAF (etgl));
+
+ g_object_notify (G_OBJECT (etgl), "is-editing");
+}
+
+static void
etgl_dispose (GObject *object)
{
ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object);
@@ -97,6 +108,9 @@ etgl_dispose (GObject *object)
etgl->item,
etgl->etgl_start_drag_id);
+ g_signal_handlers_disconnect_by_func (etgl->item,
+ etgl_item_is_editing_changed_cb, etgl);
+
etgl->etgl_cursor_change_id = 0;
etgl->etgl_cursor_activated_id = 0;
etgl->etgl_double_click_id = 0;
@@ -331,6 +345,9 @@ etgl_realize (GnomeCanvasItem *item)
etgl->item, "start_drag",
G_CALLBACK (etgl_start_drag), etgl);
+ g_signal_connect (etgl->item, "notify::is-editing",
+ G_CALLBACK (etgl_item_is_editing_changed_cb), etgl);
+
e_canvas_item_request_reflow (item);
}
@@ -627,6 +644,10 @@ etgl_get_property (GObject *object,
break;
case PROP_UNIFORM_ROW_HEIGHT:
g_value_set_boolean (value, etgl->uniform_row_height);
+ break;
+ case PROP_IS_EDITING:
+ g_value_set_boolean (value, e_table_group_leaf_is_editing (etgl));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -781,6 +802,11 @@ etgl_class_init (ETableGroupLeafClass *class)
"Uniform row height",
FALSE,
G_PARAM_READWRITE));
+
+ g_object_class_override_property (
+ object_class,
+ PROP_IS_EDITING,
+ "is-editing");
}
static void
@@ -814,3 +840,10 @@ etgl_init (ETableGroupLeaf *etgl)
e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (etgl), etgl_reflow);
}
+gboolean
+e_table_group_leaf_is_editing (ETableGroupLeaf *etgl)
+{
+ g_return_val_if_fail (E_IS_TABLE_GROUP_LEAF (etgl), FALSE);
+
+ return etgl->item && e_table_item_is_editing (etgl->item);
+}