diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-05-17 21:49:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-05-17 21:49:21 +0800 |
commit | ea1a5fca456b891f8bb9ab248ad65651b66b54b2 (patch) | |
tree | 9619f2f9631aac471da3f8b24dd30908335627c9 /widgets/misc | |
parent | c20b1701e81473504f1d67f6e7387a6f1e5fb856 (diff) | |
parent | 99ebc23e0860ef5baf1f169803d751db70e2aa32 (diff) | |
download | gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.gz gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.bz2 gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.lz gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.xz gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.tar.zst gsoc2013-evolution-ea1a5fca456b891f8bb9ab248ad65651b66b54b2.zip |
Merge branch 'gnome-2-30' into express2
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/e-attachment-tree-view.c | 7 | ||||
-rw-r--r-- | widgets/misc/e-attachment-view.c | 19 |
2 files changed, 19 insertions, 7 deletions
diff --git a/widgets/misc/e-attachment-tree-view.c b/widgets/misc/e-attachment-tree-view.c index 42876e4bfb..5729a68069 100644 --- a/widgets/misc/e-attachment-tree-view.c +++ b/widgets/misc/e-attachment-tree-view.c @@ -100,15 +100,18 @@ attachment_tree_view_render_size (GtkTreeViewColumn *column, GtkTreeModel *model, GtkTreeIter *iter) { - gchar *display_size; + gchar *display_size = NULL; gint column_id; guint64 size; column_id = E_ATTACHMENT_STORE_COLUMN_SIZE; gtk_tree_model_get (model, iter, column_id, &size, -1); - display_size = g_format_size_for_display ((goffset) size); + if (size > 0) + display_size = g_format_size_for_display ((goffset) size); + g_object_set (renderer, "text", display_size, NULL); + g_free (display_size); } diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c index 9725604865..5a5db57e07 100644 --- a/widgets/misc/e-attachment-view.c +++ b/widgets/misc/e-attachment-view.c @@ -826,7 +826,6 @@ e_attachment_view_init (EAttachmentView *view) attachment_view_init_handlers (view); e_attachment_view_drag_source_set (view); - e_attachment_view_drag_dest_set (view); /* Connect built-in drag and drop handlers. */ @@ -927,6 +926,11 @@ e_attachment_view_set_editable (EAttachmentView *view, priv = e_attachment_view_get_private (view); priv->editable = editable; + if (editable) + e_attachment_view_drag_dest_set (view); + else + e_attachment_view_drag_dest_unset (view); + g_object_notify (G_OBJECT (view), "editable"); } @@ -1315,6 +1319,11 @@ e_attachment_view_drag_begin (EAttachmentView *view, { g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + + /* Prevent the user from dragging and dropping to + * the same attachment view, which would duplicate + * the attachment. */ + e_attachment_view_drag_dest_unset (view); } void @@ -1323,6 +1332,10 @@ e_attachment_view_drag_end (EAttachmentView *view, { g_return_if_fail (E_IS_ATTACHMENT_VIEW (view)); g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + + /* Restore the previous drag destination state. */ + if (e_attachment_view_get_editable (view)) + e_attachment_view_drag_dest_set (view); } static void @@ -1465,10 +1478,6 @@ e_attachment_view_drag_drop (EAttachmentView *view, g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), FALSE); g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), FALSE); - /* Disallow drops if we're not editable. */ - if (!e_attachment_view_get_editable (view)) - return FALSE; - return TRUE; } |