aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-04-10 19:05:55 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-04-10 19:05:55 +0800
commit1509a85170184895f6c91f9c57167a74af5cd2db (patch)
tree77e1afcbbe5b42b425619092f1609cbe529b1d0e /mail
parentc2282f18c4592e4c911d893290e14a5fcd4fb3b3 (diff)
downloadgsoc2013-evolution-1509a85170184895f6c91f9c57167a74af5cd2db.tar
gsoc2013-evolution-1509a85170184895f6c91f9c57167a74af5cd2db.tar.gz
gsoc2013-evolution-1509a85170184895f6c91f9c57167a74af5cd2db.tar.bz2
gsoc2013-evolution-1509a85170184895f6c91f9c57167a74af5cd2db.tar.lz
gsoc2013-evolution-1509a85170184895f6c91f9c57167a74af5cd2db.tar.xz
gsoc2013-evolution-1509a85170184895f6c91f9c57167a74af5cd2db.tar.zst
gsoc2013-evolution-1509a85170184895f6c91f9c57167a74af5cd2db.zip
Convert "import-ics-attachments" plugin to an EAttachmentHandler subclass.
svn path=/branches/kill-bonobo/; revision=37510
Diffstat (limited to 'mail')
-rw-r--r--mail/em-format-html-display.c46
-rw-r--r--mail/em-popup.c16
-rw-r--r--mail/em-popup.h33
3 files changed, 1 insertions, 94 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index de965135c8..d413133c3d 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -462,7 +462,7 @@ efhd_format_attachment (EMFormat *emf,
info->encrypt = emf->valid->encrypt.status;
}
- camel_stream_write_string(
+ camel_stream_write_string (
stream, EM_FORMAT_HTML_VPAD
"<table cellspacing=0 cellpadding=0><tr><td>"
"<table width=10 cellspacing=0 cellpadding=0>"
@@ -1202,14 +1202,6 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje
{
EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)efh;
struct _attach_puri *info;
- GtkWidget *hbox, *w, *button, *mainbox;
- char *simple_type;
- GtkTargetEntry drag_types[] = {
- { NULL, 0, 0 },
- { "text/uri-list", 0, 1 },
- };
- AtkObject *a11y;
-
EAttachmentView *view;
EAttachmentStore *store;
EAttachment *attachment;
@@ -1259,39 +1251,6 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje
widget, "notify::expanded",
G_CALLBACK (efhd_attachment_button_expanded), info);
-#if 0
- /* FIXME: offline parts, just get icon */
- if (camel_content_type_is(((CamelDataWrapper *)pobject->part)->mime_type, "image", "*")) {
- EMFormatHTMLJob *job;
- GdkPixbuf *mini;
- char *key;
-
- key = pobject->classid;
- mini = em_icon_stream_get_image(key, 24, 24);
- if (mini) {
- d(printf("got image from cache '%s'\n", key));
- gtk_image_set_from_pixbuf((GtkImage *)w, mini);
- g_object_unref(mini);
- } else {
- d(printf("need to create icon image '%s'\n", key));
- job = em_format_html_job_new(efh, efhd_write_icon_job, pobject);
- job->stream = (CamelStream *)em_icon_stream_new((GtkImage *)w, key, 24, 24, FALSE);
- em_format_html_job_queue(efh, job);
- }
- }
-
- drag_types[0].target = simple_type;
- gtk_drag_source_set(button, GDK_BUTTON1_MASK, drag_types, sizeof(drag_types)/sizeof(drag_types[0]), GDK_ACTION_COPY);
- g_signal_connect(button, "drag-data-get", G_CALLBACK(efhd_drag_data_get), pobject);
- g_signal_connect (button, "drag-data-delete", G_CALLBACK(efhd_drag_data_delete), pobject);
- g_free(simple_type);
-
- g_signal_connect(button, "button_press_event", G_CALLBACK(efhd_attachment_popup), info);
- g_signal_connect(button, "popup_menu", G_CALLBACK(efhd_attachment_popup_menu), info);
- g_signal_connect(button, "clicked", G_CALLBACK(efhd_attachment_popup_menu), info);
- gtk_box_pack_start((GtkBox *)mainbox, button, TRUE, TRUE, 0);
-#endif
-
return TRUE;
}
@@ -1356,11 +1315,8 @@ efhd_message_add_bar (EMFormat *emf,
CamelMimePart *part,
const EMFormatHandler *info)
{
- EMFormatHTMLDisplayPrivate *priv;
const char *classid = "attachment-bar";
- priv = EM_FORMAT_HTML_DISPLAY_GET_PRIVATE (emf);
-
em_format_html_add_pobject (
EM_FORMAT_HTML (emf),
sizeof (EMFormatHTMLPObject),
diff --git a/mail/em-popup.c b/mail/em-popup.c
index e57b1de7f8..914b9840b5 100644
--- a/mail/em-popup.c
+++ b/mail/em-popup.c
@@ -98,12 +98,6 @@ emp_target_free(EPopup *ep, EPopupTarget *t)
g_free(s->uri);
break; }
- case EM_POPUP_TARGET_ATTACHMENTS: {
- EMPopupTargetAttachments *s = (EMPopupTargetAttachments *)t;
-
- g_slist_foreach(s->attachments, (GFunc)g_object_unref, NULL);
- g_slist_free(s->attachments);
- break; }
}
((EPopupClass *)emp_parent)->target_free(ep, t);
@@ -434,21 +428,11 @@ static const EPopupHookTargetMask emph_folder_masks[] = {
{ NULL }
};
-static const EPopupHookTargetMask emph_attachments_masks[] = {
- { "one", EM_POPUP_ATTACHMENTS_ONE },
- { "many", EM_POPUP_ATTACHMENTS_MANY },
- { "multiple", EM_POPUP_ATTACHMENTS_MULTIPLE },
- { "image", EM_POPUP_ATTACHMENTS_IMAGE },
- { "message", EM_POPUP_ATTACHMENTS_MESSAGE },
- { NULL }
-};
-
static const EPopupHookTargetMap emph_targets[] = {
{ "select", EM_POPUP_TARGET_SELECT, emph_select_masks },
{ "uri", EM_POPUP_TARGET_URI, emph_uri_masks },
{ "part", EM_POPUP_TARGET_PART, emph_part_masks },
{ "folder", EM_POPUP_TARGET_FOLDER, emph_folder_masks },
- { "attachments", EM_POPUP_TARGET_ATTACHMENTS, emph_attachments_masks },
{ NULL }
};
diff --git a/mail/em-popup.h b/mail/em-popup.h
index fbe41a310a..4d075ec9f7 100644
--- a/mail/em-popup.h
+++ b/mail/em-popup.h
@@ -43,7 +43,6 @@ typedef struct _EMPopupClass EMPopupClass;
* @EM_POPUP_TARGET_URI: A URI.
* @EM_POPUP_TARGET_PART: A CamelMimePart message part.
* @EM_POPUP_TARGET_FOLDER: A folder URI.
- * @EM_POPUP_TARGET_ATTACHMENTS: A list of attachments.
*
* Defines the value of the targetid for all EMPopup target types.
**/
@@ -52,7 +51,6 @@ enum _em_popup_target_t {
EM_POPUP_TARGET_URI,
EM_POPUP_TARGET_PART,
EM_POPUP_TARGET_FOLDER,
- EM_POPUP_TARGET_ATTACHMENTS,
};
/**
@@ -158,26 +156,10 @@ enum _em_popup_target_folder_t {
EM_POPUP_FOLDER_NONSTATIC = 1<<6, /* Except static folders like Outbox.*/
};
-/**
- * enum _em_popup_target_attachments_t - EMPopupTargetAttachments qualifiers.
- *
- * @EM_POPUP_ATTACHMENTS_ONE: There is one and only one attachment selected.
- * @EM_POPUP_ATTACHMENTS_MANY: There is one or more attachments selected.
- *
- **/
-enum _em_popup_target_attachments_t {
- EM_POPUP_ATTACHMENTS_ONE = 1<<0, /* only 1 selected */
- EM_POPUP_ATTACHMENTS_MANY = 1<<1, /* one or more selected */
- EM_POPUP_ATTACHMENTS_MULTIPLE = 1<<2, /* More than 1 selected */
- EM_POPUP_ATTACHMENTS_IMAGE = 1<<3, /* Image selected */
- EM_POPUP_ATTACHMENTS_MESSAGE = 1<<4 /* Message selected */
-};
-
typedef struct _EMPopupTargetSelect EMPopupTargetSelect;
typedef struct _EMPopupTargetURI EMPopupTargetURI;
typedef struct _EMPopupTargetPart EMPopupTargetPart;
typedef struct _EMPopupTargetFolder EMPopupTargetFolder;
-typedef struct _EMPopupTargetAttachments EMPopupTargetAttachments;
/**
* struct _EMPopupTargetURI - An inline URI.
@@ -241,20 +223,6 @@ struct _EMPopupTargetFolder {
char *uri;
};
-/**
- * struct _EMPopupTargetAttachments - A list of composer attachments.
- *
- * @target: Superclass.
- * @attachments: A GSList list of EMsgComposer attachments.
- *
- * This target is used to represent a selected list of attachments in
- * the message composer attachment area.
- **/
-struct _EMPopupTargetAttachments {
- EPopupTarget target;
- GSList *attachments;
-};
-
typedef struct _EPopupItem EMPopupItem;
/* The object */
@@ -276,7 +244,6 @@ EMPopupTargetURI *em_popup_target_new_uri(EMPopup *emp, const char *uri);
EMPopupTargetSelect *em_popup_target_new_select(EMPopup *emp, struct _CamelFolder *folder, const char *folder_uri, GPtrArray *uids);
EMPopupTargetPart *em_popup_target_new_part(EMPopup *emp, struct _CamelMimePart *part, const char *mime_type);
EMPopupTargetFolder *em_popup_target_new_folder(EMPopup *emp, const char *uri, guint32 info_flags, guint32 popup_flags);
-EMPopupTargetAttachments *em_popup_target_new_attachments(EMPopup *emp, GSList *attachments);
/* ********************************************************************** */