diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-08-10 08:03:24 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-10 22:32:03 +0800 |
commit | 45d475c31b2dbda8033021984ba9a429b9eddf51 (patch) | |
tree | 04550583b657b0ea2e62f1a289631e9e03a8dbb1 /mail | |
parent | 3b0699fc304d0f4aecb261d19869de221f5d6abf (diff) | |
download | gsoc2013-evolution-45d475c31b2dbda8033021984ba9a429b9eddf51.tar.gz gsoc2013-evolution-45d475c31b2dbda8033021984ba9a429b9eddf51.tar.zst gsoc2013-evolution-45d475c31b2dbda8033021984ba9a429b9eddf51.zip |
Kill EMMenu and EMPopup.
Also finish adapting Templates plugin to EPluginUI.
It was still leaning pretty hard on EMPopup.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/Makefile.am | 4 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 5 | ||||
-rw-r--r-- | mail/em-folder-utils.c | 1 | ||||
-rw-r--r-- | mail/em-format-html-display.c | 15 | ||||
-rw-r--r-- | mail/em-menu.c | 354 | ||||
-rw-r--r-- | mail/em-menu.h | 121 | ||||
-rw-r--r-- | mail/em-popup.c | 472 | ||||
-rw-r--r-- | mail/em-popup.h | 261 | ||||
-rw-r--r-- | mail/message-list.c | 5 |
9 files changed, 22 insertions, 1216 deletions
diff --git a/mail/Makefile.am b/mail/Makefile.am index 5f8372f691..53b5bca508 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -71,8 +71,6 @@ mailinclude_HEADERS = \ em-icon-stream.h \ em-inline-filter.h \ em-junk-hook.h \ - em-menu.h \ - em-popup.h \ em-search-context.h \ em-subscribe-editor.h \ em-sync-stream.h \ @@ -131,8 +129,6 @@ libevolution_mail_la_SOURCES = \ em-icon-stream.c \ em-inline-filter.c \ em-junk-hook.c \ - em-menu.c \ - em-popup.c \ em-search-context.c \ em-subscribe-editor.c \ em-sync-stream.c \ diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index cadb8fee65..a3813ca69d 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -65,7 +65,6 @@ #include "mail-vfolder.h" #include "em-utils.h" -#include "em-popup.h" #include "em-folder-tree.h" #include "em-folder-utils.h" #include "em-folder-selector.h" @@ -1384,6 +1383,7 @@ tree_drag_data_action(struct _DragDataReceivedAsync *m) mail_msg_unordered_push (m); } +#if 0 /* KILL-BONOBO */ static void emft_drop_popup_copy(EPopup *ep, EPopupItem *item, gpointer data) { @@ -1509,6 +1509,7 @@ tree_drag_data_received(GtkWidget *widget, GdkDragContext *context, gint x, gint tree_drag_data_action(m); } } +#endif static gboolean is_special_local_folder (const gchar *name) @@ -1952,7 +1953,9 @@ em_folder_tree_enable_drag_and_drop (EMFolderTree *emft) g_signal_connect (tree_view, "drag-begin", G_CALLBACK (tree_drag_begin), emft); g_signal_connect (tree_view, "drag-data-delete", G_CALLBACK (tree_drag_data_delete), emft); g_signal_connect (tree_view, "drag-data-get", G_CALLBACK (tree_drag_data_get), emft); +#if 0 /* KILL-BONOBO */ g_signal_connect (tree_view, "drag-data-received", G_CALLBACK (tree_drag_data_received), emft); +#endif g_signal_connect (tree_view, "drag-drop", G_CALLBACK (tree_drag_drop), emft); g_signal_connect (tree_view, "drag-end", G_CALLBACK (tree_drag_end), emft); g_signal_connect (tree_view, "drag-leave", G_CALLBACK (tree_drag_leave), emft); diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index e483942885..700e445beb 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -61,7 +61,6 @@ #include "mail-folder-cache.h" #include "em-utils.h" -#include "em-popup.h" #include "em-folder-tree.h" #include "em-folder-tree-model.h" #include "em-folder-utils.h" diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 270db0e698..a15b0d671f 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -78,7 +78,6 @@ #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" @@ -841,6 +840,7 @@ efhd_can_process_attachment (GtkWidget *button) return efh && efh->state != EM_FORMAT_HTML_STATE_RENDERING; } +#if 0 /* KILL-BONOBO */ /* if it hasn't been processed yet, format the attachment */ static void efhd_attachment_show(EPopup *ep, EPopupItem *item, gpointer data) @@ -975,6 +975,7 @@ efhd_attachment_popup_menu(GtkWidget *w, struct _attach_puri *info) { return efhd_attachment_popup(w, NULL, info); } +#endif /* ********************************************************************** */ @@ -1132,9 +1133,13 @@ efhd_image_unallocate (struct _EMFormatPURI * puri) struct _attach_puri *info = (struct _attach_puri *) puri; g_signal_handlers_disconnect_by_func(info->html, efhd_image_resized, info); +#if 0 /* KILL-BONOBO */ g_signal_handlers_disconnect_by_func(info->event_box, efhd_image_popup, info); +#endif g_signal_handlers_disconnect_by_func(info->event_box, efhd_change_cursor, info); +#if 0 /* KILL-BONOBO */ g_signal_handlers_disconnect_by_func(info->event_box, efhd_attachment_popup_menu, info); +#endif g_signal_handlers_disconnect_by_func(info->event_box, efhd_image_fit_width, info); } @@ -1185,9 +1190,13 @@ efhd_attachment_image(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObjec g_signal_connect(box, "drag-data-get", G_CALLBACK(efhd_drag_data_get), pobject); g_signal_connect (box, "drag-data-delete", G_CALLBACK(efhd_drag_data_delete), pobject); +#if 0 /* KILL-BONOBO */ g_signal_connect(box, "button_press_event", G_CALLBACK(efhd_image_popup), info); +#endif g_signal_connect(box, "enter-notify-event", G_CALLBACK(efhd_change_cursor), info); +#if 0 /* KILL-BONOBO */ g_signal_connect(box, "popup_menu", G_CALLBACK(efhd_attachment_popup_menu), info); +#endif g_signal_connect(box, "button-press-event", G_CALLBACK(efhd_image_fit_width), info); g_object_set_data (G_OBJECT (box), "efh", efh); @@ -1244,9 +1253,11 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje g_object_set_data (G_OBJECT (widget), "efh", efh); +#if 0 /* KILL-BONOBO */ g_signal_connect ( widget, "notify::expanded", G_CALLBACK (efhd_attachment_button_expanded), info); +#endif return TRUE; } @@ -1407,9 +1418,11 @@ efhd_attachment_optional(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPOb a11y = gtk_widget_get_accessible (button); atk_object_set_name (a11y, _("Attachment")); +#if 0 /* KILL-BONOBO */ 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); +#endif gtk_box_pack_start(GTK_BOX (mainbox), button, FALSE, FALSE, 6); gtk_widget_show_all(mainbox); diff --git a/mail/em-menu.c b/mail/em-menu.c deleted file mode 100644 index bb8063e7dc..0000000000 --- a/mail/em-menu.c +++ /dev/null @@ -1,354 +0,0 @@ -/* - * 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/> - * - * - * Authors: - * Michael Zucchi <notzed@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <stdlib.h> - -#include <gtk/gtk.h> - -#include "em-menu.h" -#include "libedataserver/e-msgport.h" -#include "em-utils.h" -#include "em-composer-utils.h" - -#include <camel/camel-store.h> -#include <camel/camel-folder.h> -#include <camel/camel-mime-message.h> -#include <camel/camel-string-utils.h> -#include <camel/camel-mime-utils.h> -#include <camel/camel-mime-part.h> -#include <camel/camel-url.h> - -#include <camel/camel-vee-folder.h> -#include <camel/camel-vtrash-folder.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <e-util/e-util.h> - -static void emp_standard_menu_factory(EMenu *emp, gpointer data); - -static GObjectClass *emp_parent; - -static void -emp_init(GObject *o) -{ - /*EMMenu *emp = (EMMenu *)o; */ -} - -static void -emp_finalise(GObject *o) -{ - ((GObjectClass *)emp_parent)->finalize(o); -} - -static void -emp_target_free(EMenu *ep, EMenuTarget *t) -{ - switch (t->type) { - case EM_MENU_TARGET_SELECT: { - EMMenuTargetSelect *s = (EMMenuTargetSelect *)t; - - if (s->folder) - camel_object_unref(s->folder); - g_free(s->uri); - if (s->uids) - em_utils_uids_free(s->uids); - break; } - } - - ((EMenuClass *)emp_parent)->target_free(ep, t); -} - -static void -emp_class_init(GObjectClass *klass) -{ - klass->finalize = emp_finalise; - ((EMenuClass *)klass)->target_free = emp_target_free; - - e_menu_class_add_factory((EMenuClass *)klass, NULL, (EMenuFactoryFunc)emp_standard_menu_factory, NULL); -} - -GType -em_menu_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMMenuClass), - NULL, NULL, - (GClassInitFunc)emp_class_init, - NULL, NULL, - sizeof(EMMenu), 0, - (GInstanceInitFunc)emp_init - }; - emp_parent = g_type_class_ref(e_menu_get_type()); - type = g_type_register_static(e_menu_get_type(), "EMMenu", &info, 0); - } - - return type; -} - -EMMenu *em_menu_new(const gchar *menuid) -{ - EMMenu *emp = g_object_new(em_menu_get_type(), NULL); - - e_menu_construct(&emp->popup, menuid); - - return emp; -} - -/** - * em_menu_target_new_select: - * @folder: The selection will ref this for the life of it. - * @folder_uri: - * @uids: The selection will free this when done with it. - * - * Create a new selection popup target. - * - * Return value: - **/ -EMMenuTargetSelect * -em_menu_target_new_select(EMMenu *emp, CamelFolder *folder, const gchar *folder_uri, GPtrArray *uids) -{ - EMMenuTargetSelect *t = e_menu_target_new(&emp->popup, EM_MENU_TARGET_SELECT, sizeof(*t)); - guint32 mask = ~0; - gint i; - const gchar *tmp; - - /* NB: This is identical to em-popup-target-new-select function */ - - t->uids = uids; - t->folder = folder; - t->uri = g_strdup(folder_uri); - - if (folder == NULL) { - t->target.mask = mask; - - return t; - } - - camel_object_ref(folder); - mask &= ~EM_MENU_SELECT_FOLDER; - - if (em_utils_folder_is_sent(folder, folder_uri)) - mask &= ~EM_MENU_SELECT_EDIT; - - if (!(em_utils_folder_is_drafts(folder, folder_uri) - || em_utils_folder_is_outbox(folder, folder_uri)) - && uids->len == 1) - mask &= ~EM_MENU_SELECT_ADD_SENDER; - - if (uids->len == 1) - mask &= ~EM_MENU_SELECT_ONE; - - if (uids->len >= 1) - mask &= ~EM_MENU_SELECT_MANY; - - for (i = 0; i < uids->len; i++) { - CamelMessageInfo *info = camel_folder_get_message_info(folder, uids->pdata[i]); - guint32 flags; - - if (info == NULL) - continue; - - flags = camel_message_info_flags(info); - - if (flags & CAMEL_MESSAGE_SEEN) - mask &= ~EM_MENU_SELECT_MARK_UNREAD; - else - mask &= ~EM_MENU_SELECT_MARK_READ; - - if (flags & CAMEL_MESSAGE_DELETED) - mask &= ~EM_MENU_SELECT_UNDELETE; - else - mask &= ~EM_MENU_SELECT_DELETE; - - if (flags & CAMEL_MESSAGE_FLAGGED) - mask &= ~EM_MENU_SELECT_MARK_UNIMPORTANT; - else - mask &= ~EM_MENU_SELECT_MARK_IMPORTANT; - - if (flags & CAMEL_MESSAGE_JUNK) - mask &= ~EM_MENU_SELECT_MARK_NOJUNK; - else - mask &= ~EM_MENU_SELECT_MARK_JUNK; - - tmp = camel_message_info_user_tag(info, "follow-up"); - if (tmp && *tmp) { - mask &= ~EM_MENU_SELECT_FLAG_CLEAR; - tmp = camel_message_info_user_tag(info, "completed-on"); - if (tmp == NULL || *tmp == 0) - mask &= ~EM_MENU_SELECT_FLAG_COMPLETED; - } else - mask &= ~EM_MENU_SELECT_FLAG_FOLLOWUP; - - if (i == 0 && uids->len == 1 - && (tmp = camel_message_info_mlist(info)) - && tmp[0] != 0) - mask &= ~EM_MENU_SELECT_MAILING_LIST; - - camel_folder_free_message_info(folder, info); - } - - t->target.mask = mask; - - return t; -} - -/** - * em_menu_target_new_window: - * @emp: - * @window: - * - * create a dummy target which references some sort of widget. - * - * Return value: - **/ -EMMenuTargetWidget * -em_menu_target_new_widget(EMMenu *emp, GtkWidget *w) -{ - EMMenuTargetWidget *t = e_menu_target_new(&emp->popup, EM_MENU_TARGET_WIDGET, sizeof(*t)); - guint32 mask = ~0; - - t->target.mask = mask; - t->target.widget = w; - - return t; -} - -static void -emp_standard_menu_factory(EMenu *emp, gpointer data) -{ - /* noop */ -} - -/* ********************************************************************** */ - -/* menu plugin handler */ - -/* -<e-plugin - class="org.gnome.mail.plugin.popup:1.0" - id="org.gnome.mail.plugin.popup.item:1.0" - type="shlib" - location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" - name="imap" - description="IMAP4 and IMAP4v1 mail store"> - <hook class="org.gnome.mail.popupMenu:1.0" - handler="HandlePopup"> - <menu id="any" target="select"> - <item - type="item|toggle|radio|image|submenu|bar" - active - path="foo/bar" - label="label" - icon="foo" - mask="select_one" - activate="emp_view_emacs"/> - </menu> - </extension> - -*/ - -static gpointer emph_parent_class; -#define emph ((EMMenuHook *)eph) - -static const EMenuHookTargetMask emph_select_masks[] = { - { "one", EM_MENU_SELECT_ONE }, - { "many", EM_MENU_SELECT_MANY }, - { "mark_read", EM_MENU_SELECT_MARK_READ }, - { "mark_unread", EM_MENU_SELECT_MARK_UNREAD }, - { "delete", EM_MENU_SELECT_DELETE }, - { "undelete", EM_MENU_SELECT_UNDELETE }, - { "mailing_list", EM_MENU_SELECT_MAILING_LIST }, - { "resend", EM_MENU_SELECT_EDIT }, - { "mark_important", EM_MENU_SELECT_MARK_IMPORTANT }, - { "mark_unimportant", EM_MENU_SELECT_MARK_UNIMPORTANT }, - { "flag_followup", EM_MENU_SELECT_FLAG_FOLLOWUP }, - { "flag_completed", EM_MENU_SELECT_FLAG_COMPLETED }, - { "flag_clear", EM_MENU_SELECT_FLAG_CLEAR }, - { "add_sender", EM_MENU_SELECT_ADD_SENDER }, - { "mark_junk", EM_MENU_SELECT_MARK_JUNK }, - { "mark_nojunk", EM_MENU_SELECT_MARK_NOJUNK }, - { "folder", EM_MENU_SELECT_FOLDER }, - { NULL } -}; - -/* dummy widget target, probably wont have any useful masks. - this should probably be a more specific target type */ -static const EMenuHookTargetMask emph_widget_masks[] = { - { NULL } -}; - -static const EMenuHookTargetMap emph_targets[] = { - { "select", EM_MENU_TARGET_SELECT, emph_select_masks }, - { "widget", EM_MENU_TARGET_WIDGET, emph_widget_masks }, - { NULL } -}; - -static void -emph_finalise(GObject *o) -{ - /*EPluginHook *eph = (EPluginHook *)o;*/ - - ((GObjectClass *)emph_parent_class)->finalize(o); -} - -static void -emph_class_init(EPluginHookClass *klass) -{ - gint i; - - ((GObjectClass *)klass)->finalize = emph_finalise; - ((EPluginHookClass *)klass)->id = "org.gnome.evolution.mail.bonobomenu:1.0"; - - for (i=0;emph_targets[i].type;i++) - e_menu_hook_class_add_target_map((EMenuHookClass *)klass, &emph_targets[i]); - - /* FIXME: leaks parent set class? */ - ((EMenuHookClass *)klass)->menu_class = g_type_class_ref(em_menu_get_type()); -} - -GType -em_menu_hook_get_type(void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof(EMMenuHookClass), NULL, NULL, (GClassInitFunc) emph_class_init, NULL, NULL, - sizeof(EMMenuHook), 0, (GInstanceInitFunc) NULL, - }; - - emph_parent_class = g_type_class_ref(e_menu_hook_get_type()); - type = g_type_register_static(e_menu_hook_get_type(), "EMMenuHook", &info, 0); - } - - return type; -} diff --git a/mail/em-menu.h b/mail/em-menu.h deleted file mode 100644 index b2e66916e3..0000000000 --- a/mail/em-menu.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * - * 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/> - * - * - * Authors: - * Michel Zucchi <notzed@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef __EM_MENU_H__ -#define __EM_MENU_H__ - -#include <glib-object.h> -#include <camel/camel-folder.h> - -#include "e-util/e-menu.h" - -G_BEGIN_DECLS - -typedef struct _EMMenu EMMenu; -typedef struct _EMMenuClass EMMenuClass; - -/* Current target description */ -/* Types of popup tagets */ -enum _em_menu_target_t { - EM_MENU_TARGET_SELECT, - EM_MENU_TARGET_WIDGET -}; - -/* Flags that describe a TARGET_SELECT */ -enum { - EM_MENU_SELECT_ONE = 1<<1, - EM_MENU_SELECT_MANY = 1<<2, - EM_MENU_SELECT_MARK_READ = 1<<3, - EM_MENU_SELECT_MARK_UNREAD = 1<<4, - EM_MENU_SELECT_DELETE = 1<<5, - EM_MENU_SELECT_UNDELETE = 1<<6, - EM_MENU_SELECT_MAILING_LIST = 1<<7, - EM_MENU_SELECT_EDIT = 1<<8, - EM_MENU_SELECT_MARK_IMPORTANT = 1<<9, - EM_MENU_SELECT_MARK_UNIMPORTANT = 1<<10, - EM_MENU_SELECT_FLAG_FOLLOWUP = 1<<11, - EM_MENU_SELECT_FLAG_COMPLETED = 1<<12, - EM_MENU_SELECT_FLAG_CLEAR = 1<<13, - EM_MENU_SELECT_ADD_SENDER = 1<<14, - EM_MENU_SELECT_MARK_JUNK = 1<<15, - EM_MENU_SELECT_MARK_NOJUNK = 1<<16, - EM_MENU_SELECT_FOLDER = 1<<17, /* do we have any folder at all? */ - EM_MENU_SELECT_LAST = 1<<18 /* reserve 2 slots */ -}; - -/* Flags that describe a TARGET_WIDGET (none) - this should probably be a more specific target type */ - -typedef struct _EMMenuTargetSelect EMMenuTargetSelect; - -struct _EMMenuTargetSelect { - EMenuTarget target; - CamelFolder *folder; - gchar *uri; - GPtrArray *uids; -}; - -typedef struct _EMMenuTargetWidget EMMenuTargetWidget; - -struct _EMMenuTargetWidget { - EMenuTarget target; -}; - -typedef struct _EMenuItem EMMenuItem; - -/* The object */ -struct _EMMenu { - EMenu popup; - - struct _EMMenuPrivate *priv; -}; - -struct _EMMenuClass { - EMenuClass popup_class; -}; - -GType em_menu_get_type(void); - -EMMenu *em_menu_new(const gchar *menuid); - -EMMenuTargetSelect *em_menu_target_new_select(EMMenu *emp, CamelFolder *folder, const gchar *folder_uri, GPtrArray *uids); -EMMenuTargetWidget *em_menu_target_new_widget(EMMenu *emp, GtkWidget *w); - -/* ********************************************************************** */ - -typedef struct _EMMenuHook EMMenuHook; -typedef struct _EMMenuHookClass EMMenuHookClass; - -struct _EMMenuHook { - EMenuHook hook; -}; - -struct _EMMenuHookClass { - EMenuHookClass hook_class; -}; - -GType em_menu_hook_get_type(void); - -G_END_DECLS - -#endif /* __EM_MENU_H__ */ diff --git a/mail/em-popup.c b/mail/em-popup.c deleted file mode 100644 index f9caf9de0c..0000000000 --- a/mail/em-popup.c +++ /dev/null @@ -1,472 +0,0 @@ -/* - * 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/> - * - * - * Authors: - * Michael Zucchi <notzed@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <stdlib.h> - -#include <gio/gio.h> -#include <gtk/gtk.h> -#include <glib/gi18n.h> - -#include "em-popup.h" -#include "libedataserver/e-msgport.h" -#include "em-utils.h" -#include "em-composer-utils.h" - -#include <camel/camel-store.h> -#include <camel/camel-folder.h> -#include <camel/camel-mime-message.h> -#include <camel/camel-string-utils.h> -#include <camel/camel-mime-utils.h> -#include <camel/camel-mime-part.h> -#include <camel/camel-url.h> -#include <camel/camel-stream-mem.h> - -#include <camel/camel-vee-folder.h> -#include <camel/camel-vtrash-folder.h> - -#include <gconf/gconf.h> -#include <gconf/gconf-client.h> - -#include <libedataserver/e-data-server-util.h> -#include <e-util/e-util.h> -#include "e-attachment.h" - -static GObjectClass *emp_parent; - -static void -emp_init(GObject *o) -{ - /*EMPopup *emp = (EMPopup *)o; */ -} - -static void -emp_finalise(GObject *o) -{ - ((GObjectClass *)emp_parent)->finalize(o); -} - -static void -emp_target_free(EPopup *ep, EPopupTarget *t) -{ - switch (t->type) { - case EM_POPUP_TARGET_SELECT: { - EMPopupTargetSelect *s = (EMPopupTargetSelect *)t; - - if (s->folder) - camel_object_unref(s->folder); - g_free(s->uri); - if (s->uids) - em_utils_uids_free(s->uids); - break; } - case EM_POPUP_TARGET_URI: { - EMPopupTargetURI *s = (EMPopupTargetURI *)t; - - g_free(s->uri); - break; } - case EM_POPUP_TARGET_PART: { - EMPopupTargetPart *s = (EMPopupTargetPart *)t; - - camel_object_unref(s->part); - g_free(s->mime_type); - break; } - case EM_POPUP_TARGET_FOLDER: { - EMPopupTargetFolder *s = (EMPopupTargetFolder *)t; - - g_free(s->uri); - break; } - } - - ((EPopupClass *)emp_parent)->target_free(ep, t); -} - -static void -emp_class_init(GObjectClass *klass) -{ - klass->finalize = emp_finalise; - ((EPopupClass *)klass)->target_free = emp_target_free; -} - -GType -em_popup_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMPopupClass), - NULL, NULL, - (GClassInitFunc)emp_class_init, - NULL, NULL, - sizeof(EMPopup), 0, - (GInstanceInitFunc)emp_init - }; - emp_parent = g_type_class_ref(e_popup_get_type()); - type = g_type_register_static(e_popup_get_type(), "EMPopup", &info, 0); - } - - return type; -} - -EMPopup *em_popup_new(const gchar *menuid) -{ - EMPopup *emp = g_object_new(em_popup_get_type(), NULL); - - e_popup_construct(&emp->popup, menuid); - - return emp; -} - -/** - * em_popup_target_new_select: - * @folder: The selection will ref this for the life of it. - * @folder_uri: - * @uids: The selection will free this when done with it. - * - * Create a new selection popup target. - * - * Return value: - **/ -EMPopupTargetSelect * -em_popup_target_new_select(EMPopup *emp, CamelFolder *folder, const gchar *folder_uri, GPtrArray *uids) -{ - EMPopupTargetSelect *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_SELECT, sizeof(*t)); - CamelStore *store = CAMEL_STORE (folder->parent_store); - guint32 mask = ~0; - gboolean draft_or_outbox; - gint i; - const gchar *tmp; - - t->uids = uids; - t->folder = folder; - t->uri = g_strdup(folder_uri); - - if (folder == NULL) { - t->target.mask = mask; - - return t; - } - - camel_object_ref(folder); - mask &= ~EM_POPUP_SELECT_FOLDER; - - if (em_utils_folder_is_sent(folder, folder_uri)) - mask &= ~EM_POPUP_SELECT_EDIT; - - draft_or_outbox = em_utils_folder_is_drafts(folder, folder_uri) || em_utils_folder_is_outbox(folder, folder_uri); - if (!draft_or_outbox && uids->len == 1) - mask &= ~EM_POPUP_SELECT_ADD_SENDER; - - if (uids->len == 1) - mask &= ~EM_POPUP_SELECT_ONE; - - if (uids->len >= 1) - mask &= ~EM_POPUP_SELECT_MANY; - - for (i = 0; i < uids->len; i++) { - CamelMessageInfo *info = camel_folder_get_message_info(folder, uids->pdata[i]); - guint32 flags; - - if (info == NULL) - continue; - - flags = camel_message_info_flags(info); - if (flags & CAMEL_MESSAGE_SEEN) - mask &= ~EM_POPUP_SELECT_MARK_UNREAD; - else - mask &= ~EM_POPUP_SELECT_MARK_READ; - - if ((store->flags & CAMEL_STORE_VJUNK) && !draft_or_outbox) { - if ((flags & CAMEL_MESSAGE_JUNK)) - mask &= ~EM_POPUP_SELECT_NOT_JUNK; - else - mask &= ~EM_POPUP_SELECT_JUNK; - } else if (draft_or_outbox) { - /* Show none option */ - mask |= EM_POPUP_SELECT_NOT_JUNK; - mask |= EM_POPUP_SELECT_JUNK; - } else { - /* Show both options */ - mask &= ~EM_POPUP_SELECT_NOT_JUNK; - mask &= ~EM_POPUP_SELECT_JUNK; - } - - if (flags & CAMEL_MESSAGE_DELETED) - mask &= ~EM_POPUP_SELECT_UNDELETE; - else - mask &= ~EM_POPUP_SELECT_DELETE; - - if (flags & CAMEL_MESSAGE_FLAGGED) - mask &= ~EM_POPUP_SELECT_MARK_UNIMPORTANT; - else - mask &= ~EM_POPUP_SELECT_MARK_IMPORTANT; - - tmp = camel_message_info_user_tag(info, "follow-up"); - if (tmp && *tmp) { - mask &= ~EM_POPUP_SELECT_FLAG_CLEAR; - tmp = camel_message_info_user_tag(info, "completed-on"); - if (tmp == NULL || *tmp == 0) - mask &= ~EM_POPUP_SELECT_FLAG_COMPLETED; - } else - mask &= ~EM_POPUP_SELECT_FLAG_FOLLOWUP; - - if (i == 0 && uids->len == 1 - && (tmp = camel_message_info_mlist(info)) - && tmp[0] != 0) - mask &= ~EM_POPUP_SELECT_MAILING_LIST; - - camel_folder_free_message_info(folder, info); - } - - t->target.mask = mask; - - return t; -} - -EMPopupTargetURI * -em_popup_target_new_uri(EMPopup *emp, const gchar *uri) -{ - EMPopupTargetURI *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_URI, sizeof(*t)); - guint32 mask = ~0; - - t->uri = g_strdup(uri); - - if (g_ascii_strncasecmp(uri, "http:", 5) == 0 - || g_ascii_strncasecmp(uri, "https:", 6) == 0) - mask &= ~EM_POPUP_URI_HTTP; - - if (g_ascii_strncasecmp(uri, "mailto:", 7) == 0) - mask &= ~EM_POPUP_URI_MAILTO; - else - mask &= ~(EM_POPUP_URI_NOT_MAILTO|~mask); - - t->target.mask = mask; - - return t; -} - -EMPopupTargetPart * -em_popup_target_new_part(EMPopup *emp, CamelMimePart *part, const gchar *mime_type) -{ - EMPopupTargetPart *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_PART, sizeof(*t)); - guint32 mask = ~0; - - t->part = part; - camel_object_ref(part); - if (mime_type) - t->mime_type = g_strdup(mime_type); - else - t->mime_type = camel_data_wrapper_get_mime_type((CamelDataWrapper *)part); - - camel_strdown(t->mime_type); - - if (CAMEL_IS_MIME_MESSAGE(camel_medium_get_content_object((CamelMedium *)part))) - mask &= ~EM_POPUP_PART_MESSAGE; - - if (strncmp(t->mime_type, "image/", 6) == 0) - mask &= ~EM_POPUP_PART_IMAGE; - - t->target.mask = mask; - - return t; -} - -/* TODO: This should be based on the CamelFolderInfo, but ... em-folder-tree doesn't keep it? */ -EMPopupTargetFolder * -em_popup_target_new_folder (EMPopup *emp, const gchar *uri, guint32 info_flags, guint32 popup_flags) -{ - EMPopupTargetFolder *t = e_popup_target_new(&emp->popup, EM_POPUP_TARGET_FOLDER, sizeof(*t)); - guint32 mask = ~0; - CamelURL *url; - - t->uri = g_strdup(uri); - - if (popup_flags & EM_POPUP_FOLDER_STORE) - mask &= ~(EM_POPUP_FOLDER_STORE|EM_POPUP_FOLDER_INFERIORS); - else - mask &= ~EM_POPUP_FOLDER_FOLDER; - - url = camel_url_new(uri, NULL); - if (url == NULL) - goto done; - - if (!(popup_flags & EM_POPUP_FOLDER_STORE)) { - const gchar *path; - - if (popup_flags & EM_POPUP_FOLDER_DELETE) - mask &= ~EM_POPUP_FOLDER_DELETE; - - if (!(info_flags & CAMEL_FOLDER_NOINFERIORS)) - mask &= ~EM_POPUP_FOLDER_INFERIORS; - - if (info_flags & CAMEL_FOLDER_TYPE_OUTBOX) - mask &= ~EM_POPUP_FOLDER_OUTBOX; - else - mask &= ~EM_POPUP_FOLDER_NONSTATIC; - - if (!(info_flags & CAMEL_FOLDER_NOSELECT)) - mask &= ~EM_POPUP_FOLDER_SELECT; - - if (info_flags & CAMEL_FOLDER_VIRTUAL) - mask |= EM_POPUP_FOLDER_DELETE|EM_POPUP_FOLDER_INFERIORS; - - if ((path = url->fragment ? url->fragment : url->path)) { - if ((!strcmp (url->protocol, "vfolder") && !strcmp (path, CAMEL_UNMATCHED_NAME)) - || (!strcmp (url->protocol, "maildir") && !strcmp (path, "."))) /* hack for maildir toplevel folder */ - mask |= EM_POPUP_FOLDER_DELETE|EM_POPUP_FOLDER_INFERIORS; - } - } - - camel_url_free(url); -done: - t->target.mask = mask; - - return t; -} - -/* ********************************************************************** */ - -/* Popup menu plugin handler */ - -/* -<e-plugin - class="org.gnome.mail.plugin.popup:1.0" - id="org.gnome.mail.plugin.popup.item:1.0" - type="shlib" - location="/opt/gnome2/lib/camel/1.0/libcamelimap.so" - name="imap" - description="IMAP4 and IMAP4v1 mail store"> - <hook class="org.gnome.mail.popupMenu:1.0" - handler="HandlePopup"> - <menu id="any" target="select"> - <item - type="item|toggle|radio|image|submenu|bar" - active - path="foo/bar" - label="label" - icon="foo" - mask="select_one" - activate="emp_view_emacs"/> - </menu> - </extension> - -*/ - -static gpointer emph_parent_class; -#define emph ((EMPopupHook *)eph) - -static const EPopupHookTargetMask emph_select_masks[] = { - { "one", EM_POPUP_SELECT_ONE }, - { "many", EM_POPUP_SELECT_MANY }, - { "mark_read", EM_POPUP_SELECT_MARK_READ }, - { "mark_unread", EM_POPUP_SELECT_MARK_UNREAD }, - { "delete", EM_POPUP_SELECT_DELETE }, - { "undelete", EM_POPUP_SELECT_UNDELETE }, - { "mailing_list", EM_POPUP_SELECT_MAILING_LIST }, - { "resend", EM_POPUP_SELECT_EDIT }, - { "mark_important", EM_POPUP_SELECT_MARK_IMPORTANT }, - { "mark_unimportant", EM_POPUP_SELECT_MARK_UNIMPORTANT }, - { "flag_followup", EM_POPUP_SELECT_FLAG_FOLLOWUP }, - { "flag_completed", EM_POPUP_SELECT_FLAG_COMPLETED }, - { "flag_clear", EM_POPUP_SELECT_FLAG_CLEAR }, - { "add_sender", EM_POPUP_SELECT_ADD_SENDER }, - { "folder", EM_POPUP_SELECT_FOLDER }, - { "junk", EM_POPUP_SELECT_JUNK }, - { "not_junk", EM_POPUP_SELECT_NOT_JUNK }, - { NULL } -}; - -static const EPopupHookTargetMask emph_uri_masks[] = { - { "http", EM_POPUP_URI_HTTP }, - { "mailto", EM_POPUP_URI_MAILTO }, - { "notmailto", EM_POPUP_URI_NOT_MAILTO }, - { NULL } -}; - -static const EPopupHookTargetMask emph_part_masks[] = { - { "message", EM_POPUP_PART_MESSAGE }, - { "image", EM_POPUP_PART_IMAGE }, - { NULL } -}; - -static const EPopupHookTargetMask emph_folder_masks[] = { - { "folder", EM_POPUP_FOLDER_FOLDER }, - { "store", EM_POPUP_FOLDER_STORE }, - { "inferiors", EM_POPUP_FOLDER_INFERIORS }, - { "delete", EM_POPUP_FOLDER_DELETE }, - { "select", EM_POPUP_FOLDER_SELECT }, - { "outbox", EM_POPUP_FOLDER_OUTBOX }, - { "nonstatic", EM_POPUP_FOLDER_NONSTATIC }, - { 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 }, - { NULL } -}; - -static void -emph_finalise(GObject *o) -{ - /*EPluginHook *eph = (EPluginHook *)o;*/ - - ((GObjectClass *)emph_parent_class)->finalize(o); -} - -static void -emph_class_init(EPluginHookClass *klass) -{ - gint i; - - ((GObjectClass *)klass)->finalize = emph_finalise; - ((EPluginHookClass *)klass)->id = "org.gnome.evolution.mail.popup:1.0"; - - for (i=0;emph_targets[i].type;i++) - e_popup_hook_class_add_target_map((EPopupHookClass *)klass, &emph_targets[i]); - - ((EPopupHookClass *)klass)->popup_class = g_type_class_ref(em_popup_get_type()); -} - -GType -em_popup_hook_get_type(void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof(EMPopupHookClass), NULL, NULL, (GClassInitFunc) emph_class_init, NULL, NULL, - sizeof(EMPopupHook), 0, (GInstanceInitFunc) NULL, - }; - - emph_parent_class = g_type_class_ref(e_popup_hook_get_type()); - type = g_type_register_static(e_popup_hook_get_type(), "EMPopupHook", &info, 0); - } - - return type; -} diff --git a/mail/em-popup.h b/mail/em-popup.h deleted file mode 100644 index f7182e9358..0000000000 --- a/mail/em-popup.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * - * 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/> - * - * - * Authors: - * Michel Zucchi <notzed@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef __EM_POPUP_H__ -#define __EM_POPUP_H__ - -#include <glib-object.h> -#include <camel/camel-folder.h> - -#include "e-util/e-popup.h" - -G_BEGIN_DECLS - -typedef struct _EMPopup EMPopup; -typedef struct _EMPopupClass EMPopupClass; - -/** - * enum _em_popup_target_t - A list of mail popup target types. - * - * @EM_POPUP_TARGET_SELECT: A selection of messages. - * @EM_POPUP_TARGET_URI: A URI. - * @EM_POPUP_TARGET_PART: A CamelMimePart message part. - * @EM_POPUP_TARGET_FOLDER: A folder URI. - * - * Defines the value of the targetid for all EMPopup target types. - **/ -enum _em_popup_target_t { - EM_POPUP_TARGET_SELECT, - EM_POPUP_TARGET_URI, - EM_POPUP_TARGET_PART, - EM_POPUP_TARGET_FOLDER -}; - -/** - * enum _em_popup_target_select_t - EMPopupTargetSelect qualifiers. - * - * @EM_POPUP_SELECT_ONE: Only one item is selected. - * @EM_POPUP_SELECT_MANY: One ore more items are selected. - * @EM_POPUP_SELECT_MARK_READ: Message(s) are unseen and can be - * marked seen. - * @EM_POPUP_SELECT_MARK_UNREAD: Message(s) are seen and can be - * marked unseen. - * @EM_POPUP_SELECT_DELETE: Message(s) are undeleted and can - * be marked deleted. - * @EM_POPUP_SELECT_UNDELETE: Message(s) are deleted and can be - * undeleted. - * @EM_POPUP_SELECT_MAILING_LIST: If one message is selected, and it - * contains a message list tag. - * @EM_POPUP_SELECT_EDIT: The message can be opened for editing (the - * folder is a sent folder). - * @EM_POPUP_SELECT_MARK_IMPORTANT: Message(s) are not marked - * important. - * @EM_POPUP_SELECT_MARK_UNIMPORTANT: Message(s) are marked - * important. - * @EM_POPUP_SELECT_FLAG_FOLLOWUP: Message(s) are not flagged for - * followup. - * @EM_POPUP_SELECT_FLAG_COMPLETED: Message(s) are not flagged completed. - * @EM_POPUP_SELECT_FLAG_CLEAR: Message(s) are flagged for followup. - * @EM_POPUP_SELECT_ADD_SENDER: The message contains sender addresses - * which might be added to the addressbook. i.e. it isn't a message in - * the Sent or Drafts folders. - * @EM_POPUP_SELECT_FOLDER: A folder is set on the selection. - * @EM_POPUP_SELECT_LAST: The last bit used, can be used to add - * additional types from derived application code. - * - **/ -enum _em_popup_target_select_t { - EM_POPUP_SELECT_ONE = 1<<1, - EM_POPUP_SELECT_MANY = 1<<2, - EM_POPUP_SELECT_MARK_READ = 1<<3, - EM_POPUP_SELECT_MARK_UNREAD = 1<<4, - EM_POPUP_SELECT_DELETE = 1<<5, - EM_POPUP_SELECT_UNDELETE = 1<<6, - EM_POPUP_SELECT_MAILING_LIST = 1<<7, - EM_POPUP_SELECT_EDIT = 1<<8, - EM_POPUP_SELECT_MARK_IMPORTANT = 1<<9, - EM_POPUP_SELECT_MARK_UNIMPORTANT = 1<<10, - EM_POPUP_SELECT_FLAG_FOLLOWUP = 1<<11, - EM_POPUP_SELECT_FLAG_COMPLETED = 1<<12, - EM_POPUP_SELECT_FLAG_CLEAR = 1<<13, - EM_POPUP_SELECT_ADD_SENDER = 1<<14, - EM_POPUP_SELECT_FOLDER = 1<<15, /* do we have any folder at all? */ - EM_POPUP_SELECT_JUNK = 1<<16, - EM_POPUP_SELECT_NOT_JUNK = 1<<17, - EM_POPUP_SELECT_LAST = 1<<18 -}; - -/** - * enum _em_popup_target_uri_t - EMPopupTargetURI qualifiers. - * - * @EM_POPUP_URI_HTTP: This is a HTTP or HTTPS url. - * @EM_POPUP_URI_MAILTO: This is a MAILTO url. - * @EM_POPUP_URI_NOT_MAILTO: This is not a MAILTO url. - * - **/ -enum _em_popup_target_uri_t { - EM_POPUP_URI_HTTP = 1<<0, - EM_POPUP_URI_MAILTO = 1<<1, - EM_POPUP_URI_NOT_MAILTO = 1<<2 -}; - -/** - * enum _em_popup_target_part_t - EMPopupTargetPart qualifiers. - * - * @EM_POPUP_PART_MESSAGE: This is a message type. - * @EM_POPUP_PART_IMAGE: This is an image type. - * - **/ -enum _em_popup_target_part_t { - EM_POPUP_PART_MESSAGE = 1<<0, - EM_POPUP_PART_IMAGE = 1<<1 -}; - -/** - * enum _em_popup_target_folder_t - EMPopupTargetFolder qualifiers. - * - * @EM_POPUP_FOLDER_FOLDER: This is a normal folder. - * @EM_POPUP_FOLDER_STORE: This is a store. - * @EM_POPUP_FOLDER_INFERIORS: This folder may have child folders. - * @EM_POPUP_FOLDER_DELETE: This folder can be deleted or renamed. - * @EM_POPUP_FOLDER_SELECT: This folder exists and can be selected or - * opened. - * - **/ -enum _em_popup_target_folder_t { - EM_POPUP_FOLDER_FOLDER = 1<<0, /* normal folder */ - EM_POPUP_FOLDER_STORE = 1<<1, /* root/nonselectable folder, i.e. store */ - EM_POPUP_FOLDER_INFERIORS = 1<<2, /* folder can have children */ - EM_POPUP_FOLDER_DELETE = 1<<3, /* folder can be deleted/renamed */ - EM_POPUP_FOLDER_SELECT = 1<<4, /* folder can be selected/opened */ - EM_POPUP_FOLDER_OUTBOX = 1<<5, /* Outbox folder */ - EM_POPUP_FOLDER_NONSTATIC = 1<<6 /* Except static folders like Outbox.*/ -}; - -typedef struct _EMPopupTargetSelect EMPopupTargetSelect; -typedef struct _EMPopupTargetURI EMPopupTargetURI; -typedef struct _EMPopupTargetPart EMPopupTargetPart; -typedef struct _EMPopupTargetFolder EMPopupTargetFolder; - -/** - * struct _EMPopupTargetURI - An inline URI. - * - * @target: Superclass. - * @uri: The encoded URI to which this target applies. - * - * Used to represent popup-menu context on any URI object. - **/ -struct _EMPopupTargetURI { - EPopupTarget target; - gchar *uri; -}; - -/** - * struct _EMPopupTargetSelect - A list of messages. - * - * @target: Superclass. - * @folder: The CamelFolder of the selected messages. - * @uri: The encoded URI represending this folder. - * @uids: An array of UID strings of messages within @folder. - * - * Used to represent a selection of messages as context for a popup - * menu. All items may be NULL if the current view has no active - * folder selected. - **/ -struct _EMPopupTargetSelect { - EPopupTarget target; - CamelFolder *folder; - gchar *uri; - GPtrArray *uids; -}; - -/** - * struct _EMPopupTargetPart - A Camel object. - * - * @target: Superclass. - * @mime_type: MIME type of the part. This may be a calculated type - * not matching the @part's MIME type. - * @part: A CamelMimePart representing a message or attachment. - * - * Used to represent a message part as context for a popup menu. This - * is used for both attachments and inline-images. - **/ -struct _EMPopupTargetPart { - EPopupTarget target; - gchar *mime_type; - CamelMimePart *part; -}; - -/** - * struct _EMPopupTargetFolder - A folder uri. - * - * @target: Superclass. - * @uri: A folder URI. - * - * This target is used to represent folder context. - **/ -struct _EMPopupTargetFolder { - EPopupTarget target; - gchar *uri; -}; - -typedef struct _EPopupItem EMPopupItem; - -/* The object */ -struct _EMPopup { - EPopup popup; - - struct _EMPopupPrivate *priv; -}; - -struct _EMPopupClass { - EPopupClass popup_class; -}; - -GType em_popup_get_type(void); - -EMPopup *em_popup_new(const gchar *menuid); - -EMPopupTargetURI *em_popup_target_new_uri(EMPopup *emp, const gchar *uri); -EMPopupTargetSelect *em_popup_target_new_select(EMPopup *emp, CamelFolder *folder, const gchar *folder_uri, GPtrArray *uids); -EMPopupTargetPart *em_popup_target_new_part(EMPopup *emp, CamelMimePart *part, const gchar *mime_type); -EMPopupTargetFolder *em_popup_target_new_folder(EMPopup *emp, const gchar *uri, guint32 info_flags, guint32 popup_flags); - -/* ********************************************************************** */ - -typedef struct _EMPopupHook EMPopupHook; -typedef struct _EMPopupHookClass EMPopupHookClass; - -struct _EMPopupHook { - EPopupHook hook; -}; - -struct _EMPopupHookClass { - EPopupHookClass hook_class; -}; - -GType em_popup_hook_get_type(void); - -G_END_DECLS - -#endif /* __EM_POPUP_H__ */ diff --git a/mail/message-list.c b/mail/message-list.c index ce1b20123e..b80431d5ff 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -70,7 +70,6 @@ #include "table/e-cell-hbox.h" #include "e-mail-label-list-store.h" -#include "em-popup.h" #include "em-utils.h" #include "mail-config.h" #include "mail-mt.h" @@ -2156,6 +2155,7 @@ ml_drop_action(struct _drop_msg *m) mail_msg_unordered_push (m); } +#if 0 /* KILL-BONOBO */ static void ml_drop_popup_copy(EPopup *ep, EPopupItem *item, gpointer data) { @@ -2241,6 +2241,7 @@ ml_tree_drag_data_received (ETree *tree, gint row, ETreePath path, gint col, ml_drop_action(m); } } +#endif struct search_child_struct { gboolean found; @@ -2709,8 +2710,10 @@ message_list_construct (MessageList *message_list) ml_drop_types, sizeof(ml_drop_types)/sizeof(ml_drop_types[0]), GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_ASK); +#if 0 /* KILL-BONOBO */ g_signal_connect(message_list->tree, "tree_drag_data_received", G_CALLBACK(ml_tree_drag_data_received), message_list); +#endif g_signal_connect(message_list->tree, "drag-motion", G_CALLBACK(ml_tree_drag_motion), message_list); } |