From 4032075425d7251642e3f81b9c4732e9a2a23e85 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 13 Aug 2010 08:09:37 -0400 Subject: Bug 624913 - Disallow drag-and-drop within the same attachment bar Adds a boolean "dragging" property to the EAttachmentView interface, which becomes TRUE when the user start a drag from the attachment view. e_attachment_view_drag_motion() and e_attachment_view_drag_drop() both return FALSE when this property is set. Also, do not register the entire EMsgComposer window as a drag destination. Just intercept drag signals from the GtkHTML widget. Requires gtkhtml commit 344eb5e to fully work correctly. --- widgets/misc/e-attachment-tree-view.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'widgets/misc/e-attachment-tree-view.c') diff --git a/widgets/misc/e-attachment-tree-view.c b/widgets/misc/e-attachment-tree-view.c index 09602ca186..8e597adebb 100644 --- a/widgets/misc/e-attachment-tree-view.c +++ b/widgets/misc/e-attachment-tree-view.c @@ -37,6 +37,7 @@ struct _EAttachmentTreeViewPrivate { enum { PROP_0, + PROP_DRAGGING, PROP_EDITABLE }; @@ -49,6 +50,12 @@ attachment_tree_view_set_property (GObject *object, GParamSpec *pspec) { switch (property_id) { + case PROP_DRAGGING: + e_attachment_view_set_dragging ( + E_ATTACHMENT_VIEW (object), + g_value_get_boolean (value)); + return; + case PROP_EDITABLE: e_attachment_view_set_editable ( E_ATTACHMENT_VIEW (object), @@ -66,6 +73,12 @@ attachment_tree_view_get_property (GObject *object, GParamSpec *pspec) { switch (property_id) { + case PROP_DRAGGING: + g_value_set_boolean ( + value, e_attachment_view_get_dragging ( + E_ATTACHMENT_VIEW (object))); + return; + case PROP_EDITABLE: g_value_set_boolean ( value, e_attachment_view_get_editable ( @@ -467,6 +480,9 @@ attachment_tree_view_class_init (EAttachmentTreeViewClass *class) tree_view_class = GTK_TREE_VIEW_CLASS (class); tree_view_class->row_activated = attachment_tree_view_row_activated; + g_object_class_override_property ( + object_class, PROP_DRAGGING, "dragging"); + g_object_class_override_property ( object_class, PROP_EDITABLE, "editable"); } -- cgit v1.2.3