aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-08-10 08:03:24 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-08-10 22:32:03 +0800
commit45d475c31b2dbda8033021984ba9a429b9eddf51 (patch)
tree04550583b657b0ea2e62f1a289631e9e03a8dbb1
parent3b0699fc304d0f4aecb261d19869de221f5d6abf (diff)
downloadgsoc2013-evolution-45d475c31b2dbda8033021984ba9a429b9eddf51.tar
gsoc2013-evolution-45d475c31b2dbda8033021984ba9a429b9eddf51.tar.gz
gsoc2013-evolution-45d475c31b2dbda8033021984ba9a429b9eddf51.tar.bz2
gsoc2013-evolution-45d475c31b2dbda8033021984ba9a429b9eddf51.tar.lz
gsoc2013-evolution-45d475c31b2dbda8033021984ba9a429b9eddf51.tar.xz
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.
-rw-r--r--mail/Makefile.am4
-rw-r--r--mail/em-folder-tree.c5
-rw-r--r--mail/em-folder-utils.c1
-rw-r--r--mail/em-format-html-display.c15
-rw-r--r--mail/em-menu.c354
-rw-r--r--mail/em-menu.h121
-rw-r--r--mail/em-popup.c472
-rw-r--r--mail/em-popup.h261
-rw-r--r--mail/message-list.c5
-rw-r--r--plugins/email-custom-header/email-custom-header.c1
-rw-r--r--plugins/external-editor/external-editor.c1
-rw-r--r--plugins/face/face.c1
-rw-r--r--plugins/mail-to-task/mail-to-task.c2
-rw-r--r--plugins/templates/org-gnome-templates.eplug.xml36
-rw-r--r--plugins/templates/templates.c387
-rw-r--r--shell/e-shell-window-private.c11
-rw-r--r--shell/e-shell-window.c11
-rw-r--r--ui/Makefile.am10
-rw-r--r--ui/evolution-mail-global.xml149
-rw-r--r--ui/evolution-mail-list.xml154
-rw-r--r--ui/evolution-mail-message.xml426
-rw-r--r--ui/evolution-mail-messagedisplay.xml74
-rw-r--r--ui/evolution-mail.ui2
-rw-r--r--ui/evolution.xml199
24 files changed, 283 insertions, 2419 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);
}
diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c
index 81dd24d396..4e76f971c8 100644
--- a/plugins/email-custom-header/email-custom-header.c
+++ b/plugins/email-custom-header/email-custom-header.c
@@ -29,7 +29,6 @@
#include <gconf/gconf-client.h>
#include <e-util/e-error.h>
#include <glade/glade.h>
-#include "mail/em-menu.h"
#include "mail/em-utils.h"
#include "mail/em-event.h"
#include "composer/e-msg-composer.h"
diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c
index dcd81650f5..2342651fa3 100644
--- a/plugins/external-editor/external-editor.c
+++ b/plugins/external-editor/external-editor.c
@@ -26,7 +26,6 @@
#include <config.h>
#endif
-#include <mail/em-menu.h>
#include <mail/em-config.h>
#include <mail/em-composer-utils.h>
#include <mail/mail-config.h>
diff --git a/plugins/face/face.c b/plugins/face/face.c
index 6bbc7bbf1a..1bb56c2bff 100644
--- a/plugins/face/face.c
+++ b/plugins/face/face.c
@@ -28,7 +28,6 @@
#include "composer/e-msg-composer.h"
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <mail/em-menu.h>
#include <e-util/e-error.h>
#include <e-util/e-util.h>
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index 3613694985..16c1ab5f35 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -46,8 +46,6 @@
#include <camel/camel-stream-mem.h>
#include <camel/camel-utf8.h>
-#include <mail/em-menu.h>
-#include <mail/em-popup.h>
#include <mail/em-utils.h>
#include <mail/em-format-html.h>
#include <mail/mail-config.h>
diff --git a/plugins/templates/org-gnome-templates.eplug.xml b/plugins/templates/org-gnome-templates.eplug.xml
index 02b14148ad..b4b8a81039 100644
--- a/plugins/templates/org-gnome-templates.eplug.xml
+++ b/plugins/templates/org-gnome-templates.eplug.xml
@@ -7,30 +7,22 @@
_name="Templates">
<_description>Drafts based template plugin</_description>
<author name="Bharath Acharya" email="abharath@novell.com"/>
- <author name="Diego Escalante Urrelo" email="diegoe@gnome.org"/>
+ <author name="Diego Escalante Urrelo" email="diegoe@gnome.org"/>
- <!-- hook into the mail popup menu -->
- <hook class="org.gnome.evolution.mail.popup:1.0">
- <menu
- id="org.gnome.evolution.mail.folderview.popup"
- target="select"
- factory="org_gnome_templates_popup">
- </menu>
+ <hook class="org.gnome.evolution.ui:1.0">
+ <ui-manager id="org.gnome.evolution.shell"/>
+ <ui-manager id="org.gnome.evolution.composer">
+ <menubar name='main-menu'>
+ <placeholder name='pre-edit-menu'>
+ <menu action='file-menu'>
+ <placeholder name="template-holder">
+ <menuitem action="template"/>
+ </placeholder>
+ </menu>
+ </placeholder>
+ </menubar>
+ </ui-manager>
</hook>
-
- <hook class="org.gnome.evolution.ui:1.0">
- <ui-manager id="org.gnome.evolution.composer">
- <menubar name='main-menu'>
- <placeholder name='pre-edit-menu'>
- <menu action='file-menu'>
- <placeholder name="template-holder">
- <menuitem action="Template"/>
- </placeholder>
- </menu>
- </placeholder>
- </menubar>
- </ui-manager>
- </hook>
</e-plugin>
</e-plugin-list>
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 78a0cf40a1..89496b57eb 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -27,6 +27,7 @@
#include <glib/gi18n.h>
#include <string.h>
+#include <glade/glade.h>
#include <gconf/gconf-client.h>
#include <e-util/e-config.h>
@@ -35,13 +36,15 @@
#include <camel/camel-stream-mem.h>
#include <mail/e-mail-local.h>
+#include <mail/e-mail-reader.h>
#include <mail/em-composer-utils.h>
-#include <mail/em-popup.h>
#include <mail/mail-session.h>
#include <mail/mail-ops.h>
+#include <mail/message-list.h>
#include <e-util/e-error.h>
#include <e-util/e-plugin.h>
-#include <glade/glade.h>
+#include <e-util/e-util.h>
+#include <shell/e-shell-view.h>
#include <composer/e-msg-composer.h>
@@ -63,32 +66,10 @@ enum {
CLUE_N_COLUMNS
};
-typedef struct {
- CamelMimeMessage *msg;
- EMPopupTargetSelect *t;
-} UserData;
-
-static gchar * get_content (CamelMimeMessage *message);
-
-static void reply_with_template (EPopup *ep, EPopupItem *item, gpointer data);
-
-static void popup_free (EPopup *ep, GSList *l, gpointer data);
-
-static GSList *fill_submenu (CamelStore *store,
- CamelFolderInfo *info,
- GSList *list,
- EMPopupTargetSelect *t);
-
-static GSList *append_to_menu (CamelFolder *folder,
- GPtrArray *uids,
- GSList *list,
- EMPopupTargetSelect *t);
-
-void org_gnome_templates_popup (EPlugin *ep, EMPopupTargetSelect *t);
-
GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl);
-gboolean e_plugin_ui_init (GtkUIManager *ui_manager, EMsgComposer *composer);
+gboolean e_plugin_ui_init (GtkUIManager *ui_manager, GObject *object);
+gint e_plugin_lib_enable (EPlugin *plugin, gboolean enabled);
/* Thanks to attachment reminder plugin for this*/
static void commit_changes (UIData *ui);
@@ -102,6 +83,8 @@ static void value_cell_edited_callback (GtkCellRendererText *cell, gchar *path_
static gboolean clue_foreach_check_isempty (GtkTreeModel *model, GtkTreePath
*path, GtkTreeIter *iter, UIData *ui);
+static gboolean plugin_enabled;
+
static void
selection_changed (GtkTreeSelection *selection, UIData *ui)
{
@@ -496,32 +479,23 @@ get_content (CamelMimeMessage *message)
}
static void
-reply_with_template (EPopup *ep, EPopupItem *item, gpointer data)
+action_reply_with_template_cb (GtkAction *action,
+ CamelMimeMessage *message)
{
- CamelMimeMessage *new, *template, *reply_to;
- CamelFolder *templates_folder;
+ CamelMimeMessage *new, *template;
+ CamelFolder *folder;
struct _camel_header_raw *header;
- UserData *userdata = item->user_data;
gchar *cont;
- /* We get the templates folder and all the uids of the messages in there */
- templates_folder = e_mail_local_get_folder (E_MAIL_FOLDER_TEMPLATES);
-
- /* Get from the currently selected folder, the currently selected message */
- reply_to = camel_folder_get_message (userdata->t->folder,
- g_ptr_array_index (userdata->t->uids, 0),
- NULL);
-
- /* The message we'll be using has been stored when building the menu */
- template = userdata->msg;
+ folder = e_mail_local_get_folder (E_MAIL_FOLDER_TEMPLATES);
+ template = g_object_get_data (G_OBJECT (action), "template");
/* The new message we are creating */
new = camel_mime_message_new();
/* Add the headers from the message we are replying to, so CC and that
- * stuff is preserved.
- */
- header = ((CamelMimePart *)reply_to)->headers;
+ * stuff is preserved. */
+ header = ((CamelMimePart *)message)->headers;
while (header) {
if (g_ascii_strncasecmp (header->name, "content-", 8) != 0) {
camel_medium_add_header((CamelMedium *) new,
@@ -538,7 +512,7 @@ reply_with_template (EPopup *ep, EPopupItem *item, gpointer data)
/* Set the To: field to the same To: field of the message we are replying to. */
camel_mime_message_set_recipients (new, CAMEL_RECIPIENT_TYPE_TO,
- camel_mime_message_get_from (reply_to));
+ camel_mime_message_get_from (message));
/* Copy the CC and BCC from the template.*/
camel_mime_message_set_recipients (new, CAMEL_RECIPIENT_TYPE_CC,
@@ -551,160 +525,148 @@ reply_with_template (EPopup *ep, EPopupItem *item, gpointer data)
cont, (gint) g_utf8_strlen(cont, -1), "text");
/* Create the composer */
- em_utils_edit_message (new, templates_folder);
+ em_utils_edit_message (new, folder);
camel_object_unref(new);
}
static void
-popup_free (EPopup *ep, GSList *l, gpointer data)
+build_template_menus_recurse (GtkUIManager *ui_manager,
+ GtkActionGroup *action_group,
+ const gchar *menu_path,
+ guint *action_count,
+ guint merge_id,
+ CamelFolderInfo *folder_info,
+ CamelMimeMessage *message)
{
- g_slist_free (l);
-}
+ CamelStore *store;
-static GSList
-*append_to_menu (CamelFolder *folder, GPtrArray *uids, GSList *list, EMPopupTargetSelect *t)
-{
- gint i;
+ store = e_mail_local_get_store ();
- for (i = 0; i < uids->len; i++) {
- const gchar *subject;
+ while (folder_info != NULL) {
+ CamelFolder *folder;
+ GPtrArray *uids;
+ GtkAction *action;
+ const gchar *action_label;
+ gchar *action_name;
gchar *path;
- EPopupItem *item;
- CamelMimeMessage *message;
- UserData *user_data;
- const gchar *uid;
-
- uid = g_strdup (g_ptr_array_index (uids, i));
-
- /* Same as in fill_submenu */
- if (!g_str_has_suffix (folder->name, "Templates"))
- path = g_strdup_printf ("80.%s", folder->full_name);
- else
- path = g_strdup ("80.Templates");
-
- /* If this uid is trashed, ignore it */
- if (camel_folder_get_message_flags (folder, uid) & CAMEL_MESSAGE_DELETED)
- continue;
+ guint ii;
- /* Get the message for this uid */
- message = camel_folder_get_message (folder,
- uid,
- NULL);
+ folder = camel_store_get_folder (
+ store, folder_info->full_name, 0, NULL);
- subject = camel_mime_message_get_subject (message);
+ action_name = g_strdup_printf (
+ "templates-menu-%d", *action_count);
+ *action_count = *action_count + 1;
- /* Create the menu item for it */
- item = g_slice_alloc0(sizeof(*item));
- item->type = E_POPUP_ITEM;
- item->path = g_strdup_printf ("%s/%02d", path, i);
- item->label = g_strdup ((strlen(subject) > 0) ? subject : _("No title"));
- item->visible = EM_POPUP_SELECT_MANY | EM_POPUP_SELECT_ONE;
+ /* To avoid having a Templates dir, we ignore the top level */
+ if (g_str_has_suffix (folder->name, "Templates"))
+ action_label = _("Templates");
+ else
+ action_label = folder->name;
- /* Make some info available to the callback */
- user_data = g_slice_new(UserData);
- user_data->msg = message;
- user_data->t = t;
+ action = gtk_action_new (
+ action_name, action_label, NULL, NULL);
- item->user_data = user_data;
- item->activate = reply_with_template;
+ gtk_action_group_add_action (action_group, action);
- list = g_slist_prepend (list, item);
- }
+ g_debug ("Adding %s/%s", menu_path, action_name);
- return list;
-}
+ gtk_ui_manager_add_ui (
+ ui_manager, merge_id, menu_path, action_name,
+ action_name, GTK_UI_MANAGER_MENU, FALSE);
-static GSList
-*fill_submenu (CamelStore *store, CamelFolderInfo *info, GSList *list, EMPopupTargetSelect *t)
-{
- while (info) {
- CamelFolder *folder;
- GPtrArray *uids;
- EPopupItem *item;
+ path = g_strdup_printf ("%s/%s", menu_path, action_name);
- folder = camel_store_get_folder (store, info->full_name, 0, NULL);
+ g_object_unref (action);
+ g_free (action_name);
- item = g_slice_alloc0(sizeof(*item));
- item->type = E_POPUP_SUBMENU;
- item->label = folder->name;
- item->visible = EM_POPUP_SELECT_MANY | EM_POPUP_SELECT_ONE;
+ /* Add submenus, if any. */
+ if (folder_info->child != NULL)
+ build_template_menus_recurse (
+ ui_manager, action_group,
+ path, action_count, merge_id,
+ folder_info->child, message);
- /* To avoid having a Templates dir, we ignore the top level */
- if (!g_str_has_suffix (folder->name, "Templates"))
- item->path = g_strdup_printf ("80.%s", folder->full_name);
- else
- item->path = g_strdup ("80.Templates");
+ /* Get the UIDs for this folder and add them to the menu. */
+ uids = camel_folder_get_uids (folder);
+ for (ii = 0; ii < uids->len; ii++) {
+ CamelMimeMessage *template;
+ const gchar *uid = uids->pdata[ii];
+ guint32 flags;
- list = g_slist_prepend (list, item);
+ /* If the UIDs is marked for deletion, skip it. */
+ flags = camel_folder_get_message_flags (folder, uid);
+ if (flags & CAMEL_MESSAGE_DELETED)
+ continue;
- /* Get the uids for this folder and fill them in the menu */
- uids = camel_folder_get_uids (folder);
- list = append_to_menu (folder, uids, list, t);
- camel_folder_free_uids (folder, uids);
+ template = camel_folder_get_message (folder, uid, NULL);
+ camel_object_ref (template);
- /* If the folder has a child, call this function again */
- if (info->child) {
- list = fill_submenu (store, info->child, list, t);
- }
+ action_label =
+ camel_mime_message_get_subject (template);
+ if (action_label == NULL || *action_label == '\0')
+ action_label = _("No Title");
- info = info->next;
- }
+ action_name = g_strdup_printf (
+ "templates-item-%d", *action_count);
+ *action_count = *action_count + 1;
- return list;
-}
+ action = gtk_action_new (
+ action_name, action_label, NULL, NULL);
-void
-org_gnome_templates_popup (EPlugin *ep, EMPopupTargetSelect *t)
-{
- CamelFolder *templates_folder;
- CamelFolderInfo *templates_info;
- CamelStore *store;
+ g_object_set_data_full (
+ G_OBJECT (action), "template", template,
+ (GDestroyNotify) camel_object_unref);
- GSList *list = NULL;
+ g_signal_connect (
+ action, "activate",
+ G_CALLBACK (action_reply_with_template_cb),
+ message);
- /* We get the templates folder and all the uids of the messages in there */
- store = e_mail_local_get_store ();
+ gtk_action_group_add_action (action_group, action);
- templates_folder = e_mail_local_get_folder (E_MAIL_FOLDER_TEMPLATES);
+ g_debug ("Adding %s/%s", path, action_name);
- templates_info = camel_store_get_folder_info (
- store, templates_folder->full_name,
- CAMEL_STORE_FOLDER_INFO_RECURSIVE |
- CAMEL_STORE_FOLDER_INFO_FAST, NULL);
+ gtk_ui_manager_add_ui (
+ ui_manager, merge_id, path, action_name,
+ action_name, GTK_UI_MANAGER_MENUITEM, FALSE);
- /* Get subfolders and fill it */
- list = fill_submenu (store, templates_info, list, t);
+ g_object_unref (action);
+ g_free (action_name);
+ }
+ camel_folder_free_uids (folder, uids);
- e_popup_add_items (t->target.popup, list, NULL, popup_free, NULL);
+ g_free (path);
- return;
+ folder_info = folder_info->next;
+ }
}
static void
action_template_cb (GtkAction *action,
- EMsgComposer *composer)
+ EMsgComposer *composer)
{
CamelMessageInfo *info;
CamelMimeMessage *msg;
- CamelFolder *templates_folder;
+ CamelFolder *folder;
+
+ /* Get the templates folder and all UIDs of the messages there. */
+ folder = e_mail_local_get_folder (E_MAIL_FOLDER_TEMPLATES);
- /* We get the templates folder and all the uids of the messages in there */
- templates_folder = e_mail_local_get_folder (E_MAIL_FOLDER_TEMPLATES);
msg = e_msg_composer_get_message_draft (composer);
info = camel_message_info_new (NULL);
/* FIXME: what's the ~0 for? :) */
- camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DRAFT, ~0);
+ camel_message_info_set_flags (
+ info, CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DRAFT, ~0);
- mail_append_mail (templates_folder, msg, info, NULL, composer);
-
- return;
+ mail_append_mail (folder, msg, info, NULL, composer);
}
-static GtkActionEntry entries[] = {
+static GtkActionEntry composer_entries[] = {
- { "Template",
+ { "template",
GTK_STOCK_SAVE,
N_("Save as _Template"),
"<Shift><Control>t",
@@ -712,9 +674,73 @@ static GtkActionEntry entries[] = {
G_CALLBACK (action_template_cb) }
};
-gboolean
-e_plugin_ui_init (GtkUIManager *ui_manager,
- EMsgComposer *composer)
+static void
+update_actions_cb (EShellView *shell_view)
+{
+ EShellContent *shell_content;
+ EShellWindow *shell_window;
+ GtkActionGroup *action_group;
+ GtkUIManager *ui_manager;
+ MessageList *message_list;
+ CamelMimeMessage *message;
+ CamelFolderInfo *folder_info;
+ CamelFolder *folder;
+ CamelStore *store;
+ EMailReader *reader;
+ GPtrArray *uids;
+ guint action_count = 0;
+ guint merge_id;
+ gpointer data;
+
+ shell_content = e_shell_view_get_shell_content (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ ui_manager = e_shell_window_get_ui_manager (shell_window);
+ action_group = e_lookup_action_group (ui_manager, "templates");
+ data = g_object_get_data (G_OBJECT (action_group), "merge-id");
+ merge_id = GPOINTER_TO_UINT (data);
+ g_return_if_fail (merge_id > 0);
+
+ gtk_ui_manager_remove_ui (ui_manager, merge_id);
+ e_action_group_remove_all_actions (action_group);
+
+ if (!plugin_enabled)
+ return;
+
+ reader = E_MAIL_READER (shell_content);
+ message_list = e_mail_reader_get_message_list (reader);
+
+ folder = message_list->folder;
+ uids = message_list_get_selected (message_list);
+
+ if (uids->len != 1)
+ goto exit;
+
+ /* This is the source message to use in replying with a template. */
+ message = camel_folder_get_message (folder, uids->pdata[0], NULL);
+
+ /* Now recursively build template submenus in the pop-up menu. */
+
+ store = e_mail_local_get_store ();
+ folder = e_mail_local_get_folder (E_MAIL_FOLDER_TEMPLATES);
+
+ folder_info = camel_store_get_folder_info (
+ store, folder->full_name,
+ CAMEL_STORE_FOLDER_INFO_RECURSIVE |
+ CAMEL_STORE_FOLDER_INFO_FAST, NULL);
+
+ build_template_menus_recurse (
+ ui_manager, action_group,
+ "/mail-message-popup/mail-message-templates",
+ &action_count, merge_id, folder_info, message);
+
+exit:
+ em_utils_uids_free (uids);
+}
+
+static gboolean
+init_composer_actions (GtkUIManager *ui_manager,
+ EMsgComposer *composer)
{
GtkhtmlEditor *editor;
@@ -723,7 +749,62 @@ e_plugin_ui_init (GtkUIManager *ui_manager,
/* Add actions to the "composer" action group. */
gtk_action_group_add_actions (
gtkhtml_editor_get_action_group (editor, "composer"),
- entries, G_N_ELEMENTS (entries), composer);
+ composer_entries, G_N_ELEMENTS (composer_entries), composer);
return TRUE;
}
+
+static gboolean
+init_shell_actions (GtkUIManager *ui_manager,
+ EShellWindow *shell_window)
+{
+ EShellView *shell_view;
+ GtkActionGroup *action_group;
+ guint merge_id;
+
+ shell_view = e_shell_window_get_shell_view (shell_window, "mail");
+
+ /* This is where we keep dynamically-built menu items. */
+ e_shell_window_add_action_group (shell_window, "templates");
+ action_group = e_lookup_action_group (ui_manager, "templates");
+
+ merge_id = gtk_ui_manager_new_merge_id (ui_manager);
+
+ g_object_set_data (
+ G_OBJECT (action_group), "merge-id",
+ GUINT_TO_POINTER (merge_id));
+
+ g_signal_connect (
+ shell_view, "update-actions",
+ G_CALLBACK (update_actions_cb), NULL);
+}
+
+gboolean
+e_plugin_ui_init (GtkUIManager *ui_manager,
+ GObject *object)
+{
+ /* XXX This is a scenario I hadn't considered when designing
+ * EPluginUI: two different UI manager IDs with different
+ * closures sharing the same plugin entry point. We know
+ * the closures are both GObjects so we query the type.
+ * Awkward, but it should work for now. */
+
+ if (E_IS_MSG_COMPOSER (object))
+ return init_composer_actions (
+ ui_manager, E_MSG_COMPOSER (object));
+
+ if (E_IS_SHELL_WINDOW (object))
+ return init_shell_actions (
+ ui_manager, E_SHELL_WINDOW (object));
+
+ return FALSE;
+}
+
+gint
+e_plugin_lib_enable (EPlugin *plugin,
+ gboolean enabled)
+{
+ plugin_enabled = enabled;
+
+ return 0;
+}
diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c
index 71617433d1..1eb5eed460 100644
--- a/shell/e-shell-window-private.c
+++ b/shell/e-shell-window-private.c
@@ -212,6 +212,8 @@ e_shell_window_private_init (EShellWindow *shell_window)
merge_id = gtk_ui_manager_new_merge_id (priv->ui_manager);
priv->gal_view_merge_id = merge_id;
+ gtk_window_set_title (GTK_WINDOW (shell_window), _("Evolution"));
+
e_shell_window_actions_init (shell_window);
accel_group = gtk_ui_manager_get_accel_group (priv->ui_manager);
@@ -335,10 +337,12 @@ e_shell_window_private_constructed (EShellWindow *shell_window)
EShellSettings *shell_settings;
EShell *shell;
GConfBridge *bridge;
- GtkActionGroup *action_group;
GtkAction *action;
+ GtkActionGroup *action_group;
+ GtkUIManager *ui_manager;
GObject *object;
const gchar *key;
+ const gchar *id;
shell = e_shell_window_get_shell (shell_window);
shell_settings = e_shell_get_shell_settings (shell);
@@ -427,6 +431,11 @@ e_shell_window_private_constructed (EShellWindow *shell_window)
gconf_bridge_bind_property (bridge, key, object, "active");
shell_window_init_switcher_style (shell_window);
+
+ id = "org.gnome.evolution.shell";
+ ui_manager = e_shell_window_get_ui_manager (shell_window);
+ e_plugin_ui_register_manager (ui_manager, id, shell_window);
+ e_plugin_ui_enable_manager (ui_manager, id);
}
void
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index c838235616..19392094ee 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -335,20 +335,9 @@ shell_window_class_init (EShellWindowClass *class)
static void
shell_window_init (EShellWindow *shell_window)
{
- GtkUIManager *ui_manager;
- const gchar *id;
-
shell_window->priv = E_SHELL_WINDOW_GET_PRIVATE (shell_window);
- gtk_window_set_title (GTK_WINDOW (shell_window), _("Evolution"));
-
e_shell_window_private_init (shell_window);
-
- ui_manager = e_shell_window_get_ui_manager (shell_window);
-
- id = "org.gnome.evolution.shell";
- e_plugin_ui_register_manager (ui_manager, id, shell_window);
- e_plugin_ui_enable_manager (ui_manager, id);
}
GType
diff --git a/ui/Makefile.am b/ui/Makefile.am
index ebae928dee..a57b470dca 100644
--- a/ui/Makefile.am
+++ b/ui/Makefile.am
@@ -1,10 +1,3 @@
-XML_FILES = \
- evolution.xml \
- evolution-mail-message.xml \
- evolution-mail-list.xml \
- evolution-mail-global.xml \
- evolution-mail-messagedisplay.xml
-
UI_FILES = \
evolution-calendars.ui \
evolution-contacts.ui \
@@ -14,11 +7,10 @@ UI_FILES = \
evolution-shell.ui \
evolution-tasks.ui
-evolutionui_DATA = $(UI_FILES) $(XML_FILES)
+evolutionui_DATA = $(UI_FILES)
EXTRA_DIST = \
$(UI_FILES) \
- $(XML_FILES) \
ChangeLog.pre-1-4
-include $(top_srcdir)/git.mk
diff --git a/ui/evolution-mail-global.xml b/ui/evolution-mail-global.xml
deleted file mode 100644
index c582cd6b62..0000000000
--- a/ui/evolution-mail-global.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<Root>
-
- <commands> <!-- Alphabetical by name, yo -->
-
- <cmd name="EmptyTrash"
- _tip="Permanently remove all deleted messages from all folders"/>
-
- <cmd name="MailStop"
- _tip="Cancel the current mail operation"
- pixtype="stock" pixname="gtk-stop"/>
-
- <cmd name="FolderCreate"
- _tip="Create a new folder for storing mail"
- pixtype="pixbuf"/>
-
- <cmd name="FolderCopy"
- _tip="Copy the selected folder into another folder"
- pixtype="pixbuf"/>
-
- <cmd name="FolderMove"
- _tip="Move the selected folder into another folder"
- pixtype="pixbuf"/>
-
- <cmd name="ToolsFilters"
- _tip="Create or edit rules for filtering new mail"/>
-
- <cmd name="ToolsSubscriptions"
- _tip="Subscribe or unsubscribe to folders on remote servers"/>
-
- <cmd name="ToolsVFolders"
- _tip="Create or edit Search Folder definitions"/>
-
- <cmd name="ViewPreview"
- _tip="Show message preview window"
- accel="*Control*m"
- type="toggle"/>
-
- <cmd name="ViewBelow" _label="_Classic View"
- type="radio" group="preview_display" _tip="Show message preview below the message list"/>
-
- <cmd name="ViewAfter" _label="_Vertical View"
- type="radio" group="preview_display" _tip="Show message preview side-by-side with the message list"/>
-
- <cmd name="PrepareForOffline" _label="_Download Messages for Offline Usage" _tip="Download messages of accounts/folders marked for offline"/>
- <cmd name="HelpDebug" _tip="View the debug console for log messages"/>
-
- </commands>
-
- <keybindings>
- <accel name="slash" id="FocusSearch"/>
- </keybindings>
-
- <menu>
-
- <submenu name="File">
- <placeholder name="EmptyTrashPlaceholder">
- <menuitem name="EmptyTrash" verb="" _label="Empty _Trash"/>
- <menuitem name="PrepareForOffline" verb="" _label="_Download Messages for Offline Usage"/>
- </placeholder>
- </submenu>
-
- <submenu name="View" _label="_View">
- <placeholder name="ViewPreview">
- <submenu name="Preview" _label="_Preview">
- <menuitem name="ViewPreview" verb="" _label="Show Message _Preview"/>
- <separator name="previewsep"/>
- <menuitem name="ViewBelow" id="ViewBelow" _label="_Classic View"/>
- <menuitem name="ViewAfter" id="ViewAfter" _label="_Vertical View"/>
- </submenu>
- </placeholder>
- <separator f="" name="emailglobal"/>
- <placeholder name="MailMessageFilter"/>
- <placeholder name="MailMessageView"/>
-
-<!-- This is the menu we want to replace "Current View" with
- <submenu name="ViewAs" _label="Message _List As">
- <placeholder name="CurrentView"/>
- </submenu>
--->
-
- <placeholder name="MailViewType">
- <separator f="" name="MailViewOps"/>
- </placeholder>
-
- <placeholder name="MailMessageZoom"/>
- <placeholder name="MailListView"/>
- </submenu>
-
- <submenu name="Edit">
- <placeholder name="EditPlaceholder">
- <placeholder name="MailListEdit"/>
- <placeholder name="MailMessageEdit"/>
- <placeholder name="MailListEditFlags"/>
- </placeholder>
-
- <placeholder name="MailFilterTools">
- <menuitem name="ToolsFilters" verb="" _label="_Message Filters"/>
- </placeholder>
-
- <placeholder name="MailVFolderTools">
- <menuitem name="ToolsVFolders" verb="" _label="Search F_olders"/>
- </placeholder>
- </submenu>
-
- <placeholder name="FolderPlaceholder">
- <submenu name="Folder" _label="F_older">
-
- <menuitem name="FolderCreate" verb="" _label="_New..."/>
-<!--
- <menuitem name="CreateVFolder" verb="CreateVFolder" _label="_New Search _Folder (FIXME)"/>
--->
- <menuitem name="ToolsSubscriptions" verb="" _label="_Subscriptions..."/>
-
- <separator f="" name="Folder1"/>
-
- <menuitem name="FolderCopy" verb="" _label="_Copy Folder To..."/>
- <menuitem name="FolderMove" verb="" _label="_Move Folder To..."/>
-
- <separator f="" name="Folder2"/>
-
- <placeholder name="MessagesInFolder"/>
-
- <separator f="" name="Folder3"/>
-
- <placeholder name="FolderOps"/>
-
- </submenu>
- </placeholder>
- <submenu name="Help" _label="_Help">
- <placeholder name="PlaceHolderDebug">
- <menuitem name="HelpDebug" verb="" _label="_Debug Logs"/>
- </placeholder>
- </submenu>
- </menu>
-
- <dockitem name="Toolbar">
-
- <placeholder name="MailMessageToolbar"/>
-
- <toolitem name="MailStop" verb=""
- _label="Cancel"/>
-
- <separator f="" name="emailglobal1"/>
-
- <placeholder name="MailNextButtons"/>
-
- </dockitem>
-
-</Root>
diff --git a/ui/evolution-mail-list.xml b/ui/evolution-mail-list.xml
deleted file mode 100644
index 95b62eb996..0000000000
--- a/ui/evolution-mail-list.xml
+++ /dev/null
@@ -1,154 +0,0 @@
-<Root>
-
- <commands> <!-- Alphabetical by name, yo -->
-
- <cmd name="EditCut"
- _tip="Cut selected message(s) to the clipboard"
- accel="*Control*x" pixtype="pixbuf"/>
-
- <cmd name="EditCopy"
- _tip="Copy selected message(s) to the clipboard"
- accel="*Control*c" pixtype="pixbuf"/>
-
- <cmd name="EditPaste"
- _tip="Paste message(s) from the clipboard"
- accel="*Control*v" pixtype="pixbuf"/>
-
- <cmd name="EditInvertSelection"
- _tip="Select all and only the messages that are not currently selected"
- accel="*Control**Shift*i"/>
-
- <cmd name="EditSelectAll"
- _tip="Select all visible messages"
- accel="*Control*a"/>
-
- <cmd name="EditSelectSubthread"
- _tip="Select all replies to the currently selected message"
- accel="*Control**Shift*h"/>
-
- <cmd name="EditSelectThread"
- _tip="Select all messages in the same thread as the selected message"
- accel="*Control*h"/>
-
- <cmd name="MessageMarkAllAsRead"
- _tip="Mark all messages in the folder as read" accel="*Control*slash"
- pixtype="pixbuf"/>
-
- <cmd name="ChangeFolderProperties"
- _tip="Change the properties of this folder"
- pixtype="pixbuf"/>
-
- <cmd name="FolderExpunge"
- _tip="Permanently remove all deleted messages from this folder"
- accel="*Control*e"/>
-
- <cmd name="FolderDelete"
- _tip="Permanently remove this folder"
- pixtype="stock" pixname="gtk-delete"/>
-
- <cmd name="FolderRename"
- _tip="Change the name of this folder" accel="F2"/>
-
- <cmd name="FolderRefresh"
- _tip="Refresh the folder" accel="F5"
- pixtype="stock" pixname="gtk-refresh"/>
-
-
- <cmd name="HideDeleted" _tip="Hide deleted messages rather than displaying them with a line through them"
- type="toggle" />
-
- <cmd name="ViewHideRead" _tip="Temporarily hide all messages that have already been read"
- pixtype="pixbuf" />
-
- <cmd name="ViewHideSelected" _tip="Temporarily hide the selected messages"
- pixtype="pixbuf" />
-
- <cmd name="ViewShowAll" _tip="Show messages that have been temporarily hidden"
- pixtype="pixbuf" />
-
- <cmd name="ViewThreaded"
- _tip="Threaded Message list"
- accel="*Control*t"
- type="toggle" />
-
- <cmd name="ViewThreadsCollapseAll"
- _tip="Collapse all message threads" accel="*Control**Shift*b"/>
-
- <cmd name="ViewThreadsExpandAll"
- _tip="Expand all message threads"/>
-
- </commands>
-
- <keybindings>
-
- </keybindings>
-
- <menu>
-
- <submenu name="View">
-
- <placeholder name="MailMessageView">
- <menuitem name="ViewThreaded" verb="" _label="_Group By Threads"/>
- <menuitem name="ViewThreadsExpandAll" verb="" _label="E_xpand All Threads"/>
- <menuitem name="ViewThreadsCollapseAll" verb="" _label="Collapse All _Threads"/>
- <separator f="" name="emaillist"/>
- <menuitem name="HideDeleted" verb="" _label="Hide _Deleted Messages"/>
- <menuitem name="ViewHideSelected" verb="" _label="Hide S_elected Messages"/>
- <menuitem name="ViewHideRead" verb="" _label="Hide _Read Messages"/>
- <menuitem name="ViewShowAll" verb="" _label="Show Hidde_n Messages"/>
- </placeholder>
-
- </submenu>
-
- <placeholder name="MessagePlaceholder">
- <submenu name="Message" _label="_Message">
- <placeholder name="MessageTopActions"/>
-
- <separator f="" name="emailglobal"/>
-
- <placeholder name="MessageNavigation"/>
- <placeholder name="MailListActions"/>
- <placeholder name="MailMessageActions"/>
-
- <separator f="" name="emaillist5"/>
-
- <placeholder name="MessageRuleCreate"/>
-
- </submenu>
- </placeholder>
-
- <placeholder name="FolderPlaceholder">
- <submenu name="Folder" _label="F_older">
-
- <placeholder name="MessagesInFolder">
- <menuitem name="EditSelectAll" verb="" _label="Select _All Messages"/>
- <menuitem name="EditSelectThread" verb="" _label="Select Message _Thread"/>
- <menuitem name="EditSelectSubthread" verb="" _label="Select Message S_ubthread"/>
- <menuitem name="MessageMarkAllAsRead" verb="" _label="Mar_k All Messages as Read"/>
- <menuitem name="FolderExpunge" verb="" _label="E_xpunge"/>
- </placeholder>
-
- <placeholder name="FolderOps">
- <menuitem name="FolderRename" verb="" _label="_Rename..."/>
- <menuitem name="FolderRefresh" verb="" _label="Re_fresh"/>
- <menuitem name="FolderDelete" verb="" _label="_Delete"/>
-
- <separator f="" name="FolderOps1"/>
- <menuitem name="ChangeFolderProperties" verb="" _label="_Properties"/>
- </placeholder>
-
- </submenu>
- </placeholder>
-
-<!--
- <submenu name="Actions" _label="_Actions">
- <placeholder name="ComponentActionsPlaceholder">
- <placeholder name="MailListActions">
- </placeholder>
- </placeholder>
- </submenu>
--->
-
- </menu>
-
-</Root>
diff --git a/ui/evolution-mail-message.xml b/ui/evolution-mail-message.xml
deleted file mode 100644
index f90e737c24..0000000000
--- a/ui/evolution-mail-message.xml
+++ /dev/null
@@ -1,426 +0,0 @@
-<Root>
-
- <commands> <!-- Alphabetical by name, yo -->
-
- <cmd name="AddSenderToAddressbook"
- _tip="Add Sender to Address Book"/>
-
- <cmd name="CaretMode"
- _tip="Show a blinking cursor in the body of displayed messages"
- type="toggle" state="0" accel="F7"/>
-
- <cmd name="EditCut"
- _tip="Cut selected messages to the clipboard"
- accel="*Control*x" pixtype="pixbuf"/>
-
- <cmd name="EditCopy"
- _tip="Copy selected messages to the clipboard"
- accel="*Control*c" pixtype="pixbuf"/>
-
- <cmd name="EditPaste"
- _tip="Paste messages from the clipboard"
- accel="*Control*v" pixtype="pixbuf"/>
-
- <cmd name="MailNext"
- _tip="Display the next message"
- accel="*Control*Page_Down"/>
-
- <cmd name="MailNextFlagged"
- _tip="Display the next important message"/>
-
- <cmd name="MailNextUnread"
- _tip="Display the next unread message"
- accel="*Control*bracketright"/>
-
- <cmd name="MailNextThread"
- _tip="Display the next thread"/>
-
- <cmd name="MailPrevious"
- _tip="Display the previous message"
- accel="*Control*Page_Up"/>
-
- <cmd name="MailPreviousFlagged"
- _tip="Display the previous important message"/>
-
- <cmd name="MailPreviousUnread"
- _tip="Display the previous unread message"
- accel="*Control*bracketleft"/>
-
- <cmd name="MessageApplyFilters"
- _tip="Apply filter rules to the selected messages"
- accel="*Control*y"
- pixtype="pixbuf"/>
-
- <cmd name="MessageCopy"
- _tip="Copy selected messages to another folder"
- accel="*Control**Shift*y"
- pixtype="pixbuf"/>
-
- <cmd name="MessageDelete"
- _tip="Mark the selected messages for deletion"
- pixtype="pixbuf"/>
-
- <cmd name="MessageFollowUpFlag"
- _tip="Flag selected messages for follow-up"
- accel="*Control**Shift*G"
- pixtype="pixbuf"/>
-
- <cmd name="MessageForward"
- _tip="Forward the selected message to someone"
- accel="*Control*f"
- pixtype="pixbuf"/>
-
- <cmd name="MessageForwardAttached"
- _tip="Forward the selected message to someone as an attachment"/>
-
- <cmd name="MessageForwardInline"
- _tip="Forward the selected message in the body of a new message"/>
-
- <cmd name="MessageForwardQuoted"
- _tip="Forward the selected message quoted like a reply"/>
-
- <cmd name="MessageMarkAsRead"
- _tip="Mark the selected messages as having been read"
- accel="*Control*k"
- pixtype="pixbuf"/>
-
- <cmd name="MessageMarkAsUnRead"
- _tip="Mark the selected messages as not having been read"
- accel="*Control**Shift*k"
- pixtype="pixbuf"/>
-
- <cmd name="MessageMarkAsImportant"
- _tip="Mark the selected messages as important"
- pixtype="pixbuf"/>
-
- <cmd name="MessageMarkAsUnimportant"
- _tip="Mark the selected messages as unimportant"/>
-
- <cmd name="MessageMarkAsJunk"
- _tip="Mark the selected messages as junk"
- accel="*Control*j"
- pixtype="pixbuf"/>
-
- <cmd name="MessageMarkAsNotJunk"
- _tip="Mark the selected messages as not being junk"
- accel="*Control**Shift*j"
- pixtype="pixbuf"/>
-
- <cmd name="MessageFilterJunk"
- _tip="Filter the selected messages for junk status"
- pixtype="pixbuf"/>
-
- <cmd name="MailCompose"
- _tip="Open a window for composing a mail message"
- pixtype="pixbuf"
- accel="*Control**Shift*m"/>
-
- <cmd name="MessageMove"
- _tip="Move selected messages to another folder"
- accel="*Control**Shift*v"
- pixtype="pixbuf"/>
-
- <cmd name="MessageEdit"
- _tip="Open the selected messages in the composer for editing"/>
-
- <cmd name="MessageOpen"
- _tip="Open the selected messages in a new window"
- accel="*Control*o"/>
-
- <cmd name="MessageRedirect"
- _tip="Redirect (bounce) the selected message to someone"
- accel=""/>
-
- <cmd name="MessageReplyAll"
- _tip="Compose a reply to all of the recipients of the selected message"
- accel="*Control**Shift*r"
- pixtype="pixbuf"/>
-
- <cmd name="MessageReplyList"
- _tip="Compose a reply to the mailing list of the selected message"
- accel="*Control*l"/>
-
- <cmd name="MessageReplySender"
- _tip="Compose a reply to the sender of the selected message"
- accel="*Control*r"
- pixtype="pixbuf"/>
-
- <cmd name="MessageSaveAs"
- _tip="Save the selected messages as a text file"
- accel="*Control*s"
- pixtype="pixbuf"/>
-
- <cmd name="MessageSearch"
- _tip="Search for text in the body of the displayed message"
- accel="*Control**Shift*f"
- pixtype="pixbuf"/>
-
- <cmd name="MessageUndelete"
- _tip="Undelete the selected messages"
- accel="*Control**Shift*d"/>
-
- <cmd name="PrintMessage"
- _tip="Print this message"
- accel="*Control*p"
- pixtype="pixbuf"/>
-
- <cmd name="PrintPreviewMessage"
- _tip="Preview the message to be printed"
- pixtype="pixbuf"/>
-
- <cmd name="PrintSetup"
- _tip="Set up the page settings for your current printer"/>
-
- <cmd name="SelectAllText"
- _tip="Select all the text in a message"
- accel="*Control**Shift*x"/>
-
- <cmd name="ToolsFilterMailingList"
- _tip="Create a rule to filter messages to this mailing list"/>
-
- <cmd name="ToolsFilterRecipient"
- _tip="Create a rule to filter messages to these recipients"/>
-
- <cmd name="ToolsFilterSender"
- _tip="Create a rule to filter messages from this sender"/>
-
- <cmd name="ToolsFilterSubject"
- _tip="Create a rule to filter messages with this subject"/>
-
- <cmd name="ToolsVFolderMailingList"
- _tip="Create a Search Folder for this mailing list"/>
-
- <cmd name="ToolsVFolderRecipient"
- _tip="Create a Search Folder for these recipients"/>
-
- <cmd name="ToolsVFolderSender"
- _tip="Create a Search Folder for this sender"/>
-
- <cmd name="ToolsVFolderSubject"
- _tip="Create a Search Folder for this subject"/>
-
- <cmd name="ViewFullHeaders"
- _tip="Show messages with all email headers"
- type="toggle" state="0"/>
-
- <cmd name="ViewLoadImages"
- _tip="Force images in HTML mail to be loaded"
- accel="*Control*i" pixtype="pixbuf"/>
-
- <cmd name="ViewSource"
- _tip="Show the raw email source of the message"
- accel="*Control*u"/>
-
- <cmd name="TextZoomIn"
- _tip="Increase the text size"
- accel="*Control*plus" pixtype="pixbuf"/>
-
- <cmd name="TextZoomOut"
- _tip="Decrease the text size"
- accel="*Control*minus" pixtype="pixbuf"/>
-
- <cmd name="TextZoomReset"
- _tip="Reset the text to its original size"
- accel="*Control*0" pixtype="pixbuf"/>
-
- </commands>
-
- <keybindings>
- <accel verb="MailPreviousUnread" name="*Control*comma"/>
- <accel verb="MailPreviousUnread" name="comma"/>
- <accel verb="MailPreviousUnread" name="bracketleft"/>
- <accel verb="MailNextUnread" name="*Control*period"/>
- <accel verb="MailNextUnread" name="period"/>
- <accel verb="MailNextUnread" name="bracketright"/>
- <accel verb="MessageDeleteKey" name="Delete"/>
- <accel verb="MessageDeleteKey" name="KP_Delete"/>
- <accel verb="MessageDeleteKey" name="*Control*d"/>
- </keybindings>
-
- <menu>
-
- <submenu name="File">
- <placeholder name="FileOps">
- <menuitem name="MessageSaveAs" verb="" _label="_Save Message..."/>
- </placeholder>
-
- <placeholder name="Print">
- <menuitem name="PrintPreviewMessage" verb="" _label="Print Pre_view"/>
- <menuitem name="PrintMessage" verb="" _label="_Print..."/>
- </placeholder>
- </submenu>
-
- <submenu name="Edit">
- <placeholder name="EditPlaceholder">
- <placeholder name="MailMessageEdit">
- <menuitem name="EditCopy" verb="" _label="_Copy"/>
-
- <separator f="" name="emaillist1"/>
-
- <menuitem name="SelectAllText" verb="" _label="Select _All Text"/>
-
- <separator f="" name="emaillist2"/>
-
- <menuitem name="MessageDelete" verb="" _label="_Delete Message"/>
- <menuitem name="MessageUndelete" verb="" _label="_Undelete Message"/>
-
- <separator f="" name="emaillist3"/>
-
- <menuitem name="MessageSearch" verb="" _label="_Find in Message..."/>
- </placeholder>
- </placeholder>
- </submenu>
-
- <submenu name="View">
- <placeholder name="MailMessageZoom">
- <submenu name="zoom" _label="_Zoom">
- <menuitem name="TextZoomIn" verb="" _label="_Zoom In"/>
- <menuitem name="TextZoomOut" verb="" _label="Zoom _Out"/>
- <menuitem name="TextZoomReset" verb="" _label="_Normal Size"/>
- </submenu>
- </placeholder>
-
- <placeholder name="MailViewType">
- <menuitem name="ViewLoadImages" verb="" _label="_Load Images"/>
- <menuitem name="ViewFullHeaders" verb="" _label="All Message _Headers"/>
- <menuitem name="CaretMode" verb="" _label="_Caret Mode"/>
- <menuitem name="ViewSource" verb="" _label="_Message Source"/>
-
- </placeholder>
-
- </submenu>
-
- <placeholder name="MessagePlaceholder">
- <submenu name="Message" _label="_Message">
- <placeholder name="MessageTopActions">
- <menuitem name="ActionCompose" verb="MailCompose" _label="Compose _New Message"/>
- <menuitem name="MessageOpen" verb="" _label="_Open in New Window"/>
- <menuitem name="MessageEdit" verb="" _label="_Edit as New Message..."/>
- <menuitem name="AddSenderToAddressbook" verb="" _label="A_dd Sender to Address Book"/>
- </placeholder>
-
- <placeholder name="MessageNavigation">
- <submenu name="GoTo" _label="_Go To" pixtype="pixbuf">
- <menuitem name="MailNext" verb="" _label="_Next Message"/>
- <menuitem name="MailNextUnread" verb="" _label="Next _Unread Message"/>
- <menuitem name="MailNextFlagged" verb="" _label="Next _Important Message"/>
- <menuitem name="MailNextThread" verb="" _label="Next _Thread"/>
- <separator f="" name="emaillist"/>
- <menuitem name="MailPrevious" verb="" _label="_Previous Message"/>
- <menuitem name="MailPreviousUnread" verb="" _label="P_revious Unread Message"/>
- <menuitem name="MailPreviousFlagged" verb="" _label="Pr_evious Important Message"/>
- </submenu>
- </placeholder>
-
- <placeholder name="MailMessageActions">
-
- <menuitem name="MessageReplySender" verb="" _label="_Reply to Sender"/>
- <menuitem name="MessageReplyList" verb="" _label="Reply to _List"/>
- <menuitem name="MessageReplyAll" verb="" _label="Reply to _All"/>
- <menuitem name="MessageForward" verb="" _label="_Forward"/>
- <submenu name="ForwardAs" _label="F_orward As...">
- <menuitem verb="MessageForwardAttached" _label="_Attached"/>
- <menuitem verb="MessageForwardInline" _label="_Inline"/>
- <menuitem verb="MessageForwardQuoted" _label="_Quoted"/>
- <separator f="" name="forwardlist1"/>
- <menuitem verb="MessageRedirect" _label="Re_direct"/>
- </submenu>
-
- <separator f="" name="emaillist3"/>
-
- <menuitem name="MessageMove" verb="" _label="_Move to Folder"/>
- <menuitem name="MessageCopy" verb="" _label="_Copy to Folder"/>
-
- <separator f="" name="emaillist4"/>
-
- <submenu name="MessageMarkAs" _label="Mar_k as">
- <!-- Translators: "Read" as in "has been read" (evolution-mail-message.xml) -->
- <menuitem name="MessageMarkAsRead" verb="" _label="_Read"/>
- <menuitem name="MessageMarkAsUnRead" verb="" _label="_Unread"/>
-
- <separator f="" name="emailmark1"/>
-
- <menuitem name="MessageMarkAsImportant" verb="" _label="_Important"/>
- <menuitem name="MessageMarkAsUnimportant" verb="" _label="Uni_mportant"/>
-
- <separator f="" name="emailmark2"/>
-
- <menuitem name="MessageMarkAsJunk" verb="" _label="_Junk"/>
- <menuitem name="MessageMarkAsNotJunk" verb="" _label="_Not Junk"/>
-
- <separator f="" name="emaillist2"/>
-
- <menuitem name="MessageFollowUpFlag" verb="" _label="Follow _Up..."/>
- <menuitem name="MessageFollowUpClear" verb="" _label="_Clear Flag"/>
- <menuitem name="MessageFollowUpComplete" verb="" _label="_Flag Completed"/>
-
- </submenu>
- <menuitem name="MessageApplyFilters" verb="" _label="A_pply Filters"/>
- <menuitem name="MessageFilterJunk" verb="" _label="Check for _Junk"/>
- </placeholder>
-
- <placeholder name="MessageRuleCreate">
- <submenu name="CreateRule" _label="Create R_ule">
- <menuitem name="ToolsVFolderSubject" verb="" _label="Search Folder from S_ubject..."/>
- <menuitem name="ToolsVFolderSender" verb="" _label="Search Folder from Sen_der..."/>
- <menuitem name="ToolsVFolderRecipient" verb="" _label="Search Folder from Recipien_ts..."/>
- <menuitem name="ToolsVFolderMailingList" verb="" _label="Search Folder from Mailing _List..."/>
-
- <separator f="" name="RuleSeparator"/>
-
- <menuitem name="ToolsFilterSubject" verb="" _label="Filter on _Subject..."/>
- <menuitem name="ToolsFilterSender" verb="" _label="Filter on Se_nder..."/>
- <menuitem name="ToolsFilterRecipient" verb="" _label="Filter on _Recipients..."/>
- <menuitem name="ToolsFilterMailingList" verb="" _label="Filter on Mailing _List..."/>
-
- </submenu>
- </placeholder>
- </submenu>
- </placeholder>
- </menu>
-
- <dockitem name="Toolbar">
-
- <placeholder name="MailMessageToolbar">
- <toolitem name="MessageReplySender" verb=""
- _label="Reply" priority="1"
- pixtype="pixbuf"/>
-
- <toolitem name="MessageReplyAll" verb=""
- _label="Reply to All" priority="1"
- pixtype="pixbuf"/>
-
- <toolitem name="MessageForward" verb=""
- _label="Forward" priority="1"
- pixtype="pixbuf"/>
-
- <separator f="" name="emaillist2"/>
-
- <toolitem name="PrintMessage" verb=""
- _label="Print"
- pixtype="pixbuf"/>
-
- <toolitem name="MessageDelete" verb=""
- _label="Delete"
- pixtype="pixbuf"/>
-
- <toolitem name="MessageMarkAsJunk" verb=""
- _label="Junk"
- pixtype="pixbuf"/>
- <toolitem name="MessageMarkAsNotJunk" verb=""
- _label="Not Junk"
- pixtype="pixbuf"/>
- </placeholder>
-
- <placeholder name="MailNextButtons">
- <toolitem name="MailPrevious" verb=""
- _label="Previous"
- pixtype="pixbuf"/>
-
- <toolitem name="MailNext" verb=""
- _label="Next"
- pixtype="pixbuf"/>
- </placeholder>
- </dockitem>
-
-</Root>
diff --git a/ui/evolution-mail-messagedisplay.xml b/ui/evolution-mail-messagedisplay.xml
deleted file mode 100644
index 7e4fcf30a9..0000000000
--- a/ui/evolution-mail-messagedisplay.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<Root>
- <commands>
- <cmd name="MessageBrowserClose" _label="Close" _tip="Close this window"
- pixtype="stock" pixname="Close" accel="*Control*w"/>
- </commands>
-
- <menu>
- <submenu name="File" _label="_File">
- <placeholder name="FileOps"/>
-
- <separator f="" name="emailmessage1"/>
-
- <placeholder name="Print"/>
-
- <separator f="" name="emailmessage2"/>
-
- <menuitem name="MessageBrowserClose" verb=""
- _label="_Close"/>
-
- </submenu>
-
- <submenu name="Edit" _label="_Edit">
- <placeholder name="EditPlaceholder"/>
- </submenu>
-
- <submenu name="View" _label="_View">
- <placeholder name="MailViewType"/>
-
- <placeholder name="MailMessageZoom"/>
- <separator f="" name="CharsetSeparator"/>
- </submenu>
-
- <placeholder name="MessagePlaceholder">
- <submenu name="Message" _label="_Message">
- <placeholder name="MessageTopActions"/>
-
- <separator f="" name="emailglobal"/>
-
- <placeholder name="MessageNavigation"/>
-
- <placeholder name="MailListActions"/>
-
- <placeholder name="MailMessageActions"/>
-
- <separator f="" name="emaillist5"/>
-
- <placeholder name="MessageRuleCreate"/>
-
- </submenu>
- </placeholder>
-
-
-<!--
- <placeholder name="MessagePlaceholder">
- <submenu name="Message" _label="_Message">
-
- <placeholder name="ComponentActionsPlaceholder">
- <placeholder name="MailMessageActions"/>
- </placeholder>
- </submenu>
- </placeholder>
--->
-
- </menu>
-
- <dockitem name="Toolbar"
- relief="none"
- behavior="exclusive"
- _tip="Main toolbar">
- <placeholder name="MailMessageToolbar"/>
- <separator f="" name="emailmessage"/>
- <placeholder name="MailNextButtons"/>
- </dockitem>
-</Root>
diff --git a/ui/evolution-mail.ui b/ui/evolution-mail.ui
index c676cf524e..4c607c9fa5 100644
--- a/ui/evolution-mail.ui
+++ b/ui/evolution-mail.ui
@@ -109,6 +109,8 @@
<menuitem action='mail-label-new'/>
</menu>
<separator/>
+ <placeholder name='mail-message-templates'/>
+ <separator/>
<placeholder name='mail-message-popup-actions'/>
</popup>
<popup name='mail-search-options'>
diff --git a/ui/evolution.xml b/ui/evolution.xml
deleted file mode 100644
index 2b4ee71d3b..0000000000
--- a/ui/evolution.xml
+++ /dev/null
@@ -1,199 +0,0 @@
-<Root>
- <commands>
- <cmd name="OpenNewWindow" _label="New _Window"
- _tip="Create a new window displaying this folder"
- accel="*Control**Shift*w"/>
-
- <cmd name="FilePageSetup" _label="Page Set_up..." _tip="Set up the page settings for your current printer"/>
-
- <cmd name="FileClose" _label="_Close Window" _tip="Close this window"
- accel="*Control*w"/>
-
- <cmd name="FileExit" _label="_Quit" _tip="Exit the program"
- accel="*Control*q"/>
-
- <cmd name="ViewButtonsIconText" _label="Icons _and Text"
- type="radio" group="button_display" _tip="Display window buttons with icons and text"/>
-
- <cmd name="ViewButtonsIcon" _label="_Icons Only"
- type="radio" group="button_display" _tip="Display window buttons with icons only"/>
-
- <cmd name="ViewButtonsText" _label="_Text Only"
- type="radio" group="button_display" _tip="Display window buttons with text only"/>
-
- <cmd name="ViewButtonsToolbar" _label="Tool_bar Style"
- type="radio" group="button_display" _tip="Display window buttons using the desktop toolbar setting"/>
-
- <cmd name="ViewButtonsHide" _label="_Hide Buttons"
- type="toggle" _tip="Hide window buttons"/>
-
- <cmd name="ViewToolbar" _label="Show _Toolbar" type="toggle"
- _tip="Change the visibility of the toolbar" state="1"/>
-
- <cmd name="ViewStatusBar" _label="Show _Status Bar" type="toggle"
- _tip="View/Hide the Status Bar" state="1"/>
-
- <cmd name="ViewSideBar" _label="Show Side _Bar" type="toggle"
- _tip="View/Hide the Side Bar" state="1"/>
-
- <cmd name="HelpSubmitBug" _label="Submit Bug Report"
- _tip="Submit a bug report using Bug Buddy"/>
-
- <cmd name="HelpOpenFAQ" _label="_Frequently Asked Questions"
- _tip="Open the Frequently Asked Questions webpage"/>
-
- <cmd name="SendReceive"
- _tip="Send queued items and retrieve new items"
- pixtype="pixbuf"/>
-
- <cmd name="ForgetPasswords"
- _tip="Forget remembered passwords so you will be prompted for them again"/>
-
- <cmd name="Settings" pixtype="stock" pixname="gtk-preferences"/>
-
- <cmd name="ToggleOffline"
- _label="Work _Offline"
- _tip="Toggle whether we are working offline."/>
-
- <cmd name="HelpAbout" _label="About Evolution..."
- _tip="Show information about Evolution"
- pixtype="stock" pixname="gtk-about"/>
- </commands>
-
- <menu>
- <submenu name="File" _label="_File">
- <submenu name="New" _label="_New" pixtype="stock" pixname="gtk-new">
- <placeholder name="ComponentItems"/>
- </submenu>
-
- <menuitem name="OpenNewWindow" verb="" pixtype="pixbuf"/>
-
- <separator f="" name="eshell4"/>
-
- <menuitem name="SendReceive" verb="" _label="Send / _Receive"
- pixtype="pixbuf" accel="F9"/>
-
- <placeholder name="FileOps"/>
-
- <separator f="" name="eshell1"/>
-
- <menuitem name="FileImporter" verb=""
- _label="I_mport..."
- _tip="Import data from other programs"
- pixtype="pixbuf"/>
-
- <placeholder name="Print" delimit="top">
- <menuitem name="FilePageSetup" verb="" pixtype="pixbuf"/>
- </placeholder>
-
-<!--
- <placeholder name="ComponentPlaceholder"/>
--->
-
- <separator f="" name="eshell5"/>
-
- <placeholder name="EmptyTrashPlaceholder"/>
-
-
- <menuitem name="ForgetPasswords" verb="" _label="_Forget Passwords"/>
-
- <menuitem name="ToggleOffline" verb=""
- _label="_Work Offline"
- pixtype="pixbuf"/>
-
- <menuitem name="FileClose" verb=""
- _label="_Close Window"
- pixtype="pixbuf"/>
-
- <menuitem name="FileExit" verb="FileExit"
- pixtype="pixbuf"/>
- </submenu>
-
- <submenu name="Edit" _label="_Edit">
- <placeholder name="EditPlaceholder"/>
- <separator/>
- <menuitem name="PilotSettings" verb="" _label="_Synchronization Options..." _tip="Set up Pilot configuration"/>
- <placeholder name="MailFilterTools"/>
- <placeholder name="MailVFolderTools"/>
-
- <placeholder name="PluginManagerPlaceholder"/>
-
- <menuitem name="Settings" verb="" _label="Prefere_nces" _tip="Change Evolution's settings" accel="*Control**Shift*s"/>
- </submenu>
-
- <submenu name="View" _label="_View">
- <placeholder name="ViewBegin"/>
- <submenu name="Window" _label="_Window"/>
- <submenu name="layout" _label="Lay_out">
- <menuitem name="ViewToolbar" id="ViewToolbar" verb=""/>
- <menuitem name="ViewStatusBar" id="ViewStatusBar"/>
- <menuitem name="ViewSideBar" id="ViewSideBar"/>
- </submenu>
- <placeholder name="ViewPreview"/>
- <submenu name="Buttons" _label="_Switcher Appearance">
- <menuitem name="ViewButtonsIconText" id="ViewButtonsIconText" verb=""/>
- <menuitem name="ViewButtonsIcon" id="ViewButtonsIcon" verb=""/>
- <menuitem name="ViewButtonsText" id="ViewButtonsText" verb=""/>
- <menuitem name="ViewButtonsGnome" id="ViewButtonsToolbar" verb=""/>
- <separator f="" name="Switcher1"/>
- <menuitem name="ViewButtonsHide" id="ViewButtonsHide" verb=""/>
- </submenu>
- <placeholder name="ViewAfterControl"/>
- </submenu>
-
- <placeholder name="FolderPlaceholder">
- </placeholder>
-
- <placeholder name="MessagePlaceholder">
- </placeholder>
-
- <placeholder name="ActionsPlaceholder">
- </placeholder>
-
- <placeholder name="SearchPlaceholder">
- </placeholder>
-
- <submenu name="Help" _label="_Help">
-
- <placeholder name="BuiltMenuItems"/>
-
- <menuitem name="QuickReference" verb=""
- _label="_Quick Reference"/>
-
- <separator f="" name="eshell2"/>
- <placeholder name="PlaceHolderDebug"/>
-
- <menuitem name="HelpOpenFAQ" verb=""
- _label="Evolution _FAQ"
- pixtype="pixbuf"/>
-
- <menuitem name="HelpSubmitBug" verb=""
- _label="Submit _Bug Report"/>
-
- <separator f="" name="eshell4"/>
-
- <menuitem name="HelpAbout" verb=""
- _label="_About"/>
-
- </submenu>
- </menu>
-
- <dockitem name="Toolbar" relief="none" behavior="exclusive" config="0" _tip="Main toolbar" look="system">
- <control name="NewComboButton"/>
- <separator f="" name="eshell4"/>
-
- <toolitem name="SendReceive" verb="SendReceive"
- _label="Send / Receive" priority="1"
- pixtype="pixbuf"/>
-
- <separator f="" name="global1"/>
-
- </dockitem>
-
- <popups>
- <popup name="NewPopup">
- <placeholder name="ComponentItems"/>
- </popup>
- </popups>
-
-</Root>