+2007-06-14 Armin Burgmeier <armin@openismus.com>
+
+ * src/widgets/modest-attachments-view.h:
+ * src/widgets/modest-attachments-view.c: Added
+ modest_attachments_view_has_attachments() and fixed coordinate
+ transformation in get_att_view_at_coords(). This fixes attachment
+ selection.
+
+ * src/widgets/modest-msg-view.c: Make use of
+ modest_attachments_view_has_attachments() to decide whether to show
+ attachments in the header.
+
2007-06-14 Johannes Schmid <johannes.schmid@openismus.com>
* src/maemo/modest-connection-specific-smtp-edit-window.c:
w = att_view->allocation.width;
h = att_view->allocation.height;
- int_x = (gint) x;
- int_y = (gint) y;
+ int_x = (gint) x - GTK_WIDGET (atts_view)->allocation.x;
+ int_y = (gint) y - GTK_WIDGET (atts_view)->allocation.y;
if ((x >= pos_x) && (x <= (pos_x + w)) && (y >= pos_y) && (y <= (pos_y + h))) {
result = att_view;
own_clipboard (atts_view);
}
+gboolean
+modest_attachments_view_has_attachments (ModestAttachmentsView *atts_view)
+{
+ ModestAttachmentsViewPrivate *priv;
+ GList *children;
+ gboolean result;
+
+ g_return_val_if_fail (MODEST_IS_ATTACHMENTS_VIEW (atts_view), FALSE);
+ priv = MODEST_ATTACHMENTS_VIEW_GET_PRIVATE (atts_view);
+
+ children = gtk_container_get_children (GTK_CONTAINER (priv->box));
+ result = (children != NULL);
+ g_list_free (children);
+
+ return result;
+}
+
static void
own_clipboard (ModestAttachmentsView *atts_view)
{
GList *modest_attachments_view_get_selection (ModestAttachmentsView *attachments_view);
void modest_attachments_view_select_all (ModestAttachmentsView *attachments_view);
+gboolean modest_attachments_view_has_attachments (ModestAttachmentsView *attachments_view);
G_END_DECLS
body = modest_tny_msg_find_body_part (msg,TRUE);
if (body) {
- GList *att_children;
if (tny_mime_part_content_type_is (body, "text/html"))
set_html_message (self, body, msg);
else
set_text_message (self, body, msg);
- att_children = gtk_container_get_children (GTK_CONTAINER (priv->attachments_view));
- if (att_children != NULL) {
+ if(modest_attachments_view_has_attachments (MODEST_ATTACHMENTS_VIEW (priv->attachments_view))) {
gtk_widget_show_all (priv->attachments_box);
- g_list_free (att_children);
} else {
gtk_widget_hide_all (priv->attachments_box);
}