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. --- mail/e-mail-attachment-bar.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'mail/e-mail-attachment-bar.c') diff --git a/mail/e-mail-attachment-bar.c b/mail/e-mail-attachment-bar.c index c791b5fba3..b5a82dbcc1 100644 --- a/mail/e-mail-attachment-bar.c +++ b/mail/e-mail-attachment-bar.c @@ -57,6 +57,7 @@ struct _EMailAttachmentBarPrivate { enum { PROP_0, PROP_ACTIVE_VIEW, + PROP_DRAGGING, PROP_EDITABLE, PROP_EXPANDED }; @@ -120,6 +121,12 @@ mail_attachment_bar_set_property (GObject *object, g_value_get_int (value)); return; + 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), @@ -150,6 +157,13 @@ mail_attachment_bar_get_property (GObject *object, E_MAIL_ATTACHMENT_BAR (object))); return; + 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, @@ -256,6 +270,14 @@ mail_attachment_bar_constructed (GObject *object) object, "active-view", priv->combo_box, "active"); + e_mutual_binding_new ( + object, "dragging", + priv->icon_view, "dragging"); + + e_mutual_binding_new ( + object, "dragging", + priv->tree_view, "dragging"); + e_mutual_binding_new ( object, "editable", priv->icon_view, "editable"); @@ -459,6 +481,9 @@ mail_attachment_bar_class_init (EMailAttachmentBarClass *class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_object_class_override_property ( + object_class, PROP_DRAGGING, "dragging"); + g_object_class_override_property ( object_class, PROP_EDITABLE, "editable"); } -- cgit v1.2.3