aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authornobody <nobody@localhost>2005-06-04 19:32:58 +0800
committernobody <nobody@localhost>2005-06-04 19:32:58 +0800
commitf0b6f8b31f2e89a084e326e0c49b1b578733b4c5 (patch)
tree7f6a0c236378f446ba5c5e095350d6683e2b8004 /mail
parentc2e8785c01707e3845328decba6e8429493b3a52 (diff)
downloadgsoc2013-evolution-EVOLUTION_2_2_3.tar.gz
gsoc2013-evolution-EVOLUTION_2_2_3.tar.zst
gsoc2013-evolution-EVOLUTION_2_2_3.zip
This commit was manufactured by cvs2svn to create tagEVOLUTION_2_2_3
'EVOLUTION_2_2_3'. svn path=/tags/EVOLUTION_2_2_3/; revision=29455
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog259
-rw-r--r--mail/em-account-editor.c68
-rw-r--r--mail/em-composer-utils.c213
-rw-r--r--mail/em-folder-tree.c805
-rw-r--r--mail/em-folder-view.c223
-rw-r--r--mail/em-format-html-display.c67
-rw-r--r--mail/em-format-html.c25
-rw-r--r--mail/em-format.c15
-rw-r--r--mail/em-utils.c2
-rw-r--r--mail/mail-autofilter.c5
-rw-r--r--mail/mail-autofilter.h22
-rw-r--r--mail/mail-component.c52
-rw-r--r--mail/mail-errors.xml351
-rw-r--r--mail/mail-errors.xml.h260
-rw-r--r--mail/mail-ops.c86
-rw-r--r--mail/mail-session.c2
-rw-r--r--mail/mail-signature-editor.c2
-rw-r--r--mail/mail-tools.c1
-rw-r--r--mail/message-list.c15
19 files changed, 1573 insertions, 900 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 143b8f88ec..4049bbed27 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,205 +1,3 @@
-2005-06-02 Not Zed <NotZed@Ximian.com>
-
- * Evolution-Mail.idl: only let this be included once.
-
- * mail-component.c (mail_component_class_init): Setup a test
- function, and fix the bonobo init function so we're actually a
- mailcomponent and not just an evolutioncomponent.
-
-2005-06-02 Not Zed <NotZed@Ximian.com>
-
- * mail-component.c: change this to sub-class evolution-component,
- not bonobo-object.
-
- * Evolution-Mail.idl: Made the mail component sub-class
- Evolution.Component so it can add new interfaces for remote gui
- mail operations.
-
-2005-05-31 Rodney Dawes <dobey@novell.com>
-
- * em-folder-browser.c (emfb_view_hide_read, emfb_view_show_selected):
- (emfb_view_show_all): Update these methods to use the listener method
- of access from bonobo as they are radio buttons now
- (emfb_verbs): Comment out the verbs for the above methods, as they are
- configured through add_listener now
- (emfb_enable_map): s/ViewHideSelected/ViewShowSelected/
- (emfb_activate): Add the listeners for the radio buttons for filtering
- the message list for unread, selected, or all messages
-
-2005-05-24 Rodney Dawes <dobey@novell.com>
-
- * em-folder-selector.c (folder_created_cb): Remove this unused method
- (emfs_response): Remove unused variable declarations
-
- * em-folder-view.c (emfv_popup_{load_images,selectall}): Remove
- these unused methods
-
- * mail-component.c: Include em-folder-utils.h to fix warnings
-
-2005-05-20 Not Zed <NotZed@Ximian.com>
-
- * mail-component.c (mail_component_peek_session): add helper for
- plugins to get mail session.
-
-2005-05-19 Chenthill Palanisamy <pchenthill@novell.com>
-
- * mail.error.xml: Added a error message required for
- marking messages as read in subfolders.
-
-2005-05-19 Not Zed <NotZed@Ximian.com>
-
- * em-format-html-print.c (em_format_html_print_raw_message): new
- function to print a non-foldered message. untested.
-
-2005-05-19 Not Zed <NotZed@Ximian.com>
-
- * em-folder-utils.h: fix rodney's name choices. fix
- multiple-inclusion. fix forward references. fix all callers.
- add many fixme's for the busted api's.
-
- * em-format-quote.c (emfq_format_clone): use pseudo mime type to
- find message formatter.
-
- * em-format-html-display.c (efhd_format_message): remove, it
- didn't do anything.
-
- * em-format-html.c (efh_format_message): make this a handler
- callback.
-
- * em-format.c (emf_message_rfc822): make this use the pseudo
- mime-type x-evolution/message/rfc822 instead of the hardcoded
- format_message callback.
-
- * em-format-html-display.c (efhd_message_prefix): make this use a
- pseudo-mime-type handler rather than hard-coded, so it can be
- overridden by a plugin.
-
-2005-05-17 Radek Doulik <rodo@novell.com>
-
- * em-format-html.c: removed include of htmlengine.h which wasn't
- needed
-
- * em-format-html-display.c: use top level gtkhtml API instead of
- lower level one
-
- * em-folder-view.c (emfv_popup_selectall): use gtk_html_select_all
- instead of calling html engine directly
-
-2005-05-16 Not Zed <NotZed@Ximian.com>
-
- * mail-vfolder.h:
- * mail-autofilter.h: forward-reference structures
-
- * *.h: Make installed headers includable from mail/
-
- * Makefile.am (mailinclude_HEADERS): install various mail headers
- as first cut at public plugin api.
-
- * move e-error into e-util/
-
-2005-05-16 Srinivasa Ragavan <sragavan@novell.com>
-
- * GNOME_Evolution_Mail.server.in.in: Added tooltips
-
-2005-05-13 Rodney Dawes <dobey@novell.com>
-
- * Makefile.am: Add new em-folder-utils.[ch] abstraction
-
- * em-folder-browser.c: Update for new menu layout
- Add new methods to handle the actions that were previously only
- available from the context menu when right-clicking on a folder
-
- * em-folder-selector.c (emfs_response): Just call emfu_folder_create
- if the user wants to create a new folder in the selector dialog
- (em_folder_selector_get_selected_path): Clean up the code to fix a
- couple potential crashes
-
- * em-folder-tree.[ch]: Add methods to get pointers to a CamelFolder or
- CamelFolderInfo object for the selected item in the tree
- Add a method to get a pointer to an EMFolderTreeModelStoreInfo object
- for the selected store in the tree
- Move folder operations out into em-folder-utils.[ch] so that they
- are abstracted from the tree and can be used by methods other than
- the internal context menu
-
- * em-folder-utils.[ch]: Move the folder operations code to here
-
- * em-folder-view.c: Update for the new menu layout
- Fix Mark as Read/Unread in the context menu to only show up in the list
-
- * mail-component.c (create_item): Just call emfu_folder_create here
- when the user requests to create a new folder from the New toolbar item
-
-2005-05-13 Shreyas Srinivasan <sshreyas@novell.com>
-
- * Fixes bug #273868, #300113, #302831.
-
- * mail-offline-handler.c : Add check for Camel Offline
- store to is_service_relevant.
-
-2005-04-21 Jeffrey Stedfast <fejj@novell.com>
-
- * em-composer-utils.c (post_reply_to_message): Use the real folder
- and real uid (not the virtual if replying to a message in a
- vfolder). Fixes bug #269129.
-
-2005-05-06 Vivek Jain <jvivek@novell.com>
-
- * em-folder-view.c: EPopupItem emfv_popup_items[] replace Print
- with Print... Fixes #272242
-
-2005-05-07 Sankar P <psankar@novell.com>
-
- * mail-ops.c (mail_send_message)
- Added code to prevent copying of sent items, based on provider type
-
- * em-account-editor.c (emae_defaults_page)
- Added code to disable the Sent Folders button
-
-2005-05-06 Not Zed <NotZed@Ximian.com>
-
- * mail.error.xml: renamed from mail-errors.xml, add i18n tags, fix
- some whitespace issues. Removed some unecessary translations.
-
-2005-05-06 Chenthill Palanisamy <pchenthill@novell.com>
-
- * evolution-mail.schemas.in.in: Removed the schema
- /schemas/apps/evolution/mail/junk/sa/daemon_port
- since its not used anymore.
-
-2005-05-06 Sarfraaz Ahmed <asarfraaz@novell.com>
-
- * mail/mail-errors.xml : Fixed a typo for #272786
-
-2005-05-05 Radek Doulik <rodo@site>
-
- * em-folder-view.c (em_folder_view_get_popup_target): use
- gtk_html_command to ask if selection is active tto avoid using
- selection API directly
- (emfv_popup_copy_text): use gtkhtml API instead of engine API
- (emfv_message_reply): use new gtk_html_get_selection_html function
- to avoid using low level gtkhtml APIs
-
-2005-05-03 Radek Doulik <rodo@site>
-
- * em-format-html-display.c: removed include of htmlinterval.h as
- it's not needed
-
-2005-04-28 Parthasarathi Susarla <sparthasarathi@novell.com>
-
- * em-folder-view.c (emfv_set_folder): remove a call to
- refresh folder from here
- * em-folder-browser.c (emfb_set_folder): call
- mail_refresh_folder here
-
-2005-04-28 Not Zed <NotZed@Ximian.com>
-
- * message-list.c: add some message list loading/profiling points,
- "list".
-
- * em-folder-view.c: add some message display/loading profiling
- points, "goto".
-
2005-04-12 Not Zed <NotZed@Ximian.com>
** See bug #273752
@@ -207,36 +5,15 @@
* em-folder-tree.c (emft_drop_folder_rec): handle NULL
"parent_name" - dropping to store node.
-2005-04-08 Jeffrey Stedfast <fejj@novell.com>
-
- * em-composer-utils.c (em_utils_send_receipt): Simplify the
- scanning for '@' by using strchr().
-
-2005-04-08 Not Zed <NotZed@Ximian.com>
-
- * em-composer-utils.c (em_utils_ask_receipt): removed.
- (em_utils_handle_receipt): asynchronously load message if none is
- supplied.
+2005-04-06 Rodney Dawes <dobey@novell.com>
- * em-folder-view.c (emfv_set_seen): pass message in.
-
- * em-composer-utils.c (em_utils_ask_receipt): strip leading lwsp
- on the disposition address.
- (em_utils_ask_receipt): added a comment about which rfc.
- (em_utils_handle_receipt): merged ask_receipt into here. Changed
- api to take a message instead, so we don't have to load the
- message every time. Also only set receipt-handled if we have a
- receipt requested in the first place.
-
-2005-04-05 ERDI Gergo <cactus@cactus.rulez.org>
-
- * mail-errors.xml: Added new dialog for receipt requests
-
- * em-composer-utils.c (em_utils_guess_account): Made guess_account
- public, to be callable from em-folder-view
- (em_utils_send_receipt): New function to send an RFC
- 2298-compliant message delivery notification
+ * em-folder-view.c (emfv_popup_items): Add Mark as Read/Unread back
+ to the context menu
+ Fix the ordering values for some menu items in the context menu that
+ had duplicate order values
+ Fixes bug #73192
+
2005-04-05 Not Zed <NotZed@Ximian.com>
** See bug #74320
@@ -244,13 +21,6 @@
* em-format.c (em_format_part_as): if the snooped type is NULL,
fall back to application/octet-stream.
-2005-04-04 Rodney Dawes <dobey@novell.com>
-
- * em-folder-view.c (emfv_popup_items): Add Mark as Read/Unread back
- to the context menu (#73192)
- Fix the ordering values for some menu items in the context menu that
- had duplicate order values
-
2005-03-31 Not Zed <NotZed@Ximian.com>
** See bug #72935
@@ -270,15 +40,6 @@
have 1 message selected, otherwise we don't update the menu's.
Fixes a problem introduced by 64987's fix.
-2005-03-30 Li Yuan <li.yuan@sun.com>
-
- * em-account-prefs.c: (em_account_prefs_treeview_new):
- add a11y name to Mail Accounts Table
- * mail-config.glade:
- add a11y name to tables in Mail Preferences page and
- Composer Preferences page.
- Fixes #73914
-
2005-03-16 Jeffrey Stedfast <fejj@novell.com>
* em-format-html.c (efh_format_headers): Don't show multiple
@@ -439,8 +200,8 @@
2005-02-25 Mengjie Yu <meng-jie.yu@sun.com>
- * em-folder-browser.c (emfb_edit_select_all): make the 'select
- all' work in all conditions.
+ * em-folder-browser.c: (emfb_edit_select_all):make the 'select all'
+ work in all conditions.
Fixes #72545
@@ -502,7 +263,7 @@
2005-02-22 Marco Pesenti Gritti <marco@gnome.org>
- * mail/em-popup.c (emp_apps_open_in, emp_standard_menu_factory):
+ * mail/em-popup.c: (emp_apps_open_in), (emp_standard_menu_factory):
Use gnome-vfs API to launch external applications
2005-02-22 Not Zed <NotZed@Ximian.com>
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index f9b417109f..3e25485134 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -70,7 +70,7 @@
#include <e-util/e-account-list.h>
#include <e-util/e-signature-list.h>
-#include "e-util/e-error.h"
+#include <widgets/misc/e-error.h>
#include "em-config.h"
#include "em-folder-selection-button.h"
@@ -724,64 +724,6 @@ emae_setup_signatures(EMAccountEditor *emae, GladeXML *xml)
}
static void
-emae_receipt_policy_changed(GtkComboBox *dropdown, EMAccountEditor *emae)
-{
- int id = gtk_combo_box_get_active(dropdown);
- GtkTreeModel *model;
- GtkTreeIter iter;
- EAccountReceiptPolicy policy;
-
- if (id != -1) {
- model = gtk_combo_box_get_model(dropdown);
- if (gtk_tree_model_iter_nth_child(model, &iter, NULL, id)) {
- gtk_tree_model_get(model, &iter, 1, &policy, -1);
- e_account_set_int (emae->account, E_ACCOUNT_RECEIPT_POLICY, policy);
- }
- }
-
-}
-
-static GtkWidget *
-emae_setup_receipt_policy (EMAccountEditor *emae, GladeXML *xml)
-{
- GtkComboBox *dropdown = (GtkComboBox *)glade_xml_get_widget(xml, "receipt_policy_dropdown");
- GtkListStore *store;
- int i = 0, active = 0;
- GtkTreeIter iter;
- EAccountReceiptPolicy current = emae->account->receipt_policy;
- static struct {
- EAccountReceiptPolicy policy;
- char *label;
- } receipt_policies[] = {
- { E_ACCOUNT_RECEIPT_NEVER, N_("Never") },
- { E_ACCOUNT_RECEIPT_ALWAYS, N_("Always") },
- { E_ACCOUNT_RECEIPT_ASK, N_("Ask for each message") }
- };
-
- gtk_widget_show((GtkWidget *)dropdown);
-
- store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
-
- for (i = 0; i < 3; ++i) {
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- 0, _(receipt_policies[i].label),
- 1, receipt_policies[i].policy,
- -1);
- if (current == receipt_policies[i].policy)
- active = i;
- }
-
- gtk_combo_box_set_model(dropdown, (GtkTreeModel *)store);
- gtk_combo_box_set_active(dropdown, active);
-
- g_signal_connect(dropdown, "changed", G_CALLBACK(emae_receipt_policy_changed), emae);
- gtk_widget_set_sensitive((GtkWidget *)dropdown, e_account_writable(emae->account, E_ACCOUNT_RECEIPT_POLICY));
-
- return (GtkWidget *)dropdown;
-}
-
-static void
emae_account_entry_changed(GtkEntry *entry, EMAccountEditor *emae)
{
int item = GPOINTER_TO_INT(g_object_get_data((GObject *)entry, "account-item"));
@@ -2135,14 +2077,10 @@ emae_defaults_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st
emae_account_entry(emae, "bcc_addrs", E_ACCOUNT_BCC_ADDRS, xml);
gtk_widget_set_sensitive((GtkWidget *)gui->drafts_folder_button, e_account_writable(emae->account, E_ACCOUNT_DRAFTS_FOLDER_URI));
- gtk_widget_set_sensitive((GtkWidget *)gui->sent_folder_button, e_account_writable(emae->account, E_ACCOUNT_SENT_FOLDER_URI)&& !(emae->priv->source.provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER));
+ gtk_widget_set_sensitive((GtkWidget *)gui->sent_folder_button, e_account_writable(emae->account, E_ACCOUNT_SENT_FOLDER_URI));
gtk_widget_set_sensitive((GtkWidget *)gui->restore_folders_button,
- (e_account_writable(emae->account, E_ACCOUNT_SENT_FOLDER_URI) &&
- ! ( emae->priv->source.provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER))
+ e_account_writable(emae->account, E_ACCOUNT_SENT_FOLDER_URI)
|| e_account_writable(emae->account, E_ACCOUNT_DRAFTS_FOLDER_URI));
-
- /* Receipt policy */
- emae_setup_receipt_policy (emae, xml);
w = glade_xml_get_widget(xml, item->label);
gtk_notebook_append_page((GtkNotebook *)parent, w, gtk_label_new(_("Defaults")));
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 38bcb99a4b..4f8ecb951a 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -38,7 +38,7 @@
#include "mail-send-recv.h"
#include "mail-component.h"
-#include "e-util/e-error.h"
+#include "widgets/misc/e-error.h"
#include "em-utils.h"
#include "em-composer-utils.h"
@@ -50,11 +50,9 @@
#include "e-util/e-account-list.h"
#include <camel/camel-string-utils.h>
-#include <camel/camel-stream-mem.h>
#include <camel/camel-nntp-address.h>
-#include <camel/camel-vee-folder.h>
-static EAccount * guess_account (CamelMimeMessage *message, CamelFolder *folder);
+static EAccount *guess_account (CamelMimeMessage *message, CamelFolder *folder);
struct emcs_t {
unsigned int ref_count;
@@ -192,7 +190,6 @@ composer_send_queued_cb (CamelFolder *folder, CamelMimeMessage *msg, CamelMessag
if (emcs && emcs->folder) {
/* set any replied flags etc */
camel_folder_set_message_flags (emcs->folder, emcs->uid, emcs->flags, emcs->set);
- camel_folder_set_message_user_flag (emcs->folder, emcs->uid, "receipt-handled", TRUE);
camel_object_unref (emcs->folder);
emcs->folder = NULL;
g_free (emcs->uid);
@@ -1069,188 +1066,6 @@ em_utils_redirect_message_by_uid (CamelFolder *folder, const char *uid)
mail_get_message (folder, uid, redirect_msg, NULL, mail_thread_new);
}
-static void
-emu_handle_receipt_message(CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data)
-{
- if (msg)
- em_utils_handle_receipt(folder, uid, msg);
-}
-
-/* Message disposition notifications, rfc 2298 */
-void
-em_utils_handle_receipt (CamelFolder *folder, const char *uid, CamelMimeMessage *msg)
-{
- EAccount *account;
- const char *addr;
- CamelMessageInfo *info;
-
- info = camel_folder_get_message_info(folder, uid);
- if (info == NULL)
- return;
-
- if (camel_message_info_user_flag(info, "receipt-handled")) {
- camel_message_info_free(info);
- return;
- }
-
- if (msg == NULL) {
- mail_get_message(folder, uid, emu_handle_receipt_message, NULL, mail_thread_new);
- camel_message_info_free(info);
- return;
- }
-
- if ( (addr = camel_medium_get_header((CamelMedium *)msg, "Disposition-Notification-To")) == NULL) {
- camel_message_info_free(info);
- return;
- }
-
- camel_message_info_set_user_flag(info, "receipt-handled", TRUE);
- camel_message_info_free(info);
-
- account = guess_account(msg, folder);
-
- /* TODO: should probably decode/format the address, it could be in rfc2047 format */
- if (addr == NULL) {
- addr = "";
- } else {
- while (camel_mime_is_lwsp(*addr))
- addr++;
- }
-
- if (account->receipt_policy == E_ACCOUNT_RECEIPT_ALWAYS
- || (account->receipt_policy == E_ACCOUNT_RECEIPT_ASK
- && e_error_run (NULL, "mail:ask-receipt", addr, camel_mime_message_get_subject(msg)) == GTK_RESPONSE_YES))
- em_utils_send_receipt(folder, msg);
-}
-
-static void
-em_utils_receipt_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info,
- int queued, const char *appended_uid, void *data)
-{
- camel_message_info_free (info);
- mail_send ();
-}
-
-
-void
-em_utils_send_receipt (CamelFolder *folder, CamelMimeMessage *message)
-{
- /* See RFC #2298 for a description of message receipts */
- EAccount *account = guess_account (message, folder);
- CamelMimeMessage *receipt = camel_mime_message_new ();
- CamelMultipart *body = camel_multipart_new ();
- CamelMimePart *part;
- CamelDataWrapper *receipt_text, *receipt_data;
- CamelContentType *type;
- CamelInternetAddress *addr;
- CamelStream *stream;
- CamelFolder *out_folder;
- CamelMessageInfo *info;
- const char *message_id = camel_medium_get_header (CAMEL_MEDIUM (message), "Message-ID");
- const char *message_date = camel_medium_get_header (CAMEL_MEDIUM (message), "Date");
- const char *message_subject = camel_mime_message_get_subject (message);
- const char *receipt_address = camel_medium_get_header (CAMEL_MEDIUM (message), "Disposition-Notification-To");
- char *fake_msgid;
- char *hostname;
- char *self_address, *receipt_subject;
- char *ua, *recipient;
-
- if (!receipt_address)
- return;
-
- /* Collect information for the receipt */
-
- /* We use camel_header_msgid_generate () to get a canonical
- * hostname, then skip the part leading to '@' */
- hostname = strchr ((fake_msgid = camel_header_msgid_generate ()), '@');
- hostname++;
-
- self_address = account->id->address;
-
- if (!message_id)
- message_id = "";
- if (!message_date)
- message_date ="";
-
- /* Create toplevel container */
- camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (body),
- "multipart/report;"
- "report-type=\"disposition-notification\"");
- camel_multipart_set_boundary (body, NULL);
-
- /* Create textual receipt */
- receipt_text = camel_data_wrapper_new ();
- type = camel_content_type_new ("text", "plain");
- camel_content_type_set_param (type, "format", "flowed");
- camel_data_wrapper_set_mime_type_field (receipt_text, type);
- camel_content_type_unref (type);
- stream = camel_stream_mem_new ();
- camel_stream_printf (stream,
- "Your message to %s about \"%s\" on %s has been read.",
- self_address, message_subject, message_date);
- camel_data_wrapper_construct_from_stream (receipt_text, stream);
- camel_object_unref (stream);
-
- part = camel_mime_part_new ();
- camel_medium_set_content_object (CAMEL_MEDIUM (part), receipt_text);
- camel_object_unref (receipt_text);
- camel_multipart_add_part (body, part);
- camel_object_unref (part);
-
- /* Create the machine-readable receipt */
- receipt_data = camel_data_wrapper_new ();
- type = camel_content_type_new ("message", "disposition-notification");
- camel_data_wrapper_set_mime_type_field (receipt_data, type);
- camel_content_type_unref (type);
- stream = camel_stream_mem_new ();
- part = camel_mime_part_new ();
-
- ua = g_strdup_printf ("%s; %s", hostname, "Evolution " VERSION SUB_VERSION " " VERSION_COMMENT);
- recipient = g_strdup_printf ("rfc822; %s", self_address);
-
- camel_medium_add_header (CAMEL_MEDIUM (part), "Reporting-UA", ua);
- camel_medium_add_header (CAMEL_MEDIUM (part), "Final-Recipient", recipient);
- camel_medium_add_header (CAMEL_MEDIUM (part), "Original-Message-ID", message_id);
- camel_medium_add_header (CAMEL_MEDIUM (part), "Disposition", "manual-action/MDN-sent-manually; displayed");
-
- g_free (ua);
- g_free (recipient);
- g_free (fake_msgid);
-
- camel_data_wrapper_construct_from_stream (receipt_data, stream);
- camel_object_unref (stream);
- camel_medium_set_content_object (CAMEL_MEDIUM (part), receipt_data);
- camel_object_unref (receipt_data);
- camel_multipart_add_part (body, part);
- camel_object_unref (part);
-
- /* Finish creating the message */
- camel_medium_set_content_object (CAMEL_MEDIUM (receipt), CAMEL_DATA_WRAPPER (body));
- camel_object_unref (body);
-
- receipt_subject = g_strdup_printf ("Delivery Notification for: \"%s\"", message_subject);
- camel_mime_message_set_subject (receipt, receipt_subject);
- g_free (receipt_subject);
-
- addr = camel_internet_address_new ();
- camel_address_decode (CAMEL_ADDRESS (addr), self_address);
- camel_mime_message_set_recipients (receipt, CAMEL_RECIPIENT_TYPE_TO, addr);
- camel_object_unref (addr);
-
- addr = camel_internet_address_new ();
- camel_address_decode (CAMEL_ADDRESS (addr), receipt_address);
- camel_mime_message_set_from (receipt, addr);
- camel_object_unref (addr);
-
- camel_medium_set_header (CAMEL_MEDIUM (receipt), "Return-Path", "<>");
-
- /* Send the receipt */
- out_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX);
- info = camel_message_info_new (NULL);
- camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
- mail_append_mail (out_folder, receipt, info, em_utils_receipt_done, 0);
-}
-
/* Replying to messages... */
static GHashTable *
@@ -1959,29 +1774,15 @@ post_reply_to_message (CamelFolder *folder, const char *uid, CamelMimeMessage *m
const char *message_id, *references;
CamelInternetAddress *to;
EDestination **tov = NULL;
- CamelFolder *real_folder;
EMsgComposer *composer;
char *subject, *url;
EAccount *account;
- char *real_uid;
guint32 flags;
if (message == NULL)
return;
- if (CAMEL_IS_VEE_FOLDER (folder)) {
- CamelMessageInfo *info;
-
- info = camel_folder_get_message_info (folder, uid);
- real_folder = camel_vee_folder_get_location ((CamelVeeFolder *) folder, (struct _CamelVeeMessageInfo *) info, &real_uid);
- camel_folder_free_message_info (folder, info);
- } else {
- real_folder = folder;
- camel_object_ref (folder);
- real_uid = g_strdup (uid);
- }
-
- account = guess_account (message, real_folder);
+ account = guess_account (message, folder);
flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_SEEN;
to = camel_internet_address_new();
@@ -2006,7 +1807,7 @@ post_reply_to_message (CamelFolder *folder, const char *uid, CamelMimeMessage *m
g_free (subject);
- url = mail_tools_folder_to_url (real_folder);
+ url = mail_tools_folder_to_url (folder);
e_msg_composer_hdrs_set_post_to ((EMsgComposerHdrs *) composer->hdrs, url);
g_free (url);
@@ -2035,14 +1836,12 @@ post_reply_to_message (CamelFolder *folder, const char *uid, CamelMimeMessage *m
composer_set_body (composer, message, NULL);
- em_composer_utils_setup_callbacks (composer, real_folder, real_uid, flags, flags, NULL, NULL);
+ em_composer_utils_setup_callbacks (composer, folder, uid, flags, flags, NULL, NULL);
gtk_widget_show (GTK_WIDGET (composer));
e_msg_composer_unset_changed (composer);
-
- camel_object_unref (real_folder);
+
camel_object_unref(to);
- g_free (real_uid);
}
/**
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 426c8527e2..d0e34e9e83 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -51,7 +51,8 @@
#include "e-util/e-mktemp.h"
#include "e-util/e-request.h"
#include "e-util/e-icon-factory.h"
-#include "e-util/e-error.h"
+
+#include "widgets/misc/e-error.h"
#include "em-vfolder-rule.h"
@@ -66,7 +67,6 @@
#include "em-popup.h"
#include "em-marshal.h"
#include "em-folder-tree.h"
-#include "em-folder-utils.h"
#include "em-folder-selector.h"
#include "em-folder-selection.h"
#include "em-folder-properties.h"
@@ -2002,40 +2002,598 @@ emft_popup_open_new (GtkWidget *item, EMFolderTree *emft)
}
#endif
+
+struct _EMCopyFolders {
+ struct _mail_msg msg;
+
+ /* input data */
+ CamelStore *fromstore;
+ CamelStore *tostore;
+
+ char *frombase;
+ char *tobase;
+
+ int delete;
+};
+
+static char *
+emft_copy_folders__desc (struct _mail_msg *mm, int complete)
+{
+ struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm;
+
+ return g_strdup_printf (_("Copying `%s' to `%s'"), m->frombase, m->tobase);
+}
+
static void
-emft_popup_copy(EPopup *ep, EPopupItem *item, void *data)
+emft_copy_folders__copy (struct _mail_msg *mm)
{
- EMFolderTree *emft = data;
- CamelFolderInfo *fi = NULL;
+ struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm;
+ guint32 flags = CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_RECURSIVE;
+ GList *pending = NULL, *deleting = NULL, *l;
+ GString *fromname, *toname;
+ CamelFolderInfo *fi;
+ const char *tmp;
+ int fromlen;
+
+ if (camel_store_supports_subscriptions (m->fromstore))
+ flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
+
+ if (!(fi = camel_store_get_folder_info (m->fromstore, m->frombase, flags, &mm->ex)))
+ return;
+
+ pending = g_list_append (pending, fi);
+
+ toname = g_string_new ("");
+ fromname = g_string_new ("");
+
+ tmp = strrchr (m->frombase, '/');
+ if (tmp == NULL)
+ fromlen = 0;
+ else
+ fromlen = tmp - m->frombase + 1;
+
+ d(printf ("top name is '%s'\n", fi->full_name));
+
+ while (pending) {
+ CamelFolderInfo *info = pending->data;
+
+ pending = g_list_remove_link (pending, pending);
+ while (info) {
+ CamelFolder *fromfolder, *tofolder;
+ GPtrArray *uids;
+ int deleted = 0;
+
+ if (info->child)
+ pending = g_list_append (pending, info->child);
+
+ if (m->tobase[0])
+ g_string_printf (toname, "%s/%s", m->tobase, info->full_name + fromlen);
+ else
+ g_string_printf (toname, "%s", info->full_name + fromlen);
+
+ d(printf ("Copying from '%s' to '%s'\n", info->full_name, toname->str));
+
+ /* This makes sure we create the same tree, e.g. from a nonselectable source */
+ /* Not sure if this is really the 'right thing', e.g. for spool stores, but it makes the ui work */
+ if ((info->flags & CAMEL_FOLDER_NOSELECT) == 0) {
+ d(printf ("this folder is selectable\n"));
+ if (m->tostore == m->fromstore && m->delete) {
+ camel_store_rename_folder (m->fromstore, info->full_name, toname->str, &mm->ex);
+ if (camel_exception_is_set (&mm->ex))
+ goto exception;
+
+ /* this folder no longer exists, unsubscribe it */
+ if (camel_store_supports_subscriptions (m->fromstore))
+ camel_store_unsubscribe_folder (m->fromstore, info->full_name, NULL);
+
+ deleted = 1;
+ } else {
+ if (!(fromfolder = camel_store_get_folder (m->fromstore, info->full_name, 0, &mm->ex)))
+ goto exception;
+
+ if (!(tofolder = camel_store_get_folder (m->tostore, toname->str, CAMEL_STORE_FOLDER_CREATE, &mm->ex))) {
+ camel_object_unref (fromfolder);
+ goto exception;
+ }
+
+ uids = camel_folder_get_uids (fromfolder);
+ camel_folder_transfer_messages_to (fromfolder, uids, tofolder, NULL, m->delete, &mm->ex);
+ camel_folder_free_uids (fromfolder, uids);
+
+ if (m->delete)
+ camel_folder_sync(fromfolder, TRUE, NULL);
+
+ camel_object_unref (fromfolder);
+ camel_object_unref (tofolder);
+ }
+ }
+
+ if (camel_exception_is_set (&mm->ex))
+ goto exception;
+ else if (m->delete && !deleted)
+ deleting = g_list_prepend (deleting, info);
+
+ /* subscribe to the new folder if appropriate */
+ if (camel_store_supports_subscriptions (m->tostore)
+ && !camel_store_folder_subscribed (m->tostore, toname->str))
+ camel_store_subscribe_folder (m->tostore, toname->str, NULL);
+
+ info = info->next;
+ }
+ }
+
+ /* delete the folders in reverse order from how we copyied them, if we are deleting any */
+ l = deleting;
+ while (l) {
+ CamelFolderInfo *info = l->data;
+
+ d(printf ("deleting folder '%s'\n", info->full_name));
+
+ /* FIXME: we need to do something with the exception
+ since otherwise the users sees a failed operation
+ with no error message or even any warnings */
+ if (camel_store_supports_subscriptions (m->fromstore))
+ camel_store_unsubscribe_folder (m->fromstore, info->full_name, NULL);
+
+ camel_store_delete_folder (m->fromstore, info->full_name, NULL);
+ l = l->next;
+ }
+
+ exception:
+
+ camel_store_free_folder_info (m->fromstore, fi);
+ g_list_free (deleting);
+
+ g_string_free (toname, TRUE);
+ g_string_free (fromname, TRUE);
+}
+
+static void
+emft_copy_folders__free (struct _mail_msg *mm)
+{
+ struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm;
+
+ camel_object_unref (m->fromstore);
+ camel_object_unref (m->tostore);
+
+ g_free (m->frombase);
+ g_free (m->tobase);
+}
+
+static struct _mail_msg_op copy_folders_op = {
+ emft_copy_folders__desc,
+ emft_copy_folders__copy,
+ NULL,
+ emft_copy_folders__free,
+};
+
+static void
+emft_copy_folders (CamelStore *tostore, const char *tobase, CamelStore *fromstore, const char *frombase, int delete)
+{
+ struct _EMCopyFolders *m;
+
+ m = mail_msg_new (&copy_folders_op, NULL, sizeof (struct _EMCopyFolders));
+ camel_object_ref (fromstore);
+ m->fromstore = fromstore;
+ camel_object_ref (tostore);
+ m->tostore = tostore;
+ m->frombase = g_strdup (frombase);
+ m->tobase = g_strdup (tobase);
+ m->delete = delete;
+
+ e_thread_put (mail_thread_new, (EMsg *) m);
+}
+
+struct _copy_folder_data {
+ EMFolderTree *emft;
+ gboolean delete;
+};
- if ((fi = em_folder_tree_get_selected_folder_info (emft)) != NULL) {
- em_folder_utils_copy_folder (fi);
+static void
+emft_popup_copy_folder_selected (const char *uri, void *data)
+{
+ struct _copy_folder_data *cfd = data;
+ struct _EMFolderTreePrivate *priv;
+ CamelStore *fromstore = NULL, *tostore = NULL;
+ char *tobase = NULL, *frombase = NULL, *fromuri = NULL;
+ CamelException ex;
+ CamelURL *url;
+
+ if (uri == NULL) {
+ g_free (cfd);
+ return;
+ }
+
+ priv = cfd->emft->priv;
+
+ camel_exception_init (&ex);
+
+ fromuri = em_folder_tree_get_selected_uri(cfd->emft);
+ g_return_if_fail(fromuri != NULL);
+ frombase = em_folder_tree_get_selected_path(cfd->emft);
+ g_return_if_fail(frombase != NULL);
+
+ if (!(fromstore = camel_session_get_store (session, fromuri, &ex))) {
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *) cfd->emft),
+ cfd->delete?"mail:no-move-folder-notexist":"mail:no-copy-folder-notexist", frombase, uri, ex.desc, NULL);
+ goto fail;
+ }
+
+ if (cfd->delete && fromstore == mail_component_peek_local_store (NULL) && is_special_local_folder (frombase)) {
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *) cfd->emft),
+ "mail:no-rename-special-folder", frombase, NULL);
+ goto fail;
+ }
+
+ if (!(tostore = camel_session_get_store (session, uri, &ex))) {
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *) cfd->emft),
+ cfd->delete?"mail:no-move-folder-to-notexist":"mail:no-copy-folder-to-notexist", frombase, uri, ex.desc, NULL);
+ goto fail;
}
+
+ url = camel_url_new (uri, NULL);
+ if (((CamelService *)tostore)->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)
+ tobase = url->fragment;
+ else if (url->path && url->path[0])
+ tobase = url->path+1;
+ if (tobase == NULL)
+ tobase = "";
+
+ emft_copy_folders (tostore, tobase, fromstore, frombase, cfd->delete);
+
+ camel_url_free (url);
+fail:
+ if (fromstore)
+ camel_object_unref(fromstore);
+ if (tostore)
+ camel_object_unref(tostore);
+ g_free(frombase);
+ g_free(fromuri);
+ camel_exception_clear (&ex);
+ g_free (cfd);
+}
+
+/* tree here is the 'destination' selector, not 'self' */
+static gboolean
+emft_popup_copy_folder_exclude(EMFolderTree *tree, GtkTreeModel *model, GtkTreeIter *iter, void *data)
+{
+ struct _copy_folder_data *cfd = data;
+ int fromvfolder, tovfolder;
+ char *fromuri, *touri;
+ guint flags;
+ gboolean is_store;
+
+ /* handles moving to/from vfolders */
+
+ fromuri = em_folder_tree_get_selected_uri(cfd->emft);
+ fromvfolder = strncmp(fromuri, "vfolder:", 8) == 0;
+ gtk_tree_model_get(model, iter, COL_STRING_URI, &touri, COL_UINT_FLAGS, &flags, COL_BOOL_IS_STORE, &is_store, -1);
+ tovfolder = strncmp(touri, "vfolder:", 8) == 0;
+ g_free(fromuri);
+ g_free(touri);
+
+ /* moving from vfolder to normal- not allowed */
+ if (fromvfolder && !tovfolder && cfd->delete)
+ return FALSE;
+ /* copy/move from normal folder to vfolder - not allowed */
+ if (!fromvfolder && tovfolder)
+ return FALSE;
+ /* copying to vfolder - not allowed */
+ if (tovfolder && !cfd->delete)
+ return FALSE;
+
+ return (flags & EMFT_EXCLUDE_NOINFERIORS) == 0;
+}
+
+static void
+emft_popup_copy(EPopup *ep, EPopupItem *item, void *data)
+{
+ EMFolderTree *emft = data;
+ struct _copy_folder_data *cfd;
+
+ cfd = g_malloc (sizeof (*cfd));
+ cfd->emft = emft;
+ cfd->delete = FALSE;
+
+ em_select_folder (NULL, _("Select folder"), _("C_opy"),
+ NULL, emft_popup_copy_folder_exclude, emft_popup_copy_folder_selected, cfd);
}
static void
emft_popup_move(EPopup *ep, EPopupItem *item, void *data)
{
EMFolderTree *emft = data;
- CamelFolderInfo *fi = NULL;
+ struct _copy_folder_data *cfd;
+
+ cfd = g_malloc (sizeof (*cfd));
+ cfd->emft = emft;
+ cfd->delete = TRUE;
+
+ em_select_folder (NULL, _("Select folder"), _("_Move"),
+ NULL, emft_popup_copy_folder_exclude, emft_popup_copy_folder_selected, cfd);
+}
+
+
+struct _EMCreateFolder {
+ struct _mail_msg msg;
+
+ /* input data */
+ CamelStore *store;
+ char *full_name;
+ char *parent;
+ char *name;
+
+ /* output data */
+ CamelFolderInfo *fi;
+
+ /* callback data */
+ void (* done) (CamelFolderInfo *fi, void *user_data);
+ void *user_data;
+};
+
+static char *
+emft_create_folder__desc (struct _mail_msg *mm, int done)
+{
+ struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
+
+ return g_strdup_printf (_("Creating folder `%s'"), m->full_name);
+}
+
+static void
+emft_create_folder__create (struct _mail_msg *mm)
+{
+ struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
+
+ d(printf ("creating folder parent='%s' name='%s' full_name='%s'\n", m->parent, m->name, m->full_name));
+
+ if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &mm->ex))) {
+ if (camel_store_supports_subscriptions (m->store))
+ camel_store_subscribe_folder (m->store, m->full_name, &mm->ex);
+ }
+}
+
+static void
+emft_create_folder__created (struct _mail_msg *mm)
+{
+ struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
+
+ if (m->done)
+ m->done (m->fi, m->user_data);
+}
+
+static void
+emft_create_folder__free (struct _mail_msg *mm)
+{
+ struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
+
+ camel_store_free_folder_info (m->store, m->fi);
+ camel_object_unref (m->store);
+ g_free (m->full_name);
+ g_free (m->parent);
+ g_free (m->name);
+}
+
+static struct _mail_msg_op create_folder_op = {
+ emft_create_folder__desc,
+ emft_create_folder__create,
+ emft_create_folder__created,
+ emft_create_folder__free,
+};
+
+
+static int
+emft_create_folder (CamelStore *store, const char *full_name, void (* done) (CamelFolderInfo *fi, void *user_data), void *user_data)
+{
+ char *name, *namebuf = NULL;
+ struct _EMCreateFolder *m;
+ const char *parent;
+ int id;
+
+ namebuf = g_strdup (full_name);
+ if (!(name = strrchr (namebuf, '/'))) {
+ name = namebuf;
+ parent = "";
+ } else {
+ *name++ = '\0';
+ parent = namebuf;
+ }
+
+ m = mail_msg_new (&create_folder_op, NULL, sizeof (struct _EMCreateFolder));
+ camel_object_ref (store);
+ m->store = store;
+ m->full_name = g_strdup (full_name);
+ m->parent = g_strdup (parent);
+ m->name = g_strdup (name);
+ m->user_data = user_data;
+ m->done = done;
+
+ g_free (namebuf);
+
+ id = m->msg.seq;
+ e_thread_put (mail_thread_new, (EMsg *) m);
+
+ return id;
+}
+
+static void
+created_cb (CamelFolderInfo *fi, void *user_data)
+{
+ gboolean *created = user_data;
+
+ *created = fi ? TRUE : FALSE;
+}
+
+gboolean
+em_folder_tree_create_folder (EMFolderTree *emft, const char *full_name, const char *uri)
+{
+ struct _EMFolderTreePrivate *priv = emft->priv;
+ struct _EMFolderTreeModelStoreInfo *si;
+ gboolean created = FALSE;
+ CamelStore *store;
+ CamelException ex;
+
+ d(printf ("Creating folder: %s (%s)\n", full_name, uri));
+
+ camel_exception_init (&ex);
+ if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+ "mail:no-create-folder-nostore", full_name, ex.desc, NULL);
+ goto fail;
+ }
+
+ if (!(si = g_hash_table_lookup (priv->model->store_hash, store))) {
+ abort();
+ camel_object_unref (store);
+ goto fail;
+ }
+
+ camel_object_unref (store);
+
+ mail_msg_wait (emft_create_folder (si->store, full_name, created_cb, &created));
+fail:
+ camel_exception_clear(&ex);
+
+ return created;
+}
+
+static void
+new_folder_created_cb (CamelFolderInfo *fi, void *user_data)
+{
+ EMFolderSelector *emfs = user_data;
+
+ if (fi)
+ gtk_widget_destroy ((GtkWidget *) emfs);
+
+ g_object_unref (emfs);
+}
- if ((fi = em_folder_tree_get_selected_folder_info (emft)) != NULL) {
- em_folder_utils_copy_folder(fi);
+static void
+emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTree *emft)
+{
+ struct _EMFolderTreePrivate *priv = emft->priv;
+ struct _EMFolderTreeModelStoreInfo *si;
+ const char *uri, *path;
+ CamelException ex;
+ CamelStore *store;
+
+ if (response != GTK_RESPONSE_OK) {
+ gtk_widget_destroy ((GtkWidget *) emfs);
+ return;
}
+
+ uri = em_folder_selector_get_selected_uri (emfs);
+ path = em_folder_selector_get_selected_path (emfs);
+
+ d(printf ("Creating new folder: %s (%s)\n", path, uri));
+
+ camel_exception_init (&ex);
+ if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
+ camel_exception_clear (&ex);
+ return;
+ }
+
+ if (!(si = g_hash_table_lookup (priv->model->store_hash, store))) {
+ g_assert_not_reached ();
+ camel_object_unref (store);
+ return;
+ }
+
+ /* HACK: we need to create vfolders using the vfolder editor */
+ if (CAMEL_IS_VEE_STORE(store)) {
+ EMVFolderRule *rule;
+
+ rule = em_vfolder_rule_new();
+ filter_rule_set_name((FilterRule *)rule, path);
+ vfolder_gui_add_rule(rule);
+ gtk_widget_destroy((GtkWidget *)emfs);
+ } else {
+ g_object_ref (emfs);
+ emft_create_folder (si->store, path, new_folder_created_cb, emfs);
+ }
+
+ camel_object_unref (store);
}
static void
emft_popup_new_folder (EPopup *ep, EPopupItem *pitem, void *data)
{
EMFolderTree *emft = data;
- CamelFolderInfo *fi;
- if ((fi = em_folder_tree_get_selected_folder_info (emft)) != NULL) {
- em_folder_utils_create_folder(fi);
+ EMFolderTree *folder_tree;
+ GtkWidget *dialog;
+ char *uri;
+
+ folder_tree = (EMFolderTree *) em_folder_tree_new_with_model (emft->priv->model);
+
+ dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:"));
+ uri = em_folder_tree_get_selected_uri(emft);
+ em_folder_selector_set_selected ((EMFolderSelector *) dialog, uri);
+ g_free(uri);
+ g_signal_connect (dialog, "response", G_CALLBACK (emft_popup_new_folder_response), emft);
+ gtk_widget_show (dialog);
+}
+
+static void
+emft_popup_delete_rec (CamelStore *store, CamelFolderInfo *fi, CamelException *ex)
+{
+ while (fi) {
+ CamelFolder *folder;
+
+ if (fi->child) {
+ emft_popup_delete_rec (store, fi->child, ex);
+ if (camel_exception_is_set (ex))
+ return;
+ }
+
+ d(printf ("deleting folder '%s'\n", fi->full_name));
+
+ /* shouldn't camel do this itself? */
+ if (camel_store_supports_subscriptions (store))
+ camel_store_unsubscribe_folder (store, fi->full_name, NULL);
+
+ if (!(folder = camel_store_get_folder (store, fi->full_name, 0, ex)))
+ return;
+
+ if (!CAMEL_IS_VEE_FOLDER (folder)) {
+ GPtrArray *uids = camel_folder_get_uids (folder);
+ int i;
+
+ camel_folder_freeze (folder);
+ for (i = 0; i < uids->len; i++)
+ camel_folder_delete_message (folder, uids->pdata[i]);
+
+ camel_folder_free_uids (folder, uids);
+
+ camel_folder_sync (folder, TRUE, NULL);
+ camel_folder_thaw (folder);
+ }
+
+ camel_store_delete_folder (store, fi->full_name, ex);
+ if (camel_exception_is_set (ex))
+ return;
+
+ fi = fi->next;
}
}
static void
+emft_popup_delete_folders (CamelStore *store, const char *full_name, CamelException *ex)
+{
+ guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE | CAMEL_STORE_FOLDER_INFO_FAST;
+ CamelFolderInfo *fi;
+
+ if (camel_store_supports_subscriptions (store))
+ flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
+
+ fi = camel_store_get_folder_info (store, full_name, flags, ex);
+ if (camel_exception_is_set (ex))
+ return;
+
+ emft_popup_delete_rec (store, fi, ex);
+ camel_store_free_folder_info (store, fi);
+}
+
+static void
selfunc (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
{
struct _emft_selection_data *dat = (struct _emft_selection_data *) data;
@@ -2062,27 +2620,166 @@ emft_selection_get_selected (GtkTreeSelection *selection, GtkTreeModel **model,
}
static void
+emft_popup_delete_response (GtkWidget *dialog, int response, EMFolderTree *emft)
+{
+ CamelStore *store;
+ CamelException ex;
+ char *full_name;
+
+ full_name = g_object_get_data ((GObject *) dialog, "full_name");
+ store = g_object_get_data ((GObject *) dialog, "store");
+
+ if (response == GTK_RESPONSE_OK) {
+ camel_exception_init (&ex);
+ emft_popup_delete_folders (store, full_name, &ex);
+ if (camel_exception_is_set (&ex)) {
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+ "mail:no-delete-folder", full_name, ex.desc, NULL);
+ camel_exception_clear (&ex);
+ }
+ }
+
+ gtk_widget_destroy (dialog);
+}
+
+static void
emft_popup_delete_folder (EPopup *ep, EPopupItem *pitem, void *data)
{
EMFolderTree *emft = data;
- CamelFolder *folder;
-
- if ((folder = em_folder_tree_get_selected_folder (emft)) != NULL) {
- em_folder_utils_delete_folder(folder);
+ struct _EMFolderTreePrivate *priv = emft->priv;
+ GtkTreeSelection *selection;
+ CamelStore *local, *store;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ GtkWidget *dialog;
+ char *full_name;
+
+ selection = gtk_tree_view_get_selection (priv->treeview);
+ if (!emft_selection_get_selected (selection, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
+ COL_STRING_FULL_NAME, &full_name, -1);
+
+ local = mail_component_peek_local_store (NULL);
+
+ if (store == local && is_special_local_folder (full_name)) {
+ e_error_run(NULL, "mail:no-delete-special-folder", full_name, NULL);
+ return;
}
+
+ camel_object_ref (store);
+
+ dialog = e_error_new((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+ (store && CAMEL_IS_VEE_STORE(store))?"mail:ask-delete-vfolder":"mail:ask-delete-folder",
+ full_name, NULL);
+ g_object_set_data_full ((GObject *) dialog, "full_name", full_name, g_free);
+ g_object_set_data_full ((GObject *) dialog, "store", store, camel_object_unref);
+ g_signal_connect (dialog, "response", G_CALLBACK (emft_popup_delete_response), emft);
+ gtk_widget_show (dialog);
}
static void
emft_popup_rename_folder (EPopup *ep, EPopupItem *pitem, void *data)
{
EMFolderTree *emft = data;
- CamelFolder *folder;
-
- if ((folder = em_folder_tree_get_selected_folder (emft)) != NULL) {
- em_folder_utils_rename_folder(folder);
+ struct _EMFolderTreePrivate *priv = emft->priv;
+ char *prompt, *full_name, *name, *new_name, *uri;
+ GtkTreeSelection *selection;
+ const char *p;
+ CamelStore *local, *store;
+ gboolean done = FALSE;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ size_t base_len;
+
+ local = mail_component_peek_local_store (NULL);
+
+ selection = gtk_tree_view_get_selection (priv->treeview);
+ if (!emft_selection_get_selected (selection, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model, &iter, COL_STRING_FULL_NAME, &full_name,
+ COL_STRING_DISPLAY_NAME, &name,
+ COL_POINTER_CAMEL_STORE, &store,
+ COL_STRING_URI, &uri, -1);
+
+ /* don't allow user to rename one of the special local folders */
+ if (store == local && is_special_local_folder (full_name)) {
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+ "mail:no-rename-special-folder", full_name, NULL);
+ g_free (full_name);
+ g_free (name);
+ g_free (uri);
+ return;
+ }
+
+ if ((p = strrchr (full_name, '/')))
+ base_len = (size_t) (p - full_name);
+ else
+ base_len = 0;
+
+ prompt = g_strdup_printf (_("Rename the \"%s\" folder to:"), name);
+ while (!done) {
+ new_name = e_request_string (NULL, _("Rename Folder"), prompt, name);
+ if (new_name == NULL || !strcmp (name, new_name)) {
+ /* old name == new name */
+ done = TRUE;
+ } else if (strchr(new_name, '/') != NULL) {
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+ "mail:no-rename-folder", name, new_name, _("Folder names cannot contain '/'"), NULL);
+ done = TRUE;
+ } else {
+ CamelFolderInfo *fi;
+ CamelException ex;
+ char *path, *p;
+
+ if (base_len > 0) {
+ path = g_malloc (base_len + strlen (new_name) + 2);
+ memcpy (path, full_name, base_len);
+ p = path + base_len;
+ *p++ = '/';
+ strcpy (p, new_name);
+ } else {
+ path = g_strdup (new_name);
+ }
+
+ camel_exception_init (&ex);
+ if ((fi = camel_store_get_folder_info (store, path, CAMEL_STORE_FOLDER_INFO_FAST, &ex)) != NULL) {
+ camel_store_free_folder_info (store, fi);
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+ "mail:no-rename-folder-exists", name, new_name, NULL);
+ } else {
+ const char *oldpath, *newpath;
+
+ oldpath = full_name;
+ newpath = path;
+
+ d(printf ("renaming %s to %s\n", oldpath, newpath));
+
+ camel_exception_clear (&ex);
+ camel_store_rename_folder (store, oldpath, newpath, &ex);
+ if (camel_exception_is_set (&ex)) {
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+ "mail:no-rename-folder", oldpath, newpath, ex.desc, NULL);
+ camel_exception_clear (&ex);
+ }
+
+ done = TRUE;
+ }
+
+ g_free (path);
+ }
+
+ g_free (new_name);
}
+
+ g_free (full_name);
+ g_free (name);
+ g_free (uri);
}
+
static void
emft_popup_properties (EPopup *ep, EPopupItem *pitem, void *data)
{
@@ -2333,60 +3030,6 @@ em_folder_tree_get_selected_path (EMFolderTree *emft)
return name;
}
-CamelFolder *
-em_folder_tree_get_selected_folder (EMFolderTree *emft)
-{
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreeIter iter;
- char *full_name = NULL;
- CamelException ex;
- CamelStore *store = NULL;
- CamelFolder *folder = NULL;
-
- g_return_val_if_fail (EM_IS_FOLDER_TREE (emft), NULL);
-
- camel_exception_init (&ex);
-
- selection = gtk_tree_view_get_selection(emft->priv->treeview);
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
- COL_STRING_FULL_NAME, &full_name, -1);
-
- folder = camel_store_get_folder (store, full_name, CAMEL_STORE_FOLDER_INFO_FAST, &ex);
-
- camel_exception_clear (&ex);
-
- return folder;
-}
-
-CamelFolderInfo *
-em_folder_tree_get_selected_folder_info (EMFolderTree *emft)
-{
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreeIter iter;
- char *full_name = NULL;
- CamelException ex;
- CamelStore *store = NULL;
- CamelFolderInfo *fi = NULL;
-
- g_return_val_if_fail (EM_IS_FOLDER_TREE (emft), NULL);
-
- camel_exception_init (&ex);
-
- selection = gtk_tree_view_get_selection(emft->priv->treeview);
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
- COL_STRING_FULL_NAME, &full_name, -1);
-
- fi = camel_store_get_folder_info (store, full_name, CAMEL_STORE_FOLDER_INFO_FAST, &ex);
-
- camel_exception_clear (&ex);
-
- return fi;
-}
-
EMFolderTreeModel *
em_folder_tree_get_model (EMFolderTree *emft)
{
@@ -2395,18 +3038,6 @@ em_folder_tree_get_model (EMFolderTree *emft)
return emft->priv->model;
}
-EMFolderTreeModelStoreInfo *
-em_folder_tree_get_model_storeinfo (EMFolderTree *emft, CamelStore *store)
-{
- struct _EMFolderTreePrivate *priv = emft->priv;
- struct _EMFolderTreeModelStoreInfo *si;
-
- if (!(si = g_hash_table_lookup (priv->model->store_hash, store))) {
- g_assert_not_reached ();
- return NULL;
- }
- return si;
-}
static gboolean
emft_save_state (EMFolderTree *emft)
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index e60d0e9a21..6b6db82332 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -64,14 +64,10 @@
#include <bonobo/bonobo-ui-util.h>
#include "widgets/misc/e-charset-picker.h"
-#include "e-util/e-error.h"
#include <e-util/e-dialog-utils.h>
#include <e-util/e-icon-factory.h>
#include <e-util/e-print.h>
-#include <e-util/e-profile-event.h>
-
-#include "filter/filter-rule.h"
#include "em-format-html-display.h"
#include "em-format-html-print.h"
@@ -87,6 +83,11 @@
#include "em-event.h"
#include <gtkhtml/gtkhtml.h>
+#include <gtkhtml/htmlobject.h>
+#include <gtkhtml/htmlengine.h>
+#include <gtkhtml/htmlengine-save.h>
+#include <gtkhtml/htmlengine-edit-cut-and-paste.h>
+#include <gtkhtml/htmlselection.h>
#include "mail-mt.h"
#include "mail-ops.h"
@@ -124,8 +125,6 @@ static void emfv_setting_setup(EMFolderView *emfv);
static void emfv_on_url_cb(GObject *emitter, const char *url, EMFolderView *emfv);
static void emfv_on_url(EMFolderView *emfv, const char *uri, const char *nice_uri);
-static void emfv_set_seen (EMFolderView *emfv, const char *uid);
-
static gboolean emfv_popup_menu (GtkWidget *widget);
static const EMFolderViewEnable emfv_enable_map[];
@@ -160,14 +159,6 @@ static guint signals[LAST_SIGNAL];
static void emfv_selection_get(GtkWidget *widget, GtkSelectionData *data, guint info, guint time_stamp, EMFolderView *emfv);
static void emfv_selection_clear_event(GtkWidget *widget, GdkEventSelection *event, EMFolderView *emfv);
-#ifdef ENABLE_PROFILING
-static void
-emfv_format_complete(EMFormat *emf, EMFolderView *emfv)
-{
- e_profile_event_emit("goto.done", emf->uid?emf->uid:"", 0);
-}
-#endif
-
static void
emfv_init(GObject *o)
{
@@ -203,9 +194,7 @@ emfv_init(GObject *o)
g_signal_connect(emfv->preview, "link_clicked", G_CALLBACK(emfv_format_link_clicked), emfv);
g_signal_connect(emfv->preview, "popup_event", G_CALLBACK(emfv_format_popup_event), emfv);
g_signal_connect (emfv->preview, "on_url", G_CALLBACK (emfv_on_url_cb), emfv);
-#ifdef ENABLE_PROFILING
- g_signal_connect(emfv->preview, "complete", G_CALLBACK (emfv_format_complete), emfv);
-#endif
+
p->invisible = gtk_invisible_new();
g_signal_connect(p->invisible, "selection_get", G_CALLBACK(emfv_selection_get), emfv);
g_signal_connect(p->invisible, "selection_clear_event", G_CALLBACK(emfv_selection_clear_event), emfv);
@@ -452,8 +441,6 @@ em_folder_view_open_selected(EMFolderView *emfv)
em_folder_view_set_folder((EMFolderView *)emmb, emfv->folder, emfv->folder_uri);
em_folder_view_set_message((EMFolderView *)emmb, views->pdata[i], FALSE);
gtk_widget_show(emmb->window);
- /* TODO: this loads the message twice (!) */
- em_utils_handle_receipt (emfv->folder, uids->pdata[i], NULL);
g_free(views->pdata[i]);
}
g_ptr_array_free(views, TRUE);
@@ -599,8 +586,9 @@ emfv_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri)
emfv->folder = folder;
if (folder) {
- /* We need to set this up to get the right view options for the message-list,
- * even if we're not showing it */
+ camel_object_ref(folder);
+ mail_refresh_folder(folder, NULL, NULL);
+ /* We need to set this up to get the right view options for the message-list, even if we're not showing it */
emfv_setup_view_instance(emfv);
}
@@ -627,8 +615,6 @@ emfv_set_folder_uri(EMFolderView *emfv, const char *uri)
static void
emfv_set_message(EMFolderView *emfv, const char *uid, int nomarkseen)
{
- e_profile_event_emit("goto.uid", uid?uid:"<none>", 0);
-
/* This could possible race with other set messages, but likelyhood is small */
emfv->priv->nomarkseen = nomarkseen;
message_list_select_uid(emfv->list, uid);
@@ -696,15 +682,6 @@ emfv_popup_saveas(EPopup *ep, EPopupItem *pitem, void *data)
}
static void
-emfv_view_load_images(BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- if (emfv->preview)
- em_format_html_load_http((EMFormatHTML *)emfv->preview);
-}
-
-static void
emfv_popup_print(EPopup *ep, EPopupItem *pitem, void *data)
{
EMFolderView *emfv = data;
@@ -715,37 +692,7 @@ static void
emfv_popup_copy_text(EPopup *ep, EPopupItem *pitem, void *data)
{
EMFolderView *emfv = data;
- gtk_html_copy (((EMFormatHTML *)emfv->preview)->html);
-}
-
-static void
-emfv_popup_source(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- EMMessageBrowser *emmb;
- GPtrArray *uids;
-
- uids = message_list_get_selected(emfv->list);
-
- emmb = (EMMessageBrowser *)em_message_browser_window_new();
- em_format_set_session((EMFormat *)((EMFolderView *)emmb)->preview, ((EMFormat *)emfv->preview)->session);
- em_folder_view_set_folder((EMFolderView *)emmb, emfv->folder, emfv->folder_uri);
- em_format_set_mode((EMFormat *)((EMFolderView *)emmb)->preview, EM_FORMAT_SOURCE);
- em_folder_view_set_message((EMFolderView *)emmb, uids->pdata[0], FALSE);
- gtk_widget_show(emmb->window);
-
- message_list_free_uids(emfv->list, uids);
-}
-
-static void
-emfv_mail_compose(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv))
- return;
-
- em_utils_compose_new_message(emfv->folder_uri);
+ html_engine_copy (((EMFormatHTML *)emfv->preview)->html->engine);
}
static void
@@ -1041,7 +988,7 @@ static EPopupItem emfv_popup_items[] = {
{ E_POPUP_BAR, "20.emfv", NULL, NULL, NULL, NULL },
{ E_POPUP_ITEM, "20.emfv.00", N_("_Edit as New Message..."), emfv_popup_edit, NULL, NULL, EM_POPUP_SELECT_EDIT },
{ E_POPUP_ITEM, "20.emfv.01", N_("_Save As..."), emfv_popup_saveas, NULL, "stock_save-as", EM_POPUP_SELECT_MANY },
- { E_POPUP_ITEM, "20.emfv.02", N_("_Print..."), emfv_popup_print, NULL, "stock_print", EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "20.emfv.02", N_("_Print"), emfv_popup_print, NULL, "stock_print", EM_POPUP_SELECT_ONE },
{ E_POPUP_BAR, "40.emfv", NULL, NULL, NULL, NULL },
{ E_POPUP_ITEM, "40.emfv.00", N_("_Delete"), emfv_popup_delete, NULL, "stock_delete", EM_POPUP_SELECT_DELETE|EM_FOLDER_VIEW_SELECT_LISTONLY },
@@ -1050,8 +997,8 @@ static EPopupItem emfv_popup_items[] = {
{ E_POPUP_ITEM, "40.emfv.03", N_("_Copy to Folder..."), emfv_popup_copy, NULL, "stock_mail-copy", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
{ E_POPUP_BAR, "50.emfv", NULL, NULL, NULL, NULL },
- { E_POPUP_ITEM, "50.emfv.00", N_("Mar_k as Read"), emfv_popup_mark_read, NULL, "stock_mail-open", EM_POPUP_SELECT_MARK_READ|EM_FOLDER_VIEW_SELECT_LISTONLY },
- { E_POPUP_ITEM, "50.emfv.01", N_("Mark as U_nread"), emfv_popup_mark_unread, NULL, "stock_mail-unread", EM_POPUP_SELECT_MARK_UNREAD|EM_FOLDER_VIEW_SELECT_LISTONLY },
+ { E_POPUP_ITEM, "50.emfv.00", N_("Mar_k as Read"), emfv_popup_mark_read, NULL, "stock_mail-open", EM_POPUP_SELECT_MARK_READ },
+ { E_POPUP_ITEM, "50.emfv.01", N_("Mark as U_nread"), emfv_popup_mark_unread, NULL, "stock_mail-unread", EM_POPUP_SELECT_MARK_UNREAD },
{ E_POPUP_ITEM, "50.emfv.02", N_("Mark as _Important"), emfv_popup_mark_important, NULL, "stock_mail-priority-high", EM_POPUP_SELECT_MARK_IMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
{ E_POPUP_ITEM, "50.emfv.03", N_("_Mark as Unimportant"), emfv_popup_mark_unimportant, NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
{ E_POPUP_ITEM, "50.emfv.04", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "stock_spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
@@ -1210,16 +1157,6 @@ EMFV_MAP_CALLBACK(emfv_message_open, emfv_popup_open)
EMFV_MAP_CALLBACK(emfv_message_edit, emfv_popup_edit)
EMFV_MAP_CALLBACK(emfv_message_saveas, emfv_popup_saveas)
EMFV_MAP_CALLBACK(emfv_print_message, emfv_popup_print)
-EMFV_MAP_CALLBACK(emfv_message_source, emfv_popup_source)
-
-static void
-emfv_empty_trash(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- em_utils_empty_trash (gtk_widget_get_toplevel ((GtkWidget *) emfv));
-}
-
static void
emfv_edit_cut(BonoboUIComponent *uid, void *data, const char *path)
@@ -1252,20 +1189,10 @@ emfv_edit_paste(BonoboUIComponent *uid, void *data, const char *path)
}
static void
-emfv_select_all_text(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- gtk_html_select_all (((EMFormatHTML *)emfv->preview)->html);
-}
-
-static void
emfv_mail_next(BonoboUIComponent *uid, void *data, const char *path)
{
EMFolderView *emfv = data;
- e_profile_event_emit("goto.next", "", 0);
-
message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0);
}
@@ -1387,7 +1314,7 @@ emfv_message_post_reply (BonoboUIComponent *uic, void *data, const char *path)
static void
emfv_message_reply(EMFolderView *emfv, int mode)
{
- char *selection_string;
+ HTMLObject *selection;
guint len;
if (emfv->list->cursor_uid == NULL)
@@ -1395,29 +1322,42 @@ emfv_message_reply(EMFolderView *emfv, int mode)
if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
return;
-
- selection_string = gtk_html_get_selection_html (((EMFormatHTML *)emfv->preview)->html, &len);
- if (selection_string && len) {
- CamelMimeMessage *msg, *src;
- struct _camel_header_raw *header;
-
- src = (CamelMimeMessage *)((EMFormat *)emfv->preview)->message;
- msg = camel_mime_message_new();
+
+ html_engine_copy_object (((EMFormatHTML *)emfv->preview)->html->engine, &selection, &len);
+ if (selection != NULL) {
+ HTMLEngineSaveState *state;
- /* need to strip content- headers */
- header = ((CamelMimePart *)src)->headers;
- while (header) {
- if (g_ascii_strncasecmp(header->name, "content-", 8) != 0)
- camel_medium_add_header((CamelMedium *)msg, header->name, header->value);
- header = header->next;
+ state = html_engine_save_buffer_new(((EMFormatHTML *)emfv->preview)->html->engine, TRUE);
+ html_object_save (selection, state);
+ html_object_destroy (selection);
+ if (state->user_data && ((GString *)state->user_data)->len) {
+ CamelMimeMessage *msg, *src;
+ struct _camel_header_raw *header;
+
+ src = (CamelMimeMessage *)((EMFormat *)emfv->preview)->message;
+ msg = camel_mime_message_new();
+
+ /* need to strip content- headers */
+ header = ((CamelMimePart *)src)->headers;
+ while (header) {
+ if (g_ascii_strncasecmp(header->name, "content-", 8) != 0)
+ camel_medium_add_header((CamelMedium *)msg, header->name, header->value);
+ header = header->next;
+ }
+ camel_mime_part_set_encoding((CamelMimePart *)msg, CAMEL_TRANSFER_ENCODING_8BIT);
+ camel_mime_part_set_content((CamelMimePart *)msg,
+ ((GString *)state->user_data)->str,
+ ((GString *)state->user_data)->len,
+ "text/html");
+ em_utils_reply_to_message (emfv->folder, emfv->list->cursor_uid, msg, mode, NULL);
+ camel_object_unref(msg);
+ } else {
+ em_utils_reply_to_message (emfv->folder, emfv->list->cursor_uid, NULL, mode, (EMFormat *)emfv->preview);
}
- camel_mime_part_set_encoding((CamelMimePart *)msg, CAMEL_TRANSFER_ENCODING_8BIT);
- camel_mime_part_set_content((CamelMimePart *)msg,
- selection_string, len, "text/html");
- em_utils_reply_to_message (emfv->folder, emfv->list->cursor_uid, msg, mode, NULL);
- camel_object_unref(msg);
+
+ html_engine_save_buffer_free(state);
} else {
- em_utils_reply_to_message (emfv->folder, emfv->list->cursor_uid, NULL, mode, (EMFormat *)emfv->preview);
+ em_utils_reply_to_message(emfv->folder, emfv->list->cursor_uid, NULL, mode, (EMFormat *)emfv->preview);
}
}
@@ -1620,15 +1560,20 @@ EMFV_MAP_CALLBACK(emfv_tools_vfolder_mlist, emfv_popup_vfolder_mlist)
/* ********************************************************************** */
-static BonoboUIVerb emfv_message_verbs[] = {
- BONOBO_UI_UNSAFE_VERB ("EmptyTrash", emfv_empty_trash),
+static void
+emfv_view_load_images(BonoboUIComponent *uic, void *data, const char *path)
+{
+ EMFolderView *emfv = data;
+
+ if (emfv->preview)
+ em_format_html_load_http((EMFormatHTML *)emfv->preview);
+}
+static BonoboUIVerb emfv_message_verbs[] = {
BONOBO_UI_UNSAFE_VERB ("EditCut", emfv_edit_cut),
BONOBO_UI_UNSAFE_VERB ("EditCopy", emfv_edit_copy),
BONOBO_UI_UNSAFE_VERB ("EditPaste", emfv_edit_paste),
- BONOBO_UI_UNSAFE_VERB ("SelectAllText", emfv_select_all_text),
-
BONOBO_UI_UNSAFE_VERB ("MailNext", emfv_mail_next),
BONOBO_UI_UNSAFE_VERB ("MailNextFlagged", emfv_mail_next_flagged),
BONOBO_UI_UNSAFE_VERB ("MailNextUnread", emfv_mail_next_unread),
@@ -1673,10 +1618,6 @@ static BonoboUIVerb emfv_message_verbs[] = {
BONOBO_UI_UNSAFE_VERB ("TextZoomOut", emfv_text_zoom_out),
BONOBO_UI_UNSAFE_VERB ("TextZoomReset", emfv_text_zoom_reset),
- BONOBO_UI_UNSAFE_VERB ("ViewSource", emfv_message_source),
-
- BONOBO_UI_UNSAFE_VERB ("MailCompose", emfv_mail_compose),
-
/* TODO: This stuff should just be 1 item that runs a wizard */
BONOBO_UI_UNSAFE_VERB ("ToolsFilterMailingList", emfv_tools_filter_mlist),
BONOBO_UI_UNSAFE_VERB ("ToolsFilterRecipient", emfv_tools_filter_recipient),
@@ -1717,8 +1658,6 @@ static EPixmap emfv_message_pixmaps[] = {
E_PIXMAP ("/commands/MessageMarkAsJunk", "stock_spam", E_ICON_SIZE_MENU),
E_PIXMAP ("/commands/MessageMarkAsNotJunk", "stock_not-spam", E_ICON_SIZE_MENU),
E_PIXMAP ("/commands/MessageFollowUpFlag", "stock_mail-flag-for-followup", E_ICON_SIZE_MENU),
- E_PIXMAP ("/commands/ViewLoadImages", "stock_insert_image", E_ICON_SIZE_MENU),
- E_PIXMAP ("/commands/MailCompose", "stock_mail-compose", E_ICON_SIZE_MENU),
E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageReplySender", "stock_mail-reply", E_ICON_SIZE_LARGE_TOOLBAR),
E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageReplyAll", "stock_mail-reply-to-all", E_ICON_SIZE_LARGE_TOOLBAR),
@@ -1739,9 +1678,8 @@ static EPixmap emfv_message_pixmaps[] = {
/* this is added to emfv->enable_map in :init() */
static const EMFolderViewEnable emfv_enable_map[] = {
{ "EditCut", EM_POPUP_SELECT_MANY },
- { "EditCopy", EM_FOLDER_VIEW_SELECT_SELECTION },
+ { "EditCopy", EM_POPUP_SELECT_MANY },
{ "EditPaste", EM_POPUP_SELECT_FOLDER },
- { "SelectAllText", EM_POPUP_SELECT_ONE },
/* FIXME: should these be single-selection? */
{ "MailNext", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_NEXT_MSG },
@@ -1797,7 +1735,6 @@ static const EMFolderViewEnable emfv_enable_map[] = {
{ "ToolsVFolderSubject", EM_POPUP_SELECT_ONE },
{ "ViewLoadImages", EM_POPUP_SELECT_ONE },
- { "ViewSource", EM_POPUP_SELECT_ONE },
/* always enabled */
{ "MailStop", 0 },
@@ -1876,15 +1813,16 @@ emfv_view_mode(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_Even
EMFolderView *emfv = data;
int i;
- if (type != Bonobo_UIComponent_STATE_CHANGED)
+ if (type != Bonobo_UIComponent_STATE_CHANGED
+ || state[0] == '0')
return;
/* TODO: I don't like this stuff much, is there any way we can move listening for such events
elsehwere? Probably not I guess, unless there's a EMFolderViewContainer for bonobo usage
of a folder view */
- i = state[0] != '0';
-
+ for (i=0;i<= EM_FORMAT_SOURCE;i++) {
+ if (strcmp(emfv_display_styles[i]+strlen("/commands/"), path) == 0) {
em_format_set_mode((EMFormat *)emfv->preview, i);
if (EM_FOLDER_VIEW_GET_CLASS (emfv)->update_message_style) {
@@ -1892,6 +1830,9 @@ emfv_view_mode(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_Even
gconf_client_set_int (gconf, "/apps/evolution/mail/display/message_style", i, NULL);
}
+ break;
+ }
+ }
}
static void
@@ -1952,11 +1893,11 @@ emfv_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act)
bonobo_ui_component_set_prop(uic, "/commands/CaretMode", "state", state?"1":"0", NULL);
bonobo_ui_component_add_listener(uic, "CaretMode", emfv_caret_mode, emfv);
- style = ((EMFormat *)emfv->preview)->mode?EM_FORMAT_ALLHEADERS:EM_FORMAT_NORMAL;
- bonobo_ui_component_set_prop(uic, emfv_display_styles[style], "state", style?"1":"0", NULL);
- /* bonobo_ui_component_add_listener(uic, "ViewNormal", emfv_view_mode, emfv); */
+ style = ((EMFormat *)emfv->preview)->mode;
+ bonobo_ui_component_set_prop(uic, emfv_display_styles[style], "state", "1", NULL);
+ bonobo_ui_component_add_listener(uic, "ViewNormal", emfv_view_mode, emfv);
bonobo_ui_component_add_listener(uic, "ViewFullHeaders", emfv_view_mode, emfv);
- /* bonobo_ui_component_add_listener(uic, "ViewSource", emfv_view_mode, emfv); */
+ bonobo_ui_component_add_listener(uic, "ViewSource", emfv_view_mode, emfv);
em_format_set_mode((EMFormat *)emfv->preview, style);
if (emfv->folder && !em_utils_folder_is_sent(emfv->folder, emfv->folder_uri))
@@ -2098,7 +2039,7 @@ em_folder_view_get_popup_target(EMFolderView *emfv, EMPopup *emp, int on_display
else
t->target.mask &= ~EM_FOLDER_VIEW_SELECT_LISTONLY;
- if (gtk_html_command (((EMFormatHTML *)emfv->preview)->html, "is-selection-active"))
+ if (html_engine_is_selection_active(((EMFormatHTML *)emfv->preview)->html->engine))
t->target.mask &= ~EM_FOLDER_VIEW_SELECT_SELECTION;
else
t->target.mask &= ~EM_FOLDER_VIEW_SELECT_NOSELECTION;
@@ -2160,7 +2101,7 @@ do_mark_seen (gpointer user_data)
MessageList *list = emfv->list;
if (mst->uid && list->cursor_uid && !strcmp (mst->uid, list->cursor_uid))
- emfv_set_seen (emfv, mst->uid);
+ camel_folder_set_message_flags (emfv->folder, mst->uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
return FALSE;
}
@@ -2177,10 +2118,7 @@ emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeM
emfv_enable_menus(emfv);
g_object_unref (emfv);
return;
-
}
-
- e_profile_event_emit("goto.loaded", emfv->displayed_uid, 0);
/** @Event: message.reading
* @Title: Viewing a message
@@ -2194,7 +2132,7 @@ emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeM
e_event_emit((EEvent *)eme, "message.reading", (EEventTarget *)target);
em_format_format((EMFormat *)emfv->preview, folder, uid, msg);
-
+
if (emfv->priv->seen_id)
g_source_remove(emfv->priv->seen_id);
@@ -2209,7 +2147,7 @@ emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeM
emfv->priv->seen_id = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, emfv->mark_seen_timeout,
(GSourceFunc)do_mark_seen, mst, (GDestroyNotify)mst_free);
} else {
- emfv_set_seen (emfv, uid);
+ camel_folder_set_message_flags(emfv->folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
}
}
@@ -2230,15 +2168,12 @@ emfv_message_selected_timeout(void *data)
emfv->priv->selected_uid = NULL;
g_object_ref (emfv);
/* TODO: we should manage our own thread stuff, would make cancelling outstanding stuff easier */
- e_profile_event_emit("goto.load", emfv->displayed_uid, 0);
mail_get_message(emfv->folder, emfv->displayed_uid, emfv_list_done_message_selected, emfv, mail_thread_queued);
} else {
- e_profile_event_emit("goto.empty", "", 0);
g_free(emfv->priv->selected_uid);
emfv->priv->selected_uid = NULL;
}
} else {
- e_profile_event_emit("goto.empty", "", 0);
g_free(emfv->displayed_uid);
emfv->displayed_uid = NULL;
em_format_format((EMFormat *)emfv->preview, NULL, NULL, NULL);
@@ -2253,8 +2188,6 @@ emfv_message_selected_timeout(void *data)
static void
emfv_list_message_selected(MessageList *ml, const char *uid, EMFolderView *emfv)
{
- e_profile_event_emit("goto.listuid", uid, 0);
-
if (emfv->preview_active) {
if (emfv->priv->selected_id != 0)
g_source_remove(emfv->priv->selected_id);
@@ -2488,18 +2421,6 @@ emfv_format_popup_event(EMFormatHTMLDisplay *efhd, GdkEventButton *event, const
return TRUE;
}
-static void
-emfv_set_seen(EMFolderView *emfv, const char *uid)
-{
- guint32 old_flags = camel_folder_get_message_flags(emfv->folder, uid);
-
- /* If we're setting the SEEN flag on a message, handle receipt requests */
- if (!(old_flags & CAMEL_MESSAGE_SEEN))
- em_utils_handle_receipt(emfv->folder, uid, (CamelMimeMessage *)((EMFormat *)emfv->preview)->message);
-
- camel_folder_set_message_flags(emfv->folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
-}
-
/* keep these two tables in sync */
enum {
EMFV_ANIMATE_IMAGES = 1,
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index c835dd1541..4876989357 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -27,6 +27,10 @@
#include <string.h>
#include <gtkhtml/gtkhtml.h>
+#include <gtkhtml/htmlengine.h>
+#include <gtkhtml/htmlobject.h>
+#include <gtkhtml/htmliframe.h>
+#include <gtkhtml/htmlinterval.h>
#include <gtkhtml/gtkhtml-embedded.h>
#include <gtkhtml/gtkhtml-search.h>
@@ -125,11 +129,11 @@ static void efhd_iframe_created(GtkHTML *html, GtkHTML *iframe, EMFormatHTMLDisp
/*static void efhd_url_requested(GtkHTML *html, const char *url, GtkHTMLStream *handle, EMFormatHTMLDisplay *efh);
static gboolean efhd_object_requested(GtkHTML *html, GtkHTMLEmbedded *eb, EMFormatHTMLDisplay *efh);*/
-static void efhd_message_prefix(EMFormat *emf, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info);
-
static const EMFormatHandler *efhd_find_handler(EMFormat *emf, const char *mime_type);
static void efhd_format_clone(EMFormat *, CamelFolder *folder, const char *, CamelMimeMessage *msg, EMFormat *);
+static void efhd_format_prefix(EMFormat *emf, CamelStream *stream);
static void efhd_format_error(EMFormat *emf, CamelStream *stream, const char *txt);
+static void efhd_format_message(EMFormat *, CamelStream *, CamelMedium *);
static void efhd_format_source(EMFormat *, CamelStream *, CamelMimePart *);
static void efhd_format_attachment(EMFormat *, CamelStream *, CamelMimePart *, const char *, const EMFormatHandler *);
static void efhd_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid);
@@ -237,7 +241,7 @@ efhd_init(GObject *o)
efhd->priv = g_malloc0(sizeof(*efhd->priv));
efhd->search_tok = (ESearchingTokenizer *)e_searching_tokenizer_new();
- gtk_html_set_tokenizer (efh->html, (HTMLTokenizer *)efhd->search_tok);
+ html_engine_set_tokenizer(efh->html->engine, (HTMLTokenizer *)efhd->search_tok);
g_signal_connect(efh->html, "realize", G_CALLBACK(efhd_gtkhtml_realise), o);
g_signal_connect(efh->html, "style-set", G_CALLBACK(efhd_gtkhtml_style_set), o);
@@ -274,7 +278,9 @@ efhd_class_init(GObjectClass *klass)
{
((EMFormatClass *)klass)->find_handler = efhd_find_handler;
((EMFormatClass *)klass)->format_clone = efhd_format_clone;
+ ((EMFormatClass *)klass)->format_prefix = efhd_format_prefix;
((EMFormatClass *)klass)->format_error = efhd_format_error;
+ ((EMFormatClass *)klass)->format_message = efhd_format_message;
((EMFormatClass *)klass)->format_source = efhd_format_source;
((EMFormatClass *)klass)->format_attachment = efhd_format_attachment;
((EMFormatClass *)klass)->format_secure = efhd_format_secure;
@@ -574,26 +580,34 @@ efhd_iframe_created(GtkHTML *html, GtkHTML *iframe, EMFormatHTMLDisplay *efh)
static int
efhd_html_button_press_event (GtkWidget *widget, GdkEventButton *event, EMFormatHTMLDisplay *efhd)
{
- char *url;
+ HTMLEngine *e;
+ HTMLObject *obj;
+ const char *url;
gboolean res = FALSE;
+ gint offset;
EMFormatPURI *puri = NULL;
+ char *uri = NULL;
if (event->button != 3)
return FALSE;
- url = gtk_html_get_url_at (GTK_HTML (widget), event->x, event->y);
+ e = ((GtkHTML *)widget)->engine;
+ obj = html_engine_get_object_at(e, event->x, event->y, &offset, FALSE);
d(printf("popup button pressed\n"));
- if (url) {
- puri = em_format_find_puri((EMFormat *)efhd, url);
+ if ( obj != NULL
+ && ((url = html_object_get_src(obj)) != NULL
+ || (url = html_object_get_url(obj, offset)) != NULL)) {
+ uri = gtk_html_get_url_object_relative((GtkHTML *)widget, obj, url);
+ puri = em_format_find_puri((EMFormat *)efhd, uri);
d(printf("poup event, uri = '%s' part = '%p'\n", uri, puri?puri->part:NULL));
}
- g_signal_emit((GtkObject *)efhd, efhd_signals[EFHD_POPUP_EVENT], 0, event, url, puri?puri->part:NULL, &res);
+ g_signal_emit((GtkObject *)efhd, efhd_signals[EFHD_POPUP_EVENT], 0, event, uri, puri?puri->part:NULL, &res);
- g_free(url);
+ g_free(uri);
return res;
}
@@ -602,20 +616,33 @@ gboolean
em_format_html_display_popup_menu (EMFormatHTMLDisplay *efhd)
{
GtkHTML *html;
- char *url;
+ HTMLEngine *e;
+ HTMLObject *obj;
+ const char *url;
gboolean res = FALSE;
+ gint offset;
EMFormatPURI *puri = NULL;
+ char *uri = NULL;
html = efhd->formathtml.html;
+ e = html->engine;
+ if (!efhd->caret_mode)
+ obj = html_engine_get_focus_object (e, &offset);
+ else {
+ obj = e->cursor->object;
+ offset = e->cursor->offset;
+ }
- url = gtk_html_get_cursor_url (html);
-
- if (url)
- puri = em_format_find_puri((EMFormat *)efhd, url);
+ if ( obj != NULL
+ && ((url = html_object_get_src(obj)) != NULL
+ || (url = html_object_get_url(obj, offset)) != NULL)) {
+ uri = gtk_html_get_url_object_relative(html, obj, url);
+ puri = em_format_find_puri((EMFormat *)efhd, uri);
+ }
- g_signal_emit((GtkObject *)efhd, efhd_signals[EFHD_POPUP_EVENT], 0, NULL, url, puri?puri->part:NULL, &res);
+ g_signal_emit((GtkObject *)efhd, efhd_signals[EFHD_POPUP_EVENT], 0, NULL, uri, puri?puri->part:NULL, &res);
- g_free(url);
+ g_free(uri);
return res;
}
@@ -906,7 +933,6 @@ efhd_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, Came
/* ********************************************************************** */
static EMFormatHandler type_builtin_table[] = {
- { "x-evolution/message/prefix", (EMFormatFunc)efhd_message_prefix },
};
static void
@@ -969,7 +995,7 @@ efhd_write_image(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri)
camel_stream_close(stream);
}
-static void efhd_message_prefix(EMFormat *emf, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info)
+static void efhd_format_prefix(EMFormat *emf, CamelStream *stream)
{
const char *flag, *comp, *due;
time_t date;
@@ -1034,6 +1060,11 @@ static void efhd_format_error(EMFormat *emf, CamelStream *stream, const char *tx
((EMFormatClass *)efhd_parent)->format_error(emf, stream, txt);
}
+static void efhd_format_message(EMFormat *emf, CamelStream *stream, CamelMedium *part)
+{
+ ((EMFormatClass *)efhd_parent)->format_message(emf, stream, part);
+}
+
static void efhd_format_source(EMFormat *emf, CamelStream *stream, CamelMimePart *part)
{
((EMFormatClass *)efhd_parent)->format_source(emf, stream, part);
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index d00387ba80..3125e32b4e 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -39,6 +39,7 @@
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-embedded.h>
#include <gtkhtml/gtkhtml-stream.h>
+#include <gtkhtml/htmlengine.h>
#include <libgnome/gnome-i18n.h>
@@ -95,10 +96,9 @@ static void efh_url_requested(GtkHTML *html, const char *url, GtkHTMLStream *han
static gboolean efh_object_requested(GtkHTML *html, GtkHTMLEmbedded *eb, EMFormatHTML *efh);
static void efh_gtkhtml_destroy(GtkHTML *html, EMFormatHTML *efh);
-static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info);
-
static void efh_format_clone(EMFormat *emf, CamelFolder *folder, const char *uid, CamelMimeMessage *msg, EMFormat *emfsource);
static void efh_format_error(EMFormat *emf, CamelStream *stream, const char *txt);
+static void efh_format_message(EMFormat *, CamelStream *, CamelMedium *);
static void efh_format_source(EMFormat *, CamelStream *, CamelMimePart *);
static void efh_format_attachment(EMFormat *, CamelStream *, CamelMimePart *, const char *, const EMFormatHandler *);
static void efh_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid);
@@ -220,6 +220,7 @@ efh_class_init(GObjectClass *klass)
{
((EMFormatClass *)klass)->format_clone = efh_format_clone;
((EMFormatClass *)klass)->format_error = efh_format_error;
+ ((EMFormatClass *)klass)->format_message = efh_format_message;
((EMFormatClass *)klass)->format_source = efh_format_source;
((EMFormatClass *)klass)->format_attachment = efh_format_attachment;
((EMFormatClass *)klass)->format_secure = efh_format_secure;
@@ -1106,10 +1107,6 @@ static EMFormatHandler type_builtin_table[] = {
{ "image/jpg", (EMFormatFunc)efh_image },
{ "image/pjpeg", (EMFormatFunc)efh_image },
-
- /* special internal types */
-
- { "x-evolution/message/rfc822", (EMFormatFunc)efh_format_message }
};
static void
@@ -1163,14 +1160,8 @@ static void efh_format_do(struct _mail_msg *mm)
if (((EMFormat *)m->format)->mode == EM_FORMAT_SOURCE) {
em_format_format_source((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message);
} else {
- const EMFormatHandler *handle;
-
- handle = em_format_find_handler((EMFormat *)m->format, "x-evolution/message/prefix");
- if (handle)
- handle->handler((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message, handle);
- handle = em_format_find_handler((EMFormat *)m->format, "x-evolution/message/rfc822");
- if (handle)
- handle->handler((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message, handle);
+ em_format_format_prefix((EMFormat *)m->format, (CamelStream *)m->estream);
+ em_format_format_message((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMedium *)m->message);
}
camel_stream_flush((CamelStream *)m->estream);
@@ -1698,7 +1689,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
}
}
-static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info)
+static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMedium *part)
{
/* TODO: make this validity stuff a method */
EMFormatHTML *efh = (EMFormatHTML *) emf;
@@ -1711,10 +1702,10 @@ static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMimePart
camel_stream_printf(stream, "<blockquote>\n");
if (!efh->hide_headers)
- efh_format_headers(efh, stream, (CamelMedium *)part);
+ efh_format_headers(efh, stream, part);
camel_stream_printf(stream, EM_FORMAT_HTML_VPAD);
- em_format_part(emf, stream, part);
+ em_format_part(emf, stream, (CamelMimePart *)part);
if (emf->message != (CamelMimeMessage *)part)
camel_stream_printf(stream, "</blockquote>\n");
diff --git a/mail/em-format.c b/mail/em-format.c
index dd7cf1e084..aef5bc0ebe 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -77,6 +77,7 @@ static void emf_builtin_init(EMFormatClass *);
static const EMFormatHandler *emf_find_handler(EMFormat *emf, const char *mime_type);
static void emf_format_clone(EMFormat *emf, CamelFolder *folder, const char *uid, CamelMimeMessage *msg, EMFormat *emfsource);
+static void emf_format_prefix(EMFormat *emf, CamelStream *stream);
static void emf_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid);
static gboolean emf_busy(EMFormat *emf);
@@ -161,6 +162,7 @@ emf_class_init(GObjectClass *klass)
klass->finalize = emf_finalise;
((EMFormatClass *)klass)->find_handler = emf_find_handler;
((EMFormatClass *)klass)->format_clone = emf_format_clone;
+ ((EMFormatClass *)klass)->format_prefix = emf_format_prefix;
((EMFormatClass *)klass)->format_secure = emf_format_secure;
((EMFormatClass *)klass)->busy = emf_busy;
@@ -682,6 +684,12 @@ emf_format_clone(EMFormat *emf, CamelFolder *folder, const char *uid, CamelMimeM
}
static void
+emf_format_prefix(EMFormat *emf, CamelStream *stream)
+{
+ /* NOOP */
+}
+
+static void
emf_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid)
{
CamelCipherValidity *save = emf->valid_parent;
@@ -1456,7 +1464,6 @@ static void
emf_message_rfc822(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info)
{
CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)part);
- const EMFormatHandler *handle;
int len;
if (!CAMEL_IS_MIME_MESSAGE(dw)) {
@@ -1466,11 +1473,7 @@ emf_message_rfc822(EMFormat *emf, CamelStream *stream, CamelMimePart *part, cons
len = emf->part_id->len;
g_string_append_printf(emf->part_id, ".rfc822");
-
- handle = em_format_find_handler(emf, "x-evolution/message/rfc822");
- if (handle)
- handle->handler(emf, stream, (CamelMimePart *)dw, handle);
-
+ em_format_format_message(emf, stream, (CamelMedium *)dw);
g_string_truncate(emf->part_id, len);
}
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 3f05696302..22b0ea1dda 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -56,7 +56,7 @@
#include <e-util/e-mktemp.h>
#include <e-util/e-account-list.h>
#include <e-util/e-dialog-utils.h>
-#include "e-util/e-error.h"
+#include "widgets/misc/e-error.h"
#include <gal/util/e-util.h>
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index ffba4ba084..a1f7728d78 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -41,7 +41,7 @@
#include "mail-autofilter.h"
#include "mail-component.h"
#include "em-utils.h"
-#include "e-util/e-error.h"
+#include "widgets/misc/e-error.h"
#include "em-vfolder-context.h"
#include "em-vfolder-rule.h"
@@ -52,9 +52,6 @@
#include "em-filter-editor.h"
#include "filter/filter-option.h"
-#include <camel/camel-internet-address.h>
-#include <camel/camel-mime-message.h>
-
#define d(x)
static void
diff --git a/mail/mail-autofilter.h b/mail/mail-autofilter.h
index 376d258493..7bd7882dcc 100644
--- a/mail/mail-autofilter.h
+++ b/mail/mail-autofilter.h
@@ -25,12 +25,10 @@
#ifndef _MAIL_AUTOFILTER_H
#define _MAIL_AUTOFILTER_H
-struct _FilterRule;
-struct _EMVFolderContext;
-struct _EMFilterContext;
-struct _CamelMimeMessage;
-struct _CamelInternetAddress;
-struct _CamelStore;
+#include <filter/filter-rule.h>
+#include "em-filter-context.h"
+#include "em-vfolder-context.h"
+#include <camel/camel-mime-message.h>
enum {
AUTO_SUBJECT = 1,
@@ -39,15 +37,15 @@ enum {
AUTO_MLIST = 8,
};
-struct _FilterRule *em_vfolder_rule_from_message(struct _EMVFolderContext *context, struct _CamelMimeMessage *msg, int flags, const char *source);
-struct _FilterRule *filter_rule_from_message(struct _EMFilterContext *context, struct _CamelMimeMessage *msg, int flags);
-struct _FilterRule *em_vfolder_rule_from_address(struct _EMVFolderContext *context, struct _CamelInternetAddress *addr, int flags, const char *source);
+FilterRule *em_vfolder_rule_from_message(EMVFolderContext *context, CamelMimeMessage *msg, int flags, const char *source);
+FilterRule *filter_rule_from_message(EMFilterContext *context, CamelMimeMessage *msg, int flags);
+FilterRule *em_vfolder_rule_from_address(EMVFolderContext *context, CamelInternetAddress *addr, int flags, const char *source);
/* easiest place to put this */
-void filter_gui_add_from_message(struct _CamelMimeMessage *msg, const char *source, int flags);
+void filter_gui_add_from_message(CamelMimeMessage *msg, const char *source, int flags);
/* Also easiest place for these, we should really share a global rule context for this stuff ... */
-void mail_filter_rename_uri(struct _CamelStore *store, const char *olduri, const char *newuri);
-void mail_filter_delete_uri(struct _CamelStore *store, const char *uri);
+void mail_filter_rename_uri(CamelStore *store, const char *olduri, const char *newuri);
+void mail_filter_delete_uri(CamelStore *store, const char *uri);
#endif
diff --git a/mail/mail-component.c b/mail/mail-component.c
index e6d77bba9d..e831978235 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -43,11 +43,10 @@
#include "em-message-browser.h"
#include "em-folder-selector.h"
#include "em-folder-selection.h"
-#include "em-folder-utils.h"
#include "em-migrate.h"
#include "widgets/misc/e-info-label.h"
-#include "e-util/e-error.h"
+#include "widgets/misc/e-error.h"
#include "em-search-context.h"
#include "mail-config.h"
@@ -89,7 +88,7 @@ static void create_local_item_cb(EUserCreatableItemsHandler *handler, const char
#define MAIL_COMPONENT_DEFAULT(mc) if (mc == NULL) mc = mail_component_peek();
-#define PARENT_TYPE evolution_component_get_type ()
+#define PARENT_TYPE bonobo_object_get_type ()
static BonoboObjectClass *parent_class = NULL;
struct _store_info {
@@ -738,6 +737,23 @@ impl__get_userCreatableItems (PortableServer_Servant servant, CORBA_Environment
return list;
}
+static void
+emc_new_folder_response(EMFolderSelector *emfs, int response, void *dummy)
+{
+ const char *uri, *path;
+
+ if (response != GTK_RESPONSE_OK) {
+ gtk_widget_destroy((GtkWidget *)emfs);
+ return;
+ }
+
+ uri = em_folder_selector_get_selected_uri(emfs);
+ path = em_folder_selector_get_selected_path(emfs);
+
+ if (em_folder_tree_create_folder(emfs->emft, path, uri))
+ gtk_widget_destroy((GtkWidget *)emfs);
+}
+
static int
create_item(const char *type, EMFolderTreeModel *model, const char *uri)
{
@@ -747,7 +763,15 @@ create_item(const char *type, EMFolderTreeModel *model, const char *uri)
em_utils_compose_new_message(uri);
} else if (strcmp(type, "folder") == 0) {
- em_folder_utils_create_folder(NULL);
+ EMFolderTree *folder_tree;
+ GtkWidget *dialog;
+
+ folder_tree = (EMFolderTree *)em_folder_tree_new_with_model(model);
+ dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:"));
+ if (uri)
+ em_folder_selector_set_selected ((EMFolderSelector *) dialog, uri);
+ g_signal_connect (dialog, "response", G_CALLBACK(emc_new_folder_response), NULL);
+ gtk_widget_show(dialog);
} else
return -1;
@@ -860,19 +884,12 @@ impl_upgradeFromVersion (PortableServer_Servant servant, const short major, cons
camel_exception_clear (&ex);
}
-static void
-impl_mail_test(PortableServer_Servant servant, CORBA_Environment *ev)
-{
- printf("*** Testing mail interface!! ***\n");
-}
-
/* Initialization. */
static void
mail_component_class_init (MailComponentClass *class)
{
- POA_GNOME_Evolution_Component__epv *epv = &((EvolutionComponentClass *)class)->epv;
- POA_GNOME_Evolution_MailComponent__epv *mepv = &class->epv;
+ POA_GNOME_Evolution_Component__epv *epv = &class->epv;
GObjectClass *object_class = G_OBJECT_CLASS (class);
parent_class = g_type_class_peek_parent (class);
@@ -888,8 +905,6 @@ mail_component_class_init (MailComponentClass *class)
epv->handleURI = impl_handleURI;
epv->sendAndReceive = impl_sendAndReceive;
epv->upgradeFromVersion = impl_upgradeFromVersion;
-
- mepv->test = impl_mail_test;
}
static void
@@ -960,13 +975,6 @@ mail_component_peek_activity_handler (MailComponent *component)
return component->priv->activity_handler;
}
-struct _CamelSession *mail_component_peek_session(MailComponent *component)
-{
- MAIL_COMPONENT_DEFAULT(component);
-
- return session;
-}
-
void
mail_component_add_store (MailComponent *component, CamelStore *store, const char *name)
{
@@ -1181,4 +1189,4 @@ mail_component_get_folder_uri(MailComponent *mc, enum _mail_component_folder_t i
return mc_default_folders[id].uri;
}
-BONOBO_TYPE_FUNC_FULL (MailComponent, GNOME_Evolution_MailComponent, PARENT_TYPE, mail_component)
+BONOBO_TYPE_FUNC_FULL (MailComponent, GNOME_Evolution_Component, PARENT_TYPE, mail_component)
diff --git a/mail/mail-errors.xml b/mail/mail-errors.xml
new file mode 100644
index 0000000000..c19cdf5fce
--- /dev/null
+++ b/mail/mail-errors.xml
@@ -0,0 +1,351 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<error-list domain="mail">
+
+ <error id="camel-service-auth-invalid" type="warning">
+ <primary>Invalid authentication</primary>
+ <secondary>This server does not support this type of authentication and may not support authentication at all.</secondary>
+ </error>
+
+ <error id="camel-service-auth-failed" type="warning">
+ <primary>Your login to your server &quot;{0}&quot; as &quot;{0}&quot; failed.</primary>
+ <secondary>Check to make sure your password is spelled correctly. Remember that many passwords are case sensitive; your caps lock might be on.</secondary>
+ </error>
+
+ <error id="ask-send-html" type="question" default="GTK_RESPONSE_YES">
+ <primary>Are you sure you want to send a message in HTML format?</primary>
+ <secondary>Please make sure the following recipients are willing and able to receive HTML email:
+{0}
+Send anyway?</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="_Send" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="ask-send-no-subject" type="question" default="GTK_RESPONSE_YES">
+ <primary>Are you sure you want to send a message without a subject?</primary>
+ <secondary>Adding a meaningful Subject line to your messages will give your recipients an idea of what your mail is about.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="_Send" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="ask-send-only-bcc-contact" type="question" default="GTK_RESPONSE_YES">
+ <primary>Are you sure you want to send a message with only BCC recipients?</primary>
+ <secondary>The contact list you are sending to is configured to hide list recipients.
+
+Many email systems add an Apparently-To header to messages that only have BCC recipients. This header, if added, will list all of your recipients in your message. To avoid this, you should add at least one To: or CC: recipient. </secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="_Send" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="ask-send-only-bcc" type="warning" default="GTK_RESPONSE_YES">
+ <primary>Are you sure you want to send a message with only BCC recipients?</primary>
+ <secondary>Many email systems add an Apparently-To header to messages that only have BCC recipients. This header, if added, will list all of your recipients to your message anyway. To avoid this, you should add at least one To: or CC: recipient.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="_Send" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="send-no-recipients" type="warning">
+ <primary>This message cannot be sent because you have not specified any Recipients</primary>
+ <secondary>Please enter a valid email address in the To: field. You can search for email addresses by clicking on the To: button next to the entry box.</secondary>
+ </error>
+
+ <error id="ask-default-drafts" type="question" default="GTK_RESPONSE_YES">
+ <primary>Use default drafts folder?</primary>
+ <secondary>Unable to open the drafts folder for this account. Use the system drafts folder instead?</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="Use _Default" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="ask-expunge" type="question" default="GTK_RESPONSE_CANCEL">
+ <primary>Are you sure you want to permanently remove all the deleted message in folder &quot;{0}&quot;?</primary>
+ <secondary>If you continue, you will not be able to recover these messages.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="_Expunge" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="ask-empty-trash" type="warning" default="GTK_RESPONSE_CANCEL">
+ <primary>Are you sure you want to permanently remove all the deleted messages in all folders?</primary>
+ <secondary>If you continue, you will not be able to recover these messages.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="_Empty Trash" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="ask-open-many" type="warning" default="GTK_RESPONSE_CANCEL">
+ <primary>Are you sure you want to open {0} messages at once?</primary>
+ <secondary>Opening too many messages at once may take a long time.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="_Open Messages" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="exit-unsaved" type="warning" default="GTK_RESPONSE_NO">
+ <primary>You have unsent messages, do you wish to quit anyway?</primary>
+ <secondary>If you quit, these messages will not be sent until Evolution is started again.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-quit" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="camel-exception" type="warning">
+ <primary>Your message with the subject &quot;{0}&quot; was not delivered.</primary>
+ <secondary>The message was sent via the &quot;sendmail&quot; external application. Sendmail reports the following error: status 67: mail not sent.
+The message is stored in the Outbox folder. Check the message for errors and resend.</secondary>
+ </error>
+
+ <error id="async-error" type="error">
+ <primary>Error while {0}.</primary>
+ <secondary>{1}.</secondary>
+ </error>
+
+ <error id="async-error-nodescribe" type="error">
+ <primary>Error while performing operation.</primary>
+ <secondary>{0}.</secondary>
+ </error>
+
+ <error id="session-message-info" type="info">
+ <secondary>{0}</secondary>
+ </error>
+
+ <error id="session-message-info-cancel" type="info" default="GTK_RESPONSE_CANCEL">
+ <secondary>{0}</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button stock="gtk-ok" response="GTK_RESPONSE_OK"/>
+ </error>
+
+ <error id="session-message-warning" type="warning">
+ <secondary>{0}</secondary>
+ </error>
+
+ <error id="session-message-warning-cancel" type="warning" default="GTK_RESPONSE_CANCEL">
+ <secondary>{0}</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button stock="gtk-ok" response="GTK_RESPONSE_OK"/>
+ </error>
+
+ <error id="session-message-error" type="info">
+ <secondary>{0}</secondary>
+ </error>
+
+ <error id="session-message-error-cancel" type="info" default="GTK_RESPONSE_CANCEL">
+ <secondary>{0}</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button stock="gtk-ok" response="GTK_RESPONSE_OK"/>
+ </error>
+
+ <error id="ask-session-password" type="question" default="GTK_RESPONSE_OK">
+ <primary>Enter password.</primary>
+ <secondary>{0}</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button stock="gtk-ok" response="GTK_RESPONSE_OK"/>
+ </error>
+
+ <error id="filter-load-error" type="error">
+ <primary>Error loading filter definitions.</primary>
+ <secondary>{0}</secondary>
+ </error>
+
+ <error id="no-save-path" type="error">
+ <primary>Cannot save to directory &quot;{0}&quot;.</primary>
+ <secondary>{1}</secondary>
+ </error>
+
+ <error id="no-create-path" type="error">
+ <primary>Cannot save to file &quot;{0}&quot;.</primary>
+ <secondary>Cannot create the save directory, because &quot;{1}&quot;</secondary>
+ </error>
+
+ <error id="no-create-tmp-path" type="error">
+ <primary>Cannot create temporary save directory.</primary>
+ <secondary>Because &quot;{1}&quot;.</secondary>
+ </error>
+
+ <error id="no-write-path-exists" type="error">
+ <primary>Cannot save to file &quot;{0}&quot;.</primary>
+ <secondary>File exists but cannot overwrite it.</secondary>
+ </error>
+
+ <error id="no-write-path-notfile" type="error">
+ <primary>Cannot save to file &quot;{0}&quot;.</primary>
+ <secondary>File exists but is not a regular file.</secondary>
+ </error>
+
+ <error id="no-delete-folder" type="error">
+ <primary>Cannot delete folder &quot;{0}&quot;.</primary>
+ <secondary>Because &quot;{1}&quot;.</secondary>
+ </error>
+
+ <error id="no-delete-special-folder" type="error">
+ <primary>Cannot delete system folder &quot;{0}&quot;.</primary>
+ <secondary>System folders are required for Ximian Evolution to function correctly and cannot be renamed, moved, or deleted.</secondary>
+ </error>
+
+ <error id="no-rename-special-folder" type="error">
+ <primary>Cannot rename or move system folder &quot;{0}&quot;.</primary>
+ <secondary>System folders are required for Ximian Evolution to function correctly and cannot be renamed, moved, or deleted.</secondary>
+ </error>
+
+ <error id="ask-delete-folder" type="question" default="GTK_RESPONSE_CANCEL">
+ <title>Delete &quot;{0}&quot;?</title>
+ <primary>Really delete folder &quot;{0}&quot; and all of its subfolders?</primary>
+ <secondary>If you delete the folder, all of its contents and its subfolders contents will be deleted permanently.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
+ </error>
+
+ <error id="ask-delete-vfolder" type="question" default="GTK_RESPONSE_CANCEL">
+ <title>Delete &quot;{0}&quot;?</title>
+ <primary>Really delete folder &quot;{0}&quot; and all of its subfolders?</primary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
+ </error>
+
+ <error id="no-rename-folder-exists" type="error">
+ <primary>Cannot rename &quot;{0}&quot; to &quot;{1}&quot;.</primary>
+ <secondary>A folder named &quot;{1}&quot; already exists. Please use a different name.</secondary>
+ </error>
+
+ <error id="no-rename-folder" type="error">
+ <primary>Cannot rename &quot;{0}&quot; to &quot;{1}&quot;.</primary>
+ <secondary>Because &quot;{2}&quot;.</secondary>
+ </error>
+
+ <error id="no-move-folder-nostore" type="error">
+ <primary>Cannot move folder &quot;{0}&quot; to &quot;{1}&quot;.</primary>
+ <secondary>Cannot open source &quot;{2}&quot;.</secondary>
+ </error>
+
+ <error id="no-move-folder-to-nostore" type="error">
+ <primary>Cannot move folder &quot;{0}&quot; to &quot;{1}&quot;.</primary>
+ <secondary>Cannot open target &quot;{2}&quot;.</secondary>
+ </error>
+
+ <error id="no-copy-folder-nostore" type="error">
+ <primary>Cannot copy folder &quot;{0}&quot; to &quot;{1}&quot;.</primary>
+ <secondary>Cannot open source &quot;{2}&quot;.</secondary>
+ </error>
+
+ <error id="no-copy-folder-to-nostore" type="error">
+ <primary>Cannot copy folder &quot;{0}&quot; to &quot;{1}&quot;.</primary>
+ <secondary>Cannot open target &quot;{2}&quot;.</secondary>
+ </error>
+
+ <error id="no-create-folder-nostore" type="error">
+ <primary>Cannot create folder &quot;{0}&quot;.</primary>
+ <secondary>Cannot open source &quot;{1}&quot;</secondary>
+ </error>
+
+ <error id="account-incomplete" type="error">
+ <primary>Cannot save changes to account.</primary>
+ <secondary>You have not filled in all of the required information.</secondary>
+ </error>
+
+ <error id="account-notunique" type="error">
+ <primary>Cannot save changes to account.</primary>
+ <secondary>You may not create two accounts with the same name.</secondary>
+ </error>
+
+ <error id="ask-delete-account" type="question" default="GTK_RESPONSE_NO" modal="true">
+ <title>Delete account?</title>
+ <primary>Are you sure you want to delete this account?</primary>
+ <secondary>If you proceed, the account information will be deleted permanently.</secondary>
+ <button stock="gtk-delete" response="GTK_RESPONSE_YES"/>
+ <button stock="gtk-no" label="Don't delete" response="GTK_RESPONSE_NO"/>
+ </error>
+
+ <error id="no-save-signature" type="error">
+ <primary>Could not save signature file.</primary>
+ <secondary>Because &quot;{0}&quot;.</secondary>
+ </error>
+
+ <error id="signature-notscript" type="error">
+ <primary>Cannot set signature script &quot;{0}&quot;.</primary>
+ <secondary>The script file must exist and be executable.</secondary>
+ </error>
+
+ <error id="ask-signature-changed" type="question" default="GTK_RESPONSE_YES">
+ <title>Discard changed?</title>
+ <primary>Do you wish to save your changes?</primary>
+ <secondary>This signature has been changed, but has not been saved.</secondary>
+ <button label="_Discard changes" response="GTK_RESPONSE_NO"/>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button stock="gtk-save" response="GTK_RESPONSE_YES"/>
+ </error>
+
+ <error id="vfolder-notexist" type="error">
+ <primary>Cannot edit vFolder &quot;{0}&quot; as it does not exist.</primary>
+ <secondary>This folder may have been added implicitly, go to the vFolder editor to add it explicitly, if required.</secondary>
+ </error>
+
+ <error id="vfolder-notunique" type="error">
+ <primary>Cannot add vFolder &quot;{0}&quot;.</primary>
+ <secondary>A folder named &quot;{1}&quot; already exists. Please use a different name.</secondary>
+ </error>
+
+ <error id="vfolder-updated" type="info">
+ <primary>vFolders automatically updated.</primary>
+ <secondary>The following vFolder(s):
+{0}
+Used the now removed folder:
+ &quot;{1}&quot;
+And have been updated.</secondary>
+ </error>
+
+ <error id="filter-updated" type="info">
+ <primary>Mail filters automatically updated.</primary>
+ <secondary>The following filter rule(s):
+{0}
+Used the now removed folder:
+ &quot;{1}&quot;
+And have been updated.</secondary>
+ </error>
+
+ <error id="no-folder" type="error">
+ <primary>Missing folder.</primary>
+ <secondary>You must specify a folder.</secondary>
+ </error>
+
+ <error id="no-name-vfolder" type="error">
+ <primary>Missing name.</primary>
+ <secondary>You must name this vFolder.</secondary>
+ </error>
+
+ <error id="vfolder-no-source" type="error">
+ <primary>No sources selected.</primary>
+ <secondary>You must specify at least one folder as a source.
+Either by selecting the folders individually, and/or by selecting
+all local folders, all remote folders, or both.</secondary>
+ </error>
+
+ <error id="ask-migrate-existing" type="question" default="GTK_RESPONSE_CANCEL">
+ <primary>Problem migrating old mail folder &quot;{0}&quot;.</primary>
+ <secondary>A non-empty folder at &quot;{1}&quot; already exists.
+
+You can choose to ignore this folder, overwrite or append its contents, or quit.
+</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button label="Ignore" response="GTK_RESPONSE_REJECT"/>
+ <button stock="gtk-delete" label="_Overwrite" response="GTK_RESPONSE_ACCEPT"/>
+ <button label="_Append" response="GTK_RESPONSE_OK"/>
+ </error>
+
+ <error id="no-load-license" type="error">
+ <primary>Unable to read license file.</primary>
+ <secondary>Cannot read the license file &quot;{0}&quot;, due to an
+ installation problem. You will not be able to use this provider until
+ you can accept its license.</secondary>
+ </error>
+
+ <error id="checking-service" type="info">
+ <title>Querying server</title>
+ <primary>Please wait.</primary>
+ <secondary>Querying server for a list of supported authentication mechanisms.</secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ </error>
+
+ <error id="gw-accountsetup-error" type="error">
+ <primary>Unable to connect to the GroupWise
+server.</primary>
+<secondary>
+Please check your account settings and try again.
+</secondary>
+</error>
+
+</error-list>
+
diff --git a/mail/mail-errors.xml.h b/mail/mail-errors.xml.h
new file mode 100644
index 0000000000..7161251dea
--- /dev/null
+++ b/mail/mail-errors.xml.h
@@ -0,0 +1,260 @@
+/* mail:camel-service-auth-invalid primary */
+char *s = N_("Invalid authentication");
+/* mail:camel-service-auth-invalid secondary */
+char *s = N_("This server does not support this type of authentication and may not support authentication at all.");
+/* mail:camel-service-auth-failed primary */
+char *s = N_("Your login to your server \"{0}\" as \"{0}\" failed.");
+/* mail:camel-service-auth-failed secondary */
+char *s = N_("Check to make sure your password is spelled correctly. Remember that many passwords are case sensitive; your caps lock might be on.");
+/* mail:ask-send-html primary */
+char *s = N_("Are you sure you want to send a message in HTML format?");
+/* mail:ask-send-html secondary */
+char *s = N_("Please make sure the following recipients are willing and able to receive HTML email:\n"
+ "{0}\n"
+ "Send anyway?");
+char *s = N_("_Send");
+/* mail:ask-send-no-subject primary */
+char *s = N_("Are you sure you want to send a message without a subject?");
+/* mail:ask-send-no-subject secondary */
+char *s = N_("Adding a meaningful Subject line to your messages will give your recipients an idea of what your mail is about.");
+char *s = N_("_Send");
+/* mail:ask-send-only-bcc-contact primary */
+char *s = N_("Are you sure you want to send a message with only BCC recipients?");
+/* mail:ask-send-only-bcc-contact secondary */
+char *s = N_("The contact list you are sending to is configured to hide list recipients.\n"
+ "\n"
+ "Many email systems add an Apparently-To header to messages that only have BCC recipients. This header, if added, will list all of your recipients in your message. To avoid this, you should add at least one To: or CC: recipient. ");
+char *s = N_("_Send");
+/* mail:ask-send-only-bcc primary */
+char *s = N_("Are you sure you want to send a message with only BCC recipients?");
+/* mail:ask-send-only-bcc secondary */
+char *s = N_("Many email systems add an Apparently-To header to messages that only have BCC recipients. This header, if added, will list all of your recipients to your message anyway. To avoid this, you should add at least one To: or CC: recipient.");
+char *s = N_("_Send");
+/* mail:send-no-recipients primary */
+char *s = N_("This message cannot be sent because you have not specified any Recipients");
+/* mail:send-no-recipients secondary */
+char *s = N_("Please enter a valid email address in the To: field. You can search for email addresses by clicking on the To: button next to the entry box.");
+/* mail:ask-default-drafts primary */
+char *s = N_("Use default drafts folder?");
+/* mail:ask-default-drafts secondary */
+char *s = N_("Unable to open the drafts folder for this account. Use the system drafts folder instead?");
+char *s = N_("Use _Default");
+/* mail:ask-expunge primary */
+char *s = N_("Are you sure you want to permanently remove all the deleted message in folder \"{0}\"?");
+/* mail:ask-expunge secondary */
+char *s = N_("If you continue, you will not be able to recover these messages.");
+char *s = N_("_Expunge");
+/* mail:ask-empty-trash primary */
+char *s = N_("Are you sure you want to permanently remove all the deleted messages in all folders?");
+/* mail:ask-empty-trash secondary */
+char *s = N_("If you continue, you will not be able to recover these messages.");
+char *s = N_("_Empty Trash");
+/* mail:ask-open-many primary */
+char *s = N_("Are you sure you want to open {0} messages at once?");
+/* mail:ask-open-many secondary */
+char *s = N_("Opening too many messages at once may take a long time.");
+char *s = N_("_Open Messages");
+/* mail:exit-unsaved primary */
+char *s = N_("You have unsent messages, do you wish to quit anyway?");
+/* mail:exit-unsaved secondary */
+char *s = N_("If you quit, these messages will not be sent until Evolution is started again.");
+/* mail:camel-exception primary */
+char *s = N_("Your message with the subject \"{0}\" was not delivered.");
+/* mail:camel-exception secondary */
+char *s = N_("The message was sent via the \"sendmail\" external application. Sendmail reports the following error: status 67: mail not sent.\n"
+ "The message is stored in the Outbox folder. Check the message for errors and resend.");
+/* mail:async-error primary */
+char *s = N_("Error while {0}.");
+/* mail:async-error secondary */
+char *s = N_("{1}.");
+/* mail:async-error-nodescribe primary */
+char *s = N_("Error while performing operation.");
+/* mail:async-error-nodescribe secondary */
+char *s = N_("{0}.");
+/* mail:session-message-info secondary */
+char *s = N_("{0}");
+/* mail:session-message-info-cancel secondary */
+char *s = N_("{0}");
+/* mail:session-message-warning secondary */
+char *s = N_("{0}");
+/* mail:session-message-warning-cancel secondary */
+char *s = N_("{0}");
+/* mail:session-message-error secondary */
+char *s = N_("{0}");
+/* mail:session-message-error-cancel secondary */
+char *s = N_("{0}");
+/* mail:ask-session-password primary */
+char *s = N_("Enter password.");
+/* mail:ask-session-password secondary */
+char *s = N_("{0}");
+/* mail:filter-load-error primary */
+char *s = N_("Error loading filter definitions.");
+/* mail:filter-load-error secondary */
+char *s = N_("{0}");
+/* mail:no-save-path primary */
+char *s = N_("Cannot save to directory \"{0}\".");
+/* mail:no-save-path secondary */
+char *s = N_("{1}");
+/* mail:no-create-path primary */
+char *s = N_("Cannot save to file \"{0}\".");
+/* mail:no-create-path secondary */
+char *s = N_("Cannot create the save directory, because \"{1}\"");
+/* mail:no-create-tmp-path primary */
+char *s = N_("Cannot create temporary save directory.");
+/* mail:no-create-tmp-path secondary */
+char *s = N_("Because \"{1}\".");
+/* mail:no-write-path-exists primary */
+char *s = N_("Cannot save to file \"{0}\".");
+/* mail:no-write-path-exists secondary */
+char *s = N_("File exists but cannot overwrite it.");
+/* mail:no-write-path-notfile primary */
+char *s = N_("Cannot save to file \"{0}\".");
+/* mail:no-write-path-notfile secondary */
+char *s = N_("File exists but is not a regular file.");
+/* mail:no-delete-folder primary */
+char *s = N_("Cannot delete folder \"{0}\".");
+/* mail:no-delete-folder secondary */
+char *s = N_("Because \"{1}\".");
+/* mail:no-delete-special-folder primary */
+char *s = N_("Cannot delete system folder \"{0}\".");
+/* mail:no-delete-special-folder secondary */
+char *s = N_("System folders are required for Ximian Evolution to function correctly and cannot be renamed, moved, or deleted.");
+/* mail:no-rename-special-folder primary */
+char *s = N_("Cannot rename or move system folder \"{0}\".");
+/* mail:no-rename-special-folder secondary */
+char *s = N_("System folders are required for Ximian Evolution to function correctly and cannot be renamed, moved, or deleted.");
+/* mail:ask-delete-folder title */
+char *s = N_("Delete \"{0}\"?");
+/* mail:ask-delete-folder primary */
+char *s = N_("Really delete folder \"{0}\" and all of its subfolders?");
+/* mail:ask-delete-folder secondary */
+char *s = N_("If you delete the folder, all of its contents and its subfolders contents will be deleted permanently.");
+/* mail:ask-delete-vfolder title */
+char *s = N_("Delete \"{0}\"?");
+/* mail:ask-delete-vfolder primary */
+char *s = N_("Really delete folder \"{0}\" and all of its subfolders?");
+/* mail:no-rename-folder-exists primary */
+char *s = N_("Cannot rename \"{0}\" to \"{1}\".");
+/* mail:no-rename-folder-exists secondary */
+char *s = N_("A folder named \"{1}\" already exists. Please use a different name.");
+/* mail:no-rename-folder primary */
+char *s = N_("Cannot rename \"{0}\" to \"{1}\".");
+/* mail:no-rename-folder secondary */
+char *s = N_("Because \"{2}\".");
+/* mail:no-move-folder-nostore primary */
+char *s = N_("Cannot move folder \"{0}\" to \"{1}\".");
+/* mail:no-move-folder-nostore secondary */
+char *s = N_("Cannot open source \"{2}\".");
+/* mail:no-move-folder-to-nostore primary */
+char *s = N_("Cannot move folder \"{0}\" to \"{1}\".");
+/* mail:no-move-folder-to-nostore secondary */
+char *s = N_("Cannot open target \"{2}\".");
+/* mail:no-copy-folder-nostore primary */
+char *s = N_("Cannot copy folder \"{0}\" to \"{1}\".");
+/* mail:no-copy-folder-nostore secondary */
+char *s = N_("Cannot open source \"{2}\".");
+/* mail:no-copy-folder-to-nostore primary */
+char *s = N_("Cannot copy folder \"{0}\" to \"{1}\".");
+/* mail:no-copy-folder-to-nostore secondary */
+char *s = N_("Cannot open target \"{2}\".");
+/* mail:no-create-folder-nostore primary */
+char *s = N_("Cannot create folder \"{0}\".");
+/* mail:no-create-folder-nostore secondary */
+char *s = N_("Cannot open source \"{1}\"");
+/* mail:account-incomplete primary */
+char *s = N_("Cannot save changes to account.");
+/* mail:account-incomplete secondary */
+char *s = N_("You have not filled in all of the required information.");
+/* mail:account-notunique primary */
+char *s = N_("Cannot save changes to account.");
+/* mail:account-notunique secondary */
+char *s = N_("You may not create two accounts with the same name.");
+/* mail:ask-delete-account title */
+char *s = N_("Delete account?");
+/* mail:ask-delete-account primary */
+char *s = N_("Are you sure you want to delete this account?");
+/* mail:ask-delete-account secondary */
+char *s = N_("If you proceed, the account information will be deleted permanently.");
+char *s = N_("Don't delete");
+/* mail:no-save-signature primary */
+char *s = N_("Could not save signature file.");
+/* mail:no-save-signature secondary */
+char *s = N_("Because \"{0}\".");
+/* mail:signature-notscript primary */
+char *s = N_("Cannot set signature script \"{0}\".");
+/* mail:signature-notscript secondary */
+char *s = N_("The script file must exist and be executable.");
+/* mail:ask-signature-changed title */
+char *s = N_("Discard changed?");
+/* mail:ask-signature-changed primary */
+char *s = N_("Do you wish to save your changes?");
+/* mail:ask-signature-changed secondary */
+char *s = N_("This signature has been changed, but has not been saved.");
+char *s = N_("_Discard changes");
+/* mail:vfolder-notexist primary */
+char *s = N_("Cannot edit vFolder \"{0}\" as it does not exist.");
+/* mail:vfolder-notexist secondary */
+char *s = N_("This folder may have been added implicitly, go to the vFolder editor to add it explicitly, if required.");
+/* mail:vfolder-notunique primary */
+char *s = N_("Cannot add vFolder \"{0}\".");
+/* mail:vfolder-notunique secondary */
+char *s = N_("A folder named \"{1}\" already exists. Please use a different name.");
+/* mail:vfolder-updated primary */
+char *s = N_("vFolders automatically updated.");
+/* mail:vfolder-updated secondary */
+char *s = N_("The following vFolder(s):\n"
+ "{0}\n"
+ "Used the now removed folder:\n"
+ " \"{1}\"\n"
+ "And have been updated.");
+/* mail:filter-updated primary */
+char *s = N_("Mail filters automatically updated.");
+/* mail:filter-updated secondary */
+char *s = N_("The following filter rule(s):\n"
+ "{0}\n"
+ "Used the now removed folder:\n"
+ " \"{1}\"\n"
+ "And have been updated.");
+/* mail:no-folder primary */
+char *s = N_("Missing folder.");
+/* mail:no-folder secondary */
+char *s = N_("You must specify a folder.");
+/* mail:no-name-vfolder primary */
+char *s = N_("Missing name.");
+/* mail:no-name-vfolder secondary */
+char *s = N_("You must name this vFolder.");
+/* mail:vfolder-no-source primary */
+char *s = N_("No sources selected.");
+/* mail:vfolder-no-source secondary */
+char *s = N_("You must specify at least one folder as a source.\n"
+ "Either by selecting the folders individually, and/or by selecting\n"
+ "all local folders, all remote folders, or both.");
+/* mail:ask-migrate-existing primary */
+char *s = N_("Problem migrating old mail folder \"{0}\".");
+/* mail:ask-migrate-existing secondary */
+char *s = N_("A non-empty folder at \"{1}\" already exists.\n"
+ "\n"
+ "You can choose to ignore this folder, overwrite or append its contents, or quit.\n"
+ "");
+char *s = N_("Ignore");
+char *s = N_("_Overwrite");
+char *s = N_("_Append");
+/* mail:no-load-license primary */
+char *s = N_("Unable to read license file.");
+/* mail:no-load-license secondary */
+char *s = N_("Cannot read the license file \"{0}\", due to an\n"
+ " installation problem. You will not be able to use this provider until\n"
+ " you can accept its license.");
+/* mail:checking-service title */
+char *s = N_("Querying server");
+/* mail:checking-service primary */
+char *s = N_("Please wait.");
+/* mail:checking-service secondary */
+char *s = N_("Querying server for a list of supported authentication mechanisms.");
+/* mail:gw-accountsetup-error primary */
+char *s = N_("Unable to connect to the GroupWise\n"
+ "server.");
+/* mail:gw-accountsetup-error secondary */
+char *s = N_("\n"
+ "Please check your account settings and try again.\n"
+ "");
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index d66cb5d22a..98de077b36 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -550,6 +550,21 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination,
/* post process */
mail_tool_restore_xevolution_headers (message, xev);
+ if (sent_folder_uri) {
+ folder = mail_tool_uri_to_folder (sent_folder_uri, 0, ex);
+ if (camel_exception_is_set(ex)) {
+ g_string_append_printf (err, _("Failed to append to %s: %s\n"
+ "Appending to local `Sent' folder instead."),
+ sent_folder_uri, camel_exception_get_description (ex));
+ camel_exception_clear (ex);
+ }
+ }
+
+ if (!folder) {
+ folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT);
+ camel_object_ref(folder);
+ }
+
if (driver) {
camel_filter_driver_filter_message (driver, message, info,
NULL, NULL, NULL, "", ex);
@@ -565,65 +580,46 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination,
}
camel_exception_clear (ex);
+ camel_folder_append_message (folder, message, info, NULL, ex);
+ if (camel_exception_is_set (ex)) {
+ CamelFolder *sent_folder;
- if (!( ((CamelService *)xport)->provider->flags & CAMEL_PROVIDER_DISABLE_SENT_FOLDER)) {
- if (sent_folder_uri) {
- folder = mail_tool_uri_to_folder (sent_folder_uri, 0, ex);
- if (camel_exception_is_set(ex)) {
- g_string_append_printf (err, _("Failed to append to %s: %s\n"
- "Appending to local `Sent' folder instead."),
- sent_folder_uri, camel_exception_get_description (ex));
- camel_exception_clear (ex);
- }
- }
+ if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL)
+ goto exit;
- if (!folder) {
- folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT);
- camel_object_ref(folder);
- }
+ sent_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT);
+ if (folder != sent_folder) {
+ const char *name;
+
+ camel_object_get (folder, NULL, CAMEL_OBJECT_DESCRIPTION, (char **) &name, 0);
+ if (err->len)
+ g_string_append(err, "\n\n");
+ g_string_append_printf (err, _("Failed to append to %s: %s\n"
+ "Appending to local `Sent' folder instead."),
+ name, camel_exception_get_description (ex));
+ camel_object_ref (sent_folder);
+ camel_object_unref (folder);
+ folder = sent_folder;
+ camel_exception_clear (ex);
+ camel_folder_append_message (folder, message, info, NULL, ex);
+ }
- camel_folder_append_message (folder, message, info, NULL, ex);
if (camel_exception_is_set (ex)) {
- CamelFolder *sent_folder;
-
if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL)
goto exit;
- sent_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT);
-
- if (folder != sent_folder) {
- const char *name;
-
- camel_object_get (folder, NULL, CAMEL_OBJECT_DESCRIPTION, (char **) &name, 0);
- if (err->len)
- g_string_append(err, "\n\n");
- g_string_append_printf (err, _("Failed to append to %s: %s\n"
- "Appending to local `Sent' folder instead."),
- name, camel_exception_get_description (ex));
- camel_object_ref (sent_folder);
- camel_object_unref (folder);
- folder = sent_folder;
-
- camel_exception_clear (ex);
- camel_folder_append_message (folder, message, info, NULL, ex);
- }
-
- if (camel_exception_is_set (ex)) {
- if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL)
- goto exit;
-
- if (err->len)
- g_string_append(err, "\n\n");
- g_string_append_printf (err, _("Failed to append to local `Sent' folder: %s"),
+ if (err->len)
+ g_string_append(err, "\n\n");
+ g_string_append_printf (err, _("Failed to append to local `Sent' folder: %s"),
camel_exception_get_description (ex));
- }
}
}
+
if (!camel_exception_is_set(ex))
camel_folder_set_message_flags (queue, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, ~0);
-
+
if (err->len) {
/* set the culmulative exception report */
camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, err->str);
diff --git a/mail/mail-session.c b/mail/mail-session.c
index ae971c5817..627447c3f7 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -55,7 +55,7 @@
#include <libedataserverui/e-passwords.h>
#include "libedataserver/e-msgport.h"
#include "em-junk-filter.h"
-#include "e-util/e-error.h"
+#include "widgets/misc/e-error.h"
#define d(x)
diff --git a/mail/mail-signature-editor.c b/mail/mail-signature-editor.c
index b34644676e..0ffff0fcd5 100644
--- a/mail/mail-signature-editor.c
+++ b/mail/mail-signature-editor.c
@@ -37,7 +37,7 @@
#include <bonobo/bonobo-stream-memory.h>
#include <e-util/e-signature-list.h>
-#include "e-util/e-error.h"
+#include "widgets/misc/e-error.h"
#include "e-msg-composer.h"
#include "mail-signature-editor.h"
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 1b0aad9841..858c7f018f 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -41,7 +41,6 @@
#include <camel/camel-vee-folder.h>
#include <camel/camel-file-utils.h>
#include <camel/camel-movemail.h>
-#include <camel/camel-mime-message.h>
#include "em-vfolder-rule.h"
#include "em-vfolder-context.h"
diff --git a/mail/message-list.c b/mail/message-list.c
index 573151743f..9a7aaaaeda 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -71,7 +71,6 @@
#include "em-utils.h"
#include <e-util/e-icon-factory.h>
-#include <e-util/e-profile-event.h>
#include "art/empty.xpm"
@@ -2797,7 +2796,7 @@ message_list_set_folder (MessageList *message_list, CamelFolder *folder, const c
return;
camel_exception_init (&ex);
-
+
/* remove the cursor activate idle handler */
if (message_list->idle_id != 0) {
g_source_remove (message_list->idle_id);
@@ -3398,8 +3397,6 @@ regen_list_regen (struct _mail_msg *mm)
if (m->folder != m->ml->folder)
return;
- e_profile_event_emit("list.getuids", m->folder->full_name, 0);
-
/* if we have hidedeleted on, use a search to find it out, merge with existing search if set */
if (!camel_folder_has_search_capability(m->folder)) {
/* if we have no search capability, dont let search or hide deleted work */
@@ -3518,8 +3515,6 @@ regen_list_regen (struct _mail_msg *mm)
}
MESSAGE_LIST_UNLOCK(m->ml, hide_lock);
-
- e_profile_event_emit("list.threaduids", m->folder->full_name, 0);
if (!camel_operation_cancel_check(mm->cancel)) {
/* update/build a new tree */
@@ -3566,8 +3561,6 @@ regen_list_regened (struct _mail_msg *mm)
if (m->ml->folder != m->folder)
return;
- e_profile_event_emit("list.buildtree", m->folder->full_name, 0);
-
if (m->dotree) {
if (m->ml->just_set_folder)
m->ml->just_set_folder = FALSE;
@@ -3607,8 +3600,6 @@ regen_list_free (struct _mail_msg *mm)
struct _regen_list_msg *m = (struct _regen_list_msg *)mm;
int i;
- e_profile_event_emit("list.regenerated", m->folder->full_name, 0);
-
if (m->summary) {
for (i = 0; i < m->summary->len; i++)
camel_folder_free_message_info (m->folder, m->summary->pdata[i]);
@@ -3641,8 +3632,6 @@ static struct _mail_msg_op regen_list_op = {
static gboolean
ml_regen_timeout(struct _regen_list_msg *m)
{
- e_profile_event_emit("list.regenerate", m->folder->full_name, 0);
-
m->ml->regen = g_list_prepend(m->ml->regen, m);
/* TODO: we should manage our own thread stuff, would make cancelling outstanding stuff easier */
e_thread_put (mail_thread_queued, (EMsg *)m);
@@ -3683,7 +3672,7 @@ mail_regen_list (MessageList *ml, const char *search, const char *hideexpr, Came
{
struct _regen_list_msg *m;
GConfClient *gconf;
-
+
if (ml->folder == NULL) {
if (ml->search != search) {
g_free(ml->search);