aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-04-08 05:40:49 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-04-08 05:40:49 +0800
commita843a2a4d205ef45d8a5670cf0b17c238cee1f37 (patch)
tree9979d5ade1368251151a2007822e47a9eb8cfe19 /mail
parenta312ad7cf1c2c34577914a2f0f2a5ca191378103 (diff)
downloadgsoc2013-evolution-a843a2a4d205ef45d8a5670cf0b17c238cee1f37.tar
gsoc2013-evolution-a843a2a4d205ef45d8a5670cf0b17c238cee1f37.tar.gz
gsoc2013-evolution-a843a2a4d205ef45d8a5670cf0b17c238cee1f37.tar.bz2
gsoc2013-evolution-a843a2a4d205ef45d8a5670cf0b17c238cee1f37.tar.lz
gsoc2013-evolution-a843a2a4d205ef45d8a5670cf0b17c238cee1f37.tar.xz
gsoc2013-evolution-a843a2a4d205ef45d8a5670cf0b17c238cee1f37.tar.zst
gsoc2013-evolution-a843a2a4d205ef45d8a5670cf0b17c238cee1f37.zip
Attachment rewrite pretty much complete. Just testing now.
svn path=/branches/kill-bonobo/; revision=37504
Diffstat (limited to 'mail')
-rw-r--r--mail/Makefile.am2
-rw-r--r--mail/e-mail-attachment-bar.c12
-rw-r--r--mail/e-mail-attachment-button.c542
-rw-r--r--mail/e-mail-attachment-button.h90
-rw-r--r--mail/em-format-html-display.c27
5 files changed, 25 insertions, 648 deletions
diff --git a/mail/Makefile.am b/mail/Makefile.am
index 82fdf04096..8039bfe52d 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -39,8 +39,6 @@ libevolution_module_mail_la_SOURCES = \
e-attachment-handler-mail.h \
e-mail-attachment-bar.c \
e-mail-attachment-bar.h \
- e-mail-attachment-button.c \
- e-mail-attachment-button.h \
e-mail-browser.c \
e-mail-browser.h \
e-mail-display.c \
diff --git a/mail/e-mail-attachment-bar.c b/mail/e-mail-attachment-bar.c
index 533623e066..5323a7d359 100644
--- a/mail/e-mail-attachment-bar.c
+++ b/mail/e-mail-attachment-bar.c
@@ -420,6 +420,17 @@ mail_attachment_bar_unselect_all (EAttachmentView *view)
}
static void
+mail_attachment_bar_update_actions (EAttachmentView *view)
+{
+ EMailAttachmentBarPrivate *priv;
+
+ priv = E_MAIL_ATTACHMENT_BAR_GET_PRIVATE (view);
+ view = E_ATTACHMENT_VIEW (priv->icon_view);
+
+ e_attachment_view_update_actions (view);
+}
+
+static void
mail_attachment_bar_class_init (EMailAttachmentBarClass *class)
{
GObjectClass *object_class;
@@ -477,6 +488,7 @@ mail_attachment_bar_iface_init (EAttachmentViewIface *iface)
iface->unselect_path = mail_attachment_bar_unselect_path;
iface->select_all = mail_attachment_bar_select_all;
iface->unselect_all = mail_attachment_bar_unselect_all;
+ iface->update_actions = mail_attachment_bar_update_actions;
}
static void
diff --git a/mail/e-mail-attachment-button.c b/mail/e-mail-attachment-button.c
deleted file mode 100644
index 1fe65df3b3..0000000000
--- a/mail/e-mail-attachment-button.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * e-mail-attachment-button.c
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>
- *
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#include "e-mail-attachment-button.h"
-
-#include "e-util/e-binding.h"
-
-#define E_MAIL_ATTACHMENT_BUTTON_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_MAIL_ATTACHMENT_BUTTON, EMailAttachmentButtonPrivate))
-
-struct _EMailAttachmentButtonPrivate {
-
- EAttachmentView *view;
- EAttachment *attachment;
- gulong reference_handler_id;
-
- GtkWidget *inline_button;
- GtkWidget *action_button;
- GtkWidget *cell_view;
-
- guint expandable : 1;
- guint expanded : 1;
-};
-
-enum {
- PROP_0,
- PROP_ATTACHMENT,
- PROP_EXPANDABLE,
- PROP_EXPANDED,
- PROP_VIEW
-};
-
-enum {
- CLICKED,
- LAST_SIGNAL
-};
-
-static gpointer parent_class;
-static gulong signals[LAST_SIGNAL];
-
-static void
-mail_attachment_button_action_clicked_cb (EMailAttachmentButton *button)
-{
-}
-
-static void
-mail_attachment_button_update_cell_view (EMailAttachmentButton *button)
-{
- GtkCellView *cell_view;
- EAttachment *attachment;
- GtkTreeRowReference *reference;
- GtkTreeModel *model = NULL;
- GtkTreePath *path = NULL;
-
- cell_view = GTK_CELL_VIEW (button->priv->cell_view);
-
- attachment = e_mail_attachment_button_get_attachment (button);
- if (attachment == NULL)
- goto exit;
-
- reference = e_attachment_get_reference (attachment);
- if (reference == NULL)
- goto exit;
-
- model = gtk_tree_row_reference_get_model (reference);
- path = gtk_tree_row_reference_get_path (reference);
-
-exit:
- gtk_cell_view_set_model (cell_view, model);
- gtk_cell_view_set_displayed_row (cell_view, path);
-
- if (path != NULL)
- gtk_tree_path_free (path);
-}
-
-static void
-mail_attachment_button_update_pixbufs (EMailAttachmentButton *button)
-{
- GtkCellView *cell_view;
- GtkCellRenderer *renderer;
- GtkIconTheme *icon_theme;
- GdkPixbuf *pixbuf_expander_open;
- GdkPixbuf *pixbuf_expander_closed;
- GList *list;
-
- icon_theme = gtk_icon_theme_get_default ();
-
- /* Grab the first cell renderer. */
- cell_view = GTK_CELL_VIEW (button->priv->cell_view);
- list = gtk_cell_view_get_cell_renderers (cell_view);
- renderer = GTK_CELL_RENDERER (list->data);
- g_list_free (list);
-
- pixbuf_expander_open = gtk_widget_render_icon (
- GTK_WIDGET (button), GTK_STOCK_GO_DOWN,
- GTK_ICON_SIZE_BUTTON, NULL);
-
- pixbuf_expander_closed = gtk_widget_render_icon (
- GTK_WIDGET (button), GTK_STOCK_GO_FORWARD,
- GTK_ICON_SIZE_BUTTON, NULL);
-
- g_object_set (
- renderer,
- "pixbuf-expander-open", pixbuf_expander_open,
- "pixbuf-expander-closed", pixbuf_expander_closed,
- NULL);
-
- g_object_unref (pixbuf_expander_open);
- g_object_unref (pixbuf_expander_closed);
-}
-
-static void
-mail_attachment_button_set_view (EMailAttachmentButton *button,
- EAttachmentView *view)
-{
- g_return_if_fail (button->priv->view == NULL);
-
- button->priv->view = g_object_ref (view);
-}
-
-static void
-mail_attachment_button_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- switch (property_id) {
- case PROP_ATTACHMENT:
- e_mail_attachment_button_set_attachment (
- E_MAIL_ATTACHMENT_BUTTON (object),
- g_value_get_object (value));
- return;
-
- case PROP_EXPANDABLE:
- e_mail_attachment_button_set_expandable (
- E_MAIL_ATTACHMENT_BUTTON (object),
- g_value_get_boolean (value));
- return;
-
- case PROP_EXPANDED:
- e_mail_attachment_button_set_expanded (
- E_MAIL_ATTACHMENT_BUTTON (object),
- g_value_get_boolean (value));
- return;
-
- case PROP_VIEW:
- mail_attachment_button_set_view (
- E_MAIL_ATTACHMENT_BUTTON (object),
- g_value_get_object (value));
- return;
- }
-
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-mail_attachment_button_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- switch (property_id) {
- case PROP_ATTACHMENT:
- g_value_set_object (
- value,
- e_mail_attachment_button_get_attachment (
- E_MAIL_ATTACHMENT_BUTTON (object)));
- return;
-
- case PROP_EXPANDABLE:
- g_value_set_boolean (
- value,
- e_mail_attachment_button_get_expandable (
- E_MAIL_ATTACHMENT_BUTTON (object)));
- return;
-
- case PROP_EXPANDED:
- g_value_set_boolean (
- value,
- e_mail_attachment_button_get_expanded (
- E_MAIL_ATTACHMENT_BUTTON (object)));
- return;
-
- case PROP_VIEW:
- g_value_set_object (
- value,
- e_mail_attachment_button_get_view (
- E_MAIL_ATTACHMENT_BUTTON (object)));
- return;
- }
-
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-mail_attachment_button_dispose (GObject *object)
-{
- EMailAttachmentButtonPrivate *priv;
-
- priv = E_MAIL_ATTACHMENT_BUTTON_GET_PRIVATE (object);
-
- if (priv->view != NULL) {
- g_object_unref (priv->view);
- priv->view = NULL;
- }
-
- if (priv->attachment != NULL) {
- g_signal_handler_disconnect (
- priv->attachment,
- priv->reference_handler_id);
- g_object_unref (priv->attachment);
- priv->attachment = NULL;
- }
-
- if (priv->inline_button != NULL) {
- g_object_unref (priv->inline_button);
- priv->inline_button = NULL;
- }
-
- if (priv->action_button != NULL) {
- g_object_unref (priv->action_button);
- priv->action_button = NULL;
- }
-
- if (priv->cell_view != NULL) {
- g_object_unref (priv->cell_view);
- priv->cell_view = NULL;
- }
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-mail_attachment_button_style_set (GtkWidget *widget,
- GtkStyle *previous_style)
-{
- EMailAttachmentButton *button;
-
- /* Chain up to parent's style_set() method. */
- GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style);
-
- button = E_MAIL_ATTACHMENT_BUTTON (widget);
- mail_attachment_button_update_pixbufs (button);
-}
-
-static void
-mail_attachment_button_class_init (EMailAttachmentButtonClass *class)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- parent_class = g_type_class_peek_parent (class);
- g_type_class_add_private (class, sizeof (EMailAttachmentButtonPrivate));
-
- object_class = G_OBJECT_CLASS (class);
- object_class->set_property = mail_attachment_button_set_property;
- object_class->get_property = mail_attachment_button_get_property;
- object_class->dispose = mail_attachment_button_dispose;
-
- widget_class = GTK_WIDGET_CLASS (class);
- widget_class->style_set = mail_attachment_button_style_set;
-
- g_object_class_install_property (
- object_class,
- PROP_ATTACHMENT,
- g_param_spec_object (
- "attachment",
- "Attachment",
- NULL,
- E_TYPE_ATTACHMENT,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (
- object_class,
- PROP_EXPANDABLE,
- g_param_spec_boolean (
- "expandable",
- "Expandable",
- NULL,
- TRUE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT));
-
- g_object_class_install_property (
- object_class,
- PROP_EXPANDED,
- g_param_spec_boolean (
- "expanded",
- "Expanded",
- NULL,
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT));
-
- g_object_class_install_property (
- object_class,
- PROP_VIEW,
- g_param_spec_object (
- "view",
- "View",
- NULL,
- E_TYPE_ATTACHMENT_VIEW,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
-
- signals[CLICKED] = g_signal_new (
- "clicked",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (EMailAttachmentButtonClass, clicked),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-}
-
-static void
-mail_attachment_button_init (EMailAttachmentButton *button)
-{
- GtkCellRenderer *renderer;
- GtkCellLayout *cell_layout;
- GtkWidget *container;
- GtkWidget *widget;
-
- button->priv = E_MAIL_ATTACHMENT_BUTTON_GET_PRIVATE (button);
-
- /* Configure Widgets */
-
- container = GTK_WIDGET (button);
-
- widget = gtk_button_new ();
- gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
- button->priv->inline_button = g_object_ref (widget);
- gtk_widget_show (widget);
-
- e_binding_new (
- G_OBJECT (button), "expandable",
- G_OBJECT (widget), "sensitive");
-
- widget = gtk_button_new ();
- gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
- button->priv->action_button = g_object_ref (widget);
- gtk_widget_show (widget);
-
- container = button->priv->inline_button;
-
- widget = gtk_cell_view_new ();
- gtk_container_add (GTK_CONTAINER (container), widget);
- button->priv->cell_view = g_object_ref (widget);
- gtk_widget_show (widget);
-
- container = button->priv->action_button;
-
- widget = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (container), widget);
- gtk_widget_show (widget);
-
- /* Configure Renderers */
-
- cell_layout = GTK_CELL_LAYOUT (button->priv->cell_view);
-
- renderer = gtk_cell_renderer_pixbuf_new ();
- g_object_set (renderer, "is-expander", TRUE, NULL);
- gtk_cell_layout_pack_start (cell_layout, renderer, FALSE);
-
- e_mutual_binding_new (
- G_OBJECT (button), "expanded",
- G_OBJECT (renderer), "is-expanded");
-
- renderer = gtk_cell_renderer_pixbuf_new ();
- g_object_set (renderer, "stock-size", GTK_ICON_SIZE_BUTTON, NULL);
- gtk_cell_layout_pack_start (cell_layout, renderer, FALSE);
-
- gtk_cell_layout_add_attribute (
- cell_layout, renderer, "gicon",
- E_ATTACHMENT_STORE_COLUMN_ICON);
-
- /* Configure Signal Handlers */
-
- g_signal_connect_swapped (
- button->priv->action_button, "clicked",
- G_CALLBACK (mail_attachment_button_action_clicked_cb), button);
-
- g_signal_connect_swapped (
- button->priv->inline_button, "clicked",
- G_CALLBACK (e_mail_attachment_button_clicked), button);
-}
-
-GType
-e_mail_attachment_button_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EMailAttachmentButtonClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) mail_attachment_button_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EMailAttachmentButton),
- 0, /* n_preallocs */
- (GInstanceInitFunc) mail_attachment_button_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GTK_TYPE_HBOX, "EMailAttachmentButton", &type_info, 0);
- }
-
- return type;
-}
-
-GtkWidget *
-e_mail_attachment_button_new (EAttachmentView *view)
-{
- g_return_val_if_fail (E_IS_ATTACHMENT_VIEW (view), NULL);
-
- return g_object_new (
- E_TYPE_MAIL_ATTACHMENT_BUTTON,
- "view", view, NULL);
-}
-
-EAttachmentView *
-e_mail_attachment_button_get_view (EMailAttachmentButton *button)
-{
- g_return_val_if_fail (E_IS_MAIL_ATTACHMENT_BUTTON (button), NULL);
-
- return button->priv->view;
-}
-
-EAttachment *
-e_mail_attachment_button_get_attachment (EMailAttachmentButton *button)
-{
- g_return_val_if_fail (E_IS_MAIL_ATTACHMENT_BUTTON (button), NULL);
-
- return button->priv->attachment;
-}
-
-void
-e_mail_attachment_button_set_attachment (EMailAttachmentButton *button,
- EAttachment *attachment)
-{
- g_return_if_fail (E_IS_MAIL_ATTACHMENT_BUTTON (button));
-
- if (attachment != NULL) {
- g_return_if_fail (E_IS_ATTACHMENT (attachment));
- g_object_ref (attachment);
- }
-
- if (button->priv->attachment != NULL) {
- g_signal_handler_disconnect (
- button->priv->attachment,
- button->priv->reference_handler_id);
- g_object_unref (button->priv->attachment);
- }
-
- button->priv->attachment = attachment;
-
- if (attachment != NULL) {
- gulong handler_id;
-
- handler_id = g_signal_connect_swapped (
- attachment, "notify::reference",
- G_CALLBACK (mail_attachment_button_update_cell_view),
- button);
- mail_attachment_button_update_cell_view (button);
- mail_attachment_button_update_pixbufs (button);
- button->priv->reference_handler_id = handler_id;
- }
-
- g_object_notify (G_OBJECT (button), "attachment");
-}
-
-gboolean
-e_mail_attachment_button_get_expandable (EMailAttachmentButton *button)
-{
- g_return_val_if_fail (E_IS_MAIL_ATTACHMENT_BUTTON (button), FALSE);
-
- return button->priv->expandable;
-}
-
-void
-e_mail_attachment_button_set_expandable (EMailAttachmentButton *button,
- gboolean expandable)
-{
- g_return_if_fail (E_IS_MAIL_ATTACHMENT_BUTTON (button));
-
- button->priv->expandable = expandable;
-
- if (!expandable)
- e_mail_attachment_button_set_expanded (button, FALSE);
-
- g_object_notify (G_OBJECT (button), "expandable");
-}
-
-gboolean
-e_mail_attachment_button_get_expanded (EMailAttachmentButton *button)
-{
- g_return_val_if_fail (E_IS_MAIL_ATTACHMENT_BUTTON (button), FALSE);
-
- return button->priv->expanded;
-}
-
-void
-e_mail_attachment_button_set_expanded (EMailAttachmentButton *button,
- gboolean expanded)
-{
- g_return_if_fail (E_IS_MAIL_ATTACHMENT_BUTTON (button));
-
- button->priv->expanded = expanded;
-
- g_object_notify (G_OBJECT (button), "expanded");
-}
-
-void
-e_mail_attachment_button_clicked (EMailAttachmentButton *button)
-{
- g_return_if_fail (E_IS_MAIL_ATTACHMENT_BUTTON (button));
-
- g_signal_emit (button, signals[CLICKED], 0);
-}
diff --git a/mail/e-mail-attachment-button.h b/mail/e-mail-attachment-button.h
deleted file mode 100644
index 26ec5cf0d6..0000000000
--- a/mail/e-mail-attachment-button.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * e-mail-attachment-button.h
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the program; if not, see <http://www.gnu.org/licenses/>
- *
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef E_MAIL_ATTACHMENT_BUTTON_H
-#define E_MAIL_ATTACHMENT_BUTTON_H
-
-#include <gtk/gtk.h>
-#include <widgets/misc/e-attachment.h>
-#include <widgets/misc/e-attachment-view.h>
-
-/* Standard GObject macros */
-#define E_TYPE_MAIL_ATTACHMENT_BUTTON \
- (e_mail_attachment_button_get_type ())
-#define E_MAIL_ATTACHMENT_BUTTON(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST \
- ((obj), E_TYPE_MAIL_ATTACHMENT_BUTTON, EMailAttachmentButton))
-#define E_MAIL_ATTACHMENT_BUTTON_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_CAST \
- ((cls), E_TYPE_MAIL_ATTACHMENT_BUTTON, EMailAttachmentButtonClass))
-#define E_IS_MAIL_ATTACHMENT_BUTTON(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE \
- ((obj), E_TYPE_MAIL_ATTACHMENT_BUTTON))
-#define E_IS_MAIL_ATTACHMENT_BUTTON_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_TYPE \
- ((cls), E_TYPE_MAIL_ATTACHMENT_BUTTON))
-#define E_MAIL_ATTACHMENT_BUTTON_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS \
- ((obj), E_TYPE_MAIL_ATTACHMENT_BUTTON, EMailAttachmentButtonClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EMailAttachmentButton EMailAttachmentButton;
-typedef struct _EMailAttachmentButtonClass EMailAttachmentButtonClass;
-typedef struct _EMailAttachmentButtonPrivate EMailAttachmentButtonPrivate;
-
-struct _EMailAttachmentButton {
- GtkHBox parent;
- EMailAttachmentButtonPrivate *priv;
-};
-
-struct _EMailAttachmentButtonClass {
- GtkHBoxClass parent_class;
-
- /* Signals */
- void (*clicked) (EMailAttachmentButton *button);
-};
-
-GType e_mail_attachment_button_get_type (void);
-GtkWidget * e_mail_attachment_button_new (EAttachmentView *view);
-void e_mail_attachment_button_clicked(EMailAttachmentButton *button);
-EAttachmentView *
- e_mail_attachment_button_get_view
- (EMailAttachmentButton *button);
-EAttachment * e_mail_attachment_button_get_attachment
- (EMailAttachmentButton *button);
-void e_mail_attachment_button_set_attachment
- (EMailAttachmentButton *button,
- EAttachment *attachment);
-gboolean e_mail_attachment_button_get_expandable
- (EMailAttachmentButton *button);
-void e_mail_attachment_button_set_expandable
- (EMailAttachmentButton *button,
- gboolean expandable);
-gboolean e_mail_attachment_button_get_expanded
- (EMailAttachmentButton *button);
-void e_mail_attachment_button_set_expanded
- (EMailAttachmentButton *button,
- gboolean expanded);
-
-G_END_DECLS
-
-#endif /* E_MAIL_ATTACHMENT_BUTTON_H */
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 5faa671fd8..de965135c8 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -75,11 +75,11 @@
#include "e-mail-display.h"
#include "e-mail-attachment-bar.h"
-#include "e-mail-attachment-button.h"
#include "em-format-html-display.h"
#include "em-icon-stream.h"
#include "em-utils.h"
#include "em-popup.h"
+#include "widgets/misc/e-attachment-button.h"
#include "widgets/misc/e-attachment-view.h"
#ifdef G_OS_WIN32
@@ -855,8 +855,9 @@ efhd_attachment_show(EPopup *ep, EPopupItem *item, void *data)
}
static void
-efhd_attachment_button_clicked (GtkWidget *widget,
- struct _attach_puri *info)
+efhd_attachment_button_expanded (GtkWidget *widget,
+ GParamSpec *pspec,
+ struct _attach_puri *info)
{
if (!efhd_can_process_attachment (widget))
return;
@@ -1242,21 +1243,21 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje
info->attachment, (GAsyncReadyCallback)
e_attachment_load_handle_error, parent);
- widget = e_mail_attachment_button_new (view);
- e_mail_attachment_button_set_attachment (
- E_MAIL_ATTACHMENT_BUTTON (widget), attachment);
- e_mail_attachment_button_set_expandable (
- E_MAIL_ATTACHMENT_BUTTON (widget), (info->handle != NULL));
- e_mail_attachment_button_set_expanded (
- E_MAIL_ATTACHMENT_BUTTON (widget), info->shown);
+ widget = e_attachment_button_new (view);
+ e_attachment_button_set_attachment (
+ E_ATTACHMENT_BUTTON (widget), attachment);
+ e_attachment_button_set_expandable (
+ E_ATTACHMENT_BUTTON (widget), (info->handle != NULL));
+ e_attachment_button_set_expanded (
+ E_ATTACHMENT_BUTTON (widget), info->shown);
gtk_container_add (GTK_CONTAINER (eb), widget);
gtk_widget_show (widget);
g_object_set_data (G_OBJECT (widget), "efh", efh);
g_signal_connect (
- widget, "clicked",
- G_CALLBACK (efhd_attachment_button_clicked), info);
+ widget, "notify::expanded",
+ G_CALLBACK (efhd_attachment_button_expanded), info);
#if 0
/* FIXME: offline parts, just get icon */
@@ -1294,8 +1295,6 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje
return TRUE;
}
-/* not used currently */
-/* frame source callback */
static void
efhd_attachment_frame (EMFormat *emf,
CamelStream *stream,