diff options
Diffstat (limited to 'mail')
31 files changed, 830 insertions, 170 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 0c5bc2e60c..84f7066075 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,246 @@ +2008-08-07 Paul Bolle <pebolle@tiscali.nl> + + ** Fix for bug #546788 + + * em-folder-view.c: "/commands/ViewNormal" isn't actually used. It is + probably a leftover from a previous way of setting the formatting + style. It can be removed. Related cleanups. + +2008-08-06 Paul Bolle <pebolle@tiscali.nl> + + ** Fix for bug #546668 + + * em-format-html.c: Drop a (pointless) define used only once. + * em-format-html-display.c: Drop one unused define. + +2008-08-07 Matthew Barnes <mbarnes@redhat.com> + + * em-format.c (emf_format_secure): + * em-format-html-display.c (efhd_xpkcs7mime_add_cert_table): + Use CamelDList instead of EDList. + +2008-08-06 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #249844 + + * em-event.h: (struct _EMEventTargetCustomIcon): Declare 'folder_name' + as const char * to let compiler happy; no copy of the pointer anyway. + * mail-component.c: (impl__get_userCreatableItems): + Do not let compiler claim. + +2008-08-05 Srinivasa Ragavan <sragavan@novell.com> + + * mail/message-list.c: Fix a performance issue, where we can just go + by the presence than the exact count. + +2008-08-04 Matthew Barnes <mbarnes@redhat.com> + + * em-migrate.c (migrate_to_db): + * em-network-prefs.c (notify_proxy_type_changed), + (widget_entry_changed_cb): + * em-subscribe-editor.c (sub_fill_level), (sub_queue_fill_level), + (sub_row_expanded): + * mail-vfolder.c: + Use G_STRLOC or G_STRFUNC instead of deprecated + G_GNUC_PRETTY_FUNCTION. + +2008-08-04 Paul Bolle <pebolle@tiscali.nl> + + ** Fix for bug #543058 + + * em-folder-properties.c (emfp_dialog_got_folder_quota): + * mail-component.c (view_changed): Replace three occurrences of + INBOX in the GUI code with Inbox. INBOX is a written in all caps + because that is the way it is used in the IMAP protocol. There's + little reason to use it in the GUI. Inbox is properly capitalized and + can be localized too. + +2008-08-04 Paul Bolle <pebolle@tiscali.nl> + + ** Further fix for bug #539268 + + * em-format.c (em_format_describe_part): Do not append description + if it is just an empty string. + +2008-08-04 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes bug #249844 + + * em-folder-tree.c (render_display_name): + * mail-component.c (impl__get_userCreatableItems): + Use C_() macro instead of Q_() macro. + Use fully qualified names for "New" submenu entries. + +2008-08-04 Paul Bolle <pebolle@tiscali.nl> + + ** Fixes bug #537088 + + * em-format-html.c: (efh_format_headers): Break out of the loop rather + that return from this function when running into an empty From: or + Sender: header. + +2008-08-01 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #514006 + + * apps-evolution-mail-notification.schemas.in: + Quote literal values. + +2008-08-01 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes bug #544859 + + * evolution-mail.schemas.in: + Clarify description of "sync_interval" key. + +2008-08-01 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes bug #545820 + + * mail-ops.c (save_messages_desc): Fix a typo. (Nicolas Kaiser) + +2008-07-31 Srinivasa Ragavan <sragavan@novell.com> + + ** Fix for bug #545436 + + * mail/message-list.c: Check the info before accessing it. + +2008-07-30 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #500389 + + * em-account-editor.c: (emae_option_options_changed), + (emae_option_options), (emae_receive_options_extra_item): + New ability to define Options (ComboBox) in provider's options. + +2008-07-29 Srinivasa Ragavan <sragavan@novell.com> + + * mail/em-folder-tree.c: Kill a compilation warning. + +2008-07-28 Lucian Langa <lucilanga@gnome.org> + + * mail/mail-config.glade: + Corrected string "Prompt on sending HTML.." + +2008-07-28 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #543532 + + * em-folder-tree-model.c: (em_folder_tree_model_remove_store_info): + Let free memory when we are done with it, not before. + +2008-07-28 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #256540 + + * mail-dialogs.glade: (message_security_dialog): + Do not use GtkNotebook with only one tab. + +2008-07-28 Lucian Langa <lucilanga@gnome.org> + + * mail/mail-config.glade: + ** See bug #504417: Preferences windows + cut off + +2008-07-28 Jeff Cai <jeff.cai@sun.com> + + * em-migrate.c: (migrate_to_db): + * em-network-prefs.c: (notify_proxy_type_changed), + (widget_entry_changed_cb): + Use G_GNUC_PRETTY_FUNCTION instead of __PRETTY__FUNCTION + +2008-07-27 Lucian Langa <lucilanga@gnome.org> + + * mail/em-event.h (struct _EMEventTargetCustomIcon): + * mail/em-event.c (em_event_target_new_custom_icon): + * mail/em-folder-tree.c (render_pixbuf): + ** See bug #544969: Added the hook for folder + custom icon. + +2008-07-28 Srinivasa Ragavan <sragavan@novell.com> + + ** Fix for bug #543411 + + * mail/em-folder-tree-model.c: Dont load known folders. + * mail/em-folder-tree.c: Move iter to the last entry. + +2008-07-25 Srinivasa Ragavan <sragavan@novell.com> + + * mail/em-folder-browser.c: Make show unread/etc work well. + +2008-07-24 Sankar P <psankar@novell.com> + + * em-folder-browser.c (get_view_query): + Search by Labels. + +2008-07-24 Srinivasa Ragavan <sragavan@novell.com> + + * mail/em-folder-browser.c: Revert Sankar's search hacks. + +2008-07-22 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #544022 + + * e-searching-tokenizer.c: (dump_trie): + Define function only when required. (Compiler warning cleanup.) + +2008-07-21 Tor Lillqvist <tml@novell.com> + + * em-migrate.c: Rearrange G_OS_WIN32 ifdefs a bit, as we need to + compile more of this file to support upgrade attempts from 2.12 + and later. + (migrate_folders): Guard against camel_store_get_folder() + returning NULL, which happened at least for me. It was for a + partially broken GroupWise folder structure on disk, so that is a + case of garbage in--garbage out I guess, but it can't hurt to be + careful... + +2008-07-21 Bharath Acharya <abharath@novell.com> + + Fixed some compiler warnings for Templates specific hunk. + + * em-composer-utils.c: (edit_message): + +2008-07-20 Bharath Acharya <abharath@novell.com> + + ** Fix for bug #200147 + Added basic Template support + + * em-composer-utils.c (edit_message), (em_utils_edit_message): Modified + to suit it better for plugins to use it. And added support for template + placeholders to be replaced in the messages. + * em-composer-utils.h: + * em-folder-tree.c (is_special_local_folder): + * em-folder-utils.c (emfu_is_special_local_folder): + * em-folder-view.c (em_folder_view_open_selected): + * em-utils.c (em_utils_folder_is_templates): + * em-utils.h: + * mail-component.c: + * mail-component.h: + +2008-07-16 Sankar P <psankar@novell.com> + + Pushing disk summary changes from the madagascar branch + + * em-folder-browser.c (get_view_query): + * em-folder-view.c (emfv_enable_menus): + * mail-ops.c (refresh_folder_exec): + * message-list.c (regen_list_exec): + +2008-07-09 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #269152 + + * em-format-quote.c: (emfq_format_header): + * em-format-html.c: (efh_format_headers): + Use X-MimeOLE as Mailer header when there's nothing better available. + +2008-07-09 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #228725 + + * message-list.c: (mail_regen_list): Update empty message on regen. + 2008-07-09 Milan Crha <mcrha@redhat.com> ** Fix for bug #207802 (Patch suggested by Veerapuram Varadhan.) diff --git a/mail/GNOME_Evolution_Mail.server.in.in b/mail/GNOME_Evolution_Mail.server.in.in index 8df4fc2afa..98eba23c39 100644 --- a/mail/GNOME_Evolution_Mail.server.in.in +++ b/mail/GNOME_Evolution_Mail.server.in.in @@ -34,9 +34,9 @@ <oaf_attribute name="evolution:button_label" type="string" _value="Mail"/> <oaf_attribute name="evolution:button_tooltips" type="string" _value="Mail"/> <oaf_attribute name="evolution:button_sort_order" type="string" value="-10"/> - <oaf_attribute name="evolution:button_icon" type="string" value="stock_mail"/> + <oaf_attribute name="evolution:button_icon" type="string" value="evolution-mail"/> - <oaf_attribute name="evolution:component_icon" type="string" value="stock_mail"/> + <oaf_attribute name="evolution:component_icon" type="string" value="evolution-mail"/> <oaf_attribute name="evolution:component_display_order" type="number" value="1"/> <oaf_attribute name="evolution:uri_schemas" type="stringv"> @@ -59,7 +59,7 @@ _value="Evolution Mail component"/> <oaf_attribute name="evolution:shell_component_icon" type="string" - value="stock_mail"/> + value="evolution-mail"/> <oaf_attribute name="evolution:shell_component_launch_order" type="number" value="1"/> </oaf_server> @@ -177,7 +177,7 @@ _value="Configure your network connection settings here"/> <oaf_attribute name="evolution2:config_item:icon_name" type="string" - value="stock_proxy"/> + value="preferences-system-network-proxy"/> <oaf_attribute name="evolution2:config_item:priority" type="string" value="-8"/> diff --git a/mail/e-searching-tokenizer.c b/mail/e-searching-tokenizer.c index 2880a9461a..1b603acd90 100644 --- a/mail/e-searching-tokenizer.c +++ b/mail/e-searching-tokenizer.c @@ -224,6 +224,8 @@ struct _trie { EMemChunk *match_chunks; }; +/* will be enabled only if debug is enabled */ +#if d(1) -1 != -1 static void dump_trie(struct _state *s, int d) { @@ -242,6 +244,7 @@ dump_trie(struct _state *s, int d) m = m->next; } } +#endif /* This builds an Aho-Corasick search trie for a set of utf8 words */ /* See diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 3885b89447..5e691c71fa 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -2020,6 +2020,96 @@ emae_option_checkspin(EMAccountEditorService *service, CamelURL *url, const char return hbox; } +static void +emae_option_options_changed (GtkComboBox *options, EMAccountEditorService *service) +{ + const char *name = g_object_get_data (G_OBJECT (options), "option-name"); + char *value = NULL; + CamelURL *url = emae_account_url (service->emae, emae_service_info[service->type].account_uri_key); + int id = gtk_combo_box_get_active (options); + + if (id != -1) { + GtkTreeModel *model; + GtkTreeIter iter; + + model = gtk_combo_box_get_model (options); + if (gtk_tree_model_iter_nth_child (model, &iter, NULL, id)) { + gtk_tree_model_get (model, &iter, 0, &value, -1); + } + } + + camel_url_set_param (url, name, value); + emae_uri_changed (service, url); + camel_url_free (url); + g_free (value); +} + +/* 'values' is in format "value0:caption0:value2:caption2:...valueN:captionN" */ +static GtkWidget * +emae_option_options (EMAccountEditorService *service, CamelURL *url, const char *name, const char *values, GtkWidget *l) +{ + GtkComboBox *w; + GtkListStore *store; + GtkTreeIter iter; + const char *p, *value, *caption; + GtkCellRenderer *cell; + int active = 0; /* the first item entered is always a default item */ + int i; + const char *val = camel_url_get_param (url, name); + + w = GTK_COMBO_BOX (gtk_combo_box_new ()); + + /* value and caption */ + store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); + + p = values; + for (p = values, i = 0; p; i++) { + char *vl, *cp; + + value = p; + caption = strchr (p, ':'); + if (caption) { + caption++; + } else { + g_warning (G_STRLOC ": expected ':' not found at '%s'", p); + break; + } + p = strchr (caption, ':'); + + vl = g_strndup (value, caption - value - 1); + if (p) { + p++; + cp = g_strndup (caption, p - caption - 1); + } else + cp = g_strdup (caption); + + gtk_list_store_append (store, &iter); + gtk_list_store_set (store, &iter, 0, vl, 1, dgettext (service->provider->translation_domain, cp), -1); + + if (val && g_ascii_strcasecmp (val, vl) == 0) + active = i; + + g_free (vl); + g_free (cp); + } + + gtk_combo_box_set_model (w, (GtkTreeModel *)store); + gtk_combo_box_set_active (w, i > 0 ? active : -1); + + cell = gtk_cell_renderer_text_new (); + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (w), cell, TRUE); + gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (w), cell, "text", 1, NULL); + + gtk_widget_show (GTK_WIDGET (w)); + + gtk_label_set_mnemonic_widget (GTK_LABEL (l), GTK_WIDGET (w)); + + g_object_set_data (G_OBJECT (w), "option-name", (void *)name); + g_signal_connect (w, "changed", G_CALLBACK (emae_option_options_changed), service); + + return GTK_WIDGET (w); +} + static GtkWidget * emae_receive_options_item(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) { @@ -2062,7 +2152,7 @@ emae_receive_options_extra_item(EConfig *ec, EConfigItem *eitem, struct _GtkWidg { EMAccountEditor *emae = data; struct _receive_options_item *item = (struct _receive_options_item *)eitem; - GtkWidget *w, *l; + GtkWidget *w, *l, *h; CamelProviderConfEntry *entries; GtkWidget *depw; GSList *depl = NULL, *n; @@ -2151,6 +2241,20 @@ section: depl = g_slist_prepend(depl, w); row++; break; + case CAMEL_PROVIDER_CONF_OPTIONS: + h = gtk_hbox_new (FALSE, 4); + gtk_widget_show (h); + l = g_object_new (gtk_label_get_type (), "label", entries[i].text, "xalign", 0.0, "use_underline", TRUE, NULL); + gtk_widget_show (l); + w = emae_option_options (service, url, entries[i].name, entries[i].value, l); + gtk_box_pack_start (GTK_BOX (h), l, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (h), w, FALSE, FALSE, 0); + gtk_table_attach ((GtkTable *)parent, h, 0, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + if (depw) { + depl = g_slist_prepend (depl, h); + } + row++; + break; default: break; } diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 257d66c486..8ae537ad7c 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -68,6 +68,8 @@ #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0) #endif +#define GCONF_KEY_TEMPLATE_PLACEHOLDERS "/apps/evolution/mail/template_placeholders" + static EAccount * guess_account (CamelMimeMessage *message, CamelFolder *folder); struct emcs_t { @@ -808,8 +810,143 @@ edit_message (CamelMimeMessage *message, CamelFolder *drafts, const char *uid) { EMsgComposer *composer; + /* Template specific code follows. */ + if (em_utils_folder_is_templates(drafts, NULL) == TRUE) { + /* retrieve the message from the CamelFolder */ + CamelDataWrapper *content; + CamelStream *mem; + CamelContentType *type; + CamelMimePart *mime_part = CAMEL_MIME_PART (message); + CamelDataWrapper *mail_text; + CamelMultipart *body = camel_multipart_new (); + CamelStream *stream; + CamelMimePart *part; + int count1 = 0, string_changed = 0; + + char *str; + gint count = 2; + + content = camel_medium_get_content_object ((CamelMedium *) message); + if (!content) + return; + + /* + * Get non-multipart content from multipart message. + */ + while (CAMEL_IS_MULTIPART (content) && count > 0) + { + mime_part = camel_multipart_get_part (CAMEL_MULTIPART (content), 0); + content = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); + count--; + } + + if (!mime_part) + return; + + type = camel_mime_part_get_content_type (mime_part); + if (!camel_content_type_is (type, "text", "plain")) + return; + + mem = camel_stream_mem_new (); + camel_data_wrapper_decode_to_stream (content, mem); + + str = g_strndup ((const gchar*)((CamelStreamMem *) mem)->buffer->data, ((CamelStreamMem *) mem)->buffer->len); + camel_object_unref (mem); + + const char *cur = str; + int i; + for (i = 0; i < strlen(str); i++) { + if (!g_ascii_strncasecmp (cur, "$", 1)) { + const char *end = cur, *check_env; + char *out; + GConfClient *gconf; + GSList *clue_list = NULL, *list; + + gconf = gconf_client_get_default (); + + while (*end && !g_unichar_isspace (*end) && (*end != '"')) + end++; + + out = g_strndup ((const gchar *) cur, end - cur); + check_env = out; + + char **temp_str = g_strsplit (str, out, 2); + + /* Get the list from gconf */ + clue_list = gconf_client_get_list ( gconf, GCONF_KEY_TEMPLATE_PLACEHOLDERS, GCONF_VALUE_STRING, NULL ); + + g_object_unref (gconf); + + for (list = clue_list; list; list = g_slist_next (list)) { + char **temp = g_strsplit (list->data, "=", 2); + if (!g_ascii_strcasecmp(temp[0], out+1)) { + str = g_strdup_printf("%s%s%s", temp_str[0], temp[1], temp_str[1]); + cur = str + i; + count1 = 1; + string_changed = 1; + } + else + count1 = 0; + g_strfreev(temp); + } + + if (clue_list) { + g_slist_foreach (clue_list, (GFunc) g_free, NULL); + g_slist_free (clue_list); + } + + if (!count1) { + if (getenv(out+1)) { + str = g_strdup_printf("%s%s%s", temp_str[0], getenv(out + 1), temp_str[1]); + cur = str + i; + count1 = 1; + string_changed = 1; + } + else + count1 = 0; + } + + g_strfreev(temp_str); + } + else + cur++; + } + + if (string_changed) { + + /* Create toplevel container */ + camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (body), + "multipart/alternative;"); + camel_multipart_set_boundary (body, NULL); + + stream = camel_stream_mem_new (); + + mail_text = camel_data_wrapper_new (); + camel_data_wrapper_set_mime_type_field (mail_text, type); + + camel_stream_printf (stream, "%s", g_strdup(str)); + + camel_data_wrapper_construct_from_stream (mail_text, stream); + camel_object_unref (stream); + + part = camel_mime_part_new (); + camel_medium_set_content_object (CAMEL_MEDIUM (part), mail_text); + camel_object_unref (mail_text); + camel_multipart_add_part (body, part); + camel_object_unref (part); + + /* Finish creating the message */ + camel_medium_set_content_object (CAMEL_MEDIUM (message), CAMEL_DATA_WRAPPER(body)); + camel_object_unref (body); + } + } + composer = e_msg_composer_new_with_message (message); - em_composer_utils_setup_callbacks (composer, NULL, NULL, 0, 0, drafts, uid); + + if (em_utils_folder_is_templates(drafts, NULL) == TRUE) + em_composer_utils_setup_callbacks (composer, NULL, NULL, 0, 0, NULL, NULL); + else + em_composer_utils_setup_callbacks (composer, NULL, NULL, 0, 0, drafts, uid); composer_set_no_change (composer, TRUE); @@ -819,16 +956,20 @@ edit_message (CamelMimeMessage *message, CamelFolder *drafts, const char *uid) /** * em_utils_edit_message: * @message: message to edit + * @folder: used to recognize the templates folder * * Opens a composer filled in with the headers/mime-parts/etc of * @message. **/ void -em_utils_edit_message (CamelMimeMessage *message) +em_utils_edit_message (CamelMimeMessage *message, CamelFolder *folder) { g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message)); - edit_message (message, NULL, NULL); + if (folder) + edit_message (message, folder, NULL); + else + edit_message (message, NULL, NULL); } static void diff --git a/mail/em-composer-utils.h b/mail/em-composer-utils.h index 147fb41049..cee813fc8f 100644 --- a/mail/em-composer-utils.h +++ b/mail/em-composer-utils.h @@ -51,7 +51,7 @@ void em_utils_compose_new_message_with_mailto (const char *url, const char *from void em_utils_post_to_folder (struct _CamelFolder *folder); void em_utils_post_to_url (const char *url); -void em_utils_edit_message (struct _CamelMimeMessage *message); +void em_utils_edit_message (struct _CamelMimeMessage *message, struct _CamelFolder *folder); void em_utils_edit_messages (struct _CamelFolder *folder, GPtrArray *uids, gboolean replace); void em_utils_forward_attached (struct _CamelFolder *folder, GPtrArray *uids, const char *fromuri); diff --git a/mail/em-event.c b/mail/em-event.c index ec72d4ccc5..2ce8d8afc0 100644 --- a/mail/em-event.c +++ b/mail/em-event.c @@ -189,6 +189,18 @@ em_event_target_new_send_receive(EMEvent *eme, GtkWidget *table, gpointer data, return t; } +EMEventTargetCustomIcon * +em_event_target_new_custom_icon(EMEvent *eme, GtkCellRenderer *renderer, const char *folder_name, guint32 flags) +{ + EMEventTargetCustomIcon *t = e_event_target_new(&eme->popup, EM_EVENT_TARGET_CUSTOM_ICON, sizeof(*t)); + + t->renderer = renderer; + t->folder_name = folder_name; + t->target.mask = ~flags; + + return t; +} + /* ********************************************************************** */ static void *emeh_parent_class; @@ -215,11 +227,16 @@ static const EEventHookTargetMask emeh_send_receive_masks[] = { { NULL } }; +static const EEventHookTargetMask emeh_custom_icon_masks[] = { + { "customicon", EM_EVENT_CUSTOM_ICON }, + { NULL } +}; static const EEventHookTargetMap emeh_targets[] = { { "folder", EM_EVENT_TARGET_FOLDER, emeh_folder_masks }, { "message", EM_EVENT_TARGET_MESSAGE, emeh_message_masks }, { "composer", EM_EVENT_TARGET_COMPOSER, emeh_composer_masks}, { "sendreceive", EM_EVENT_TARGET_SEND_RECEIVE, emeh_send_receive_masks}, + { "customicon", EM_EVENT_TARGET_CUSTOM_ICON, emeh_custom_icon_masks}, { NULL } }; diff --git a/mail/em-event.h b/mail/em-event.h index d8e93f1b34..6b35547084 100644 --- a/mail/em-event.h +++ b/mail/em-event.h @@ -46,6 +46,7 @@ enum _em_event_target_t { EM_EVENT_TARGET_MESSAGE, EM_EVENT_TARGET_COMPOSER, EM_EVENT_TARGET_SEND_RECEIVE, + EM_EVENT_TARGET_CUSTOM_ICON, }; /* Flags that describe TARGET_FOLDER */ @@ -68,6 +69,11 @@ enum { EM_EVENT_SEND_RECEIVE = 1<< 0, }; +/* Flags that describe TARGET_CUSTOM_ICON*/ +enum { + EM_EVENT_CUSTOM_ICON = 1<< 0, +}; + typedef struct _EMEventTargetFolder EMEventTargetFolder; struct _EMEventTargetFolder { @@ -105,6 +111,14 @@ struct _EMEventTargetSendReceive { int row; }; +typedef struct _EMEventTargetCustomIcon EMEventTargetCustomIcon; + +struct _EMEventTargetCustomIcon { + EEventTarget target; + + GtkCellRenderer *renderer; + const char *folder_name; +}; typedef struct _EEventItem EMEventItem; @@ -127,6 +141,7 @@ EMEventTargetFolder *em_event_target_new_folder(EMEvent *emp, const char *uri, g EMEventTargetComposer *em_event_target_new_composer(EMEvent *emp, const struct _EMsgComposer *composer, guint32 flags); EMEventTargetMessage *em_event_target_new_message(EMEvent *emp, struct _CamelFolder *folder, struct _CamelMimeMessage *message, const char *uid, guint32 flags); EMEventTargetSendReceive * em_event_target_new_send_receive(EMEvent *eme, struct _GtkWidget *table, gpointer data, int row, guint32 flags); +EMEventTargetCustomIcon * em_event_target_new_custom_icon(EMEvent *eme, GtkCellRenderer *renderer, const char *uri, guint32 flags); /* ********************************************************************** */ diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c index ce17ea2f54..5871cfc4cc 100644 --- a/mail/em-folder-browser.c +++ b/mail/em-folder-browser.c @@ -877,7 +877,7 @@ get_view_query (ESearchBar *esb, CamelFolder *folder, const char *folder_uri) view_sexp = "(match-all (not (system-flag \"Seen\")))"; break; case VIEW_READ_MESSAGES: - view_sexp = "(match-all (system-flag \"Seen\"))"; + view_sexp = "(match-all (system-flag \"Seen\" ))"; break; case VIEW_RECENT_MESSAGES: if (!em_utils_folder_is_sent (folder, folder_uri)) @@ -892,7 +892,7 @@ get_view_query (ESearchBar *esb, CamelFolder *folder, const char *folder_uri) view_sexp = " (match-all (> (get-sent-date) (- (get-current-date) 432000)))"; break; case VIEW_WITH_ATTACHMENTS: - view_sexp = "(match-all (system-flag \"Attachments\"))"; + view_sexp = "(match-all (system-flag \"Attachments\" ))"; break; case VIEW_NOT_JUNK: view_sexp = "(match-all (not (system-flag \"junk\")))"; @@ -925,7 +925,7 @@ get_view_query (ESearchBar *esb, CamelFolder *folder, const char *folder_uri) duplicate = FALSE; break; case VIEW_MESSAGES_MARKED_AS_IMPORTANT: - view_sexp = "(match-all (system-flag \"Flagged\"))"; + view_sexp = "(match-all (system-flag \"Flagged\" ))"; break; case VIEW_ANY_FIELD_CONTAINS: break; diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c index 34be92221a..506522750b 100644 --- a/mail/em-folder-properties.c +++ b/mail/em-folder-properties.c @@ -351,7 +351,8 @@ emfp_dialog_got_folder_quota (CamelFolder *folder, CamelFolderQuotaInfo *quota, } emfp_items_translated = TRUE; } - } + } else if (!strcmp(prop_data->name, "INBOX")) + emfp_items[EMFP_FOLDER_SECTION].label = _("Inbox"); else emfp_items[EMFP_FOLDER_SECTION].label = prop_data->name; diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index ce6e15a851..eb6191199e 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -448,6 +448,10 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite const char *name; guint32 flags; + /* make sure we don't already know about it? */ + if (g_hash_table_lookup (si->full_hash, fi->full_name)) + return; + if (!fully_loaded) load = fi->child == NULL && !(fi->flags & (CAMEL_FOLDER_NOCHILDREN | CAMEL_FOLDER_NOINFERIORS)); @@ -878,8 +882,9 @@ em_folder_tree_model_remove_store_info (EMFolderTreeModel *model, CamelStore *st if (!(si = g_hash_table_lookup (model->store_hash, store))) return; - g_hash_table_remove (model->store_hash, si->store); g_hash_table_remove (model->account_hash, si->account); + /* store_hash owns and frees the si structure, thus free it after done with it */ + g_hash_table_remove (model->store_hash, si->store); } diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index ea108daad6..e7cbd0c75b 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -72,6 +72,7 @@ #include "em-folder-selector.h" #include "em-folder-selection.h" #include "em-folder-properties.h" +#include "em-event.h" #define d(x) @@ -285,6 +286,8 @@ render_pixbuf (GtkTreeViewColumn *column, GtkCellRenderer *renderer, GdkPixbuf *pixbuf = NULL; gboolean is_store; guint32 flags; + EMEventTargetCustomIcon *target; + const char *folder_name; if (!initialised) { folder_icons[FOLDER_ICON_NORMAL] = e_icon_factory_get_icon ("folder", E_ICON_SIZE_MENU); @@ -326,8 +329,14 @@ render_pixbuf (GtkTreeViewColumn *column, GtkCellRenderer *renderer, pixbuf = folder_icons[FOLDER_ICON_SHARED_BY_ME]; else if (flags & CAMEL_FOLDER_VIRTUAL) pixbuf = folder_icons[FOLDER_ICON_VIRTUAL]; - else + else { pixbuf = folder_icons[FOLDER_ICON_NORMAL]; + g_object_set (renderer, "pixbuf", pixbuf, "visible", !is_store, NULL); + gtk_tree_model_get (model, iter, COL_STRING_FULL_NAME, &folder_name, -1); + target = em_event_target_new_custom_icon (em_event_peek(), renderer, folder_name, EM_EVENT_CUSTOM_ICON); + e_event_emit ((EEvent *)em_event_peek (), "folder.customicon", (EEventTarget *) target); + return; + } } } @@ -368,7 +377,7 @@ render_display_name (GtkTreeViewColumn *column, GtkCellRenderer *renderer, * Do not translate the "folder-display|" part. Remove it * from your translation. */ - display = g_strdup_printf (Q_("folder-display|%s (%u)"), name, unread); + display = g_strdup_printf (C_("folder-display", "%s (%u)"), name, unread); g_free (name); } else display = name; @@ -1087,7 +1096,7 @@ tree_drag_data_received(GtkWidget *widget, GdkDragContext *context, int x, int y static gboolean is_special_local_folder (const char *name) { - return (!strcmp (name, "Drafts") || !strcmp (name, "Inbox") || !strcmp (name, "Outbox") || !strcmp (name, "Sent")); + return (!strcmp (name, "Drafts") || !strcmp (name, "Inbox") || !strcmp (name, "Outbox") || !strcmp (name, "Sent") || !strcmp (name, "Templates")); } static GdkAtom @@ -1724,7 +1733,7 @@ emft_get_folder_info__done (struct _EMFolderTreeGetFolderInfo *m) { struct _EMFolderTreePrivate *priv = m->emft->priv; struct _EMFolderTreeModelStoreInfo *si; - GtkTreeIter root, iter; + GtkTreeIter root, iter, titer; CamelFolderInfo *fi; GtkTreeStore *model; GtkTreePath *path; @@ -1766,6 +1775,13 @@ emft_get_folder_info__done (struct _EMFolderTreeGetFolderInfo *m) /* get the first child (which will be a dummy node) */ gtk_tree_model_iter_children ((GtkTreeModel *) model, &iter, &root); + /* Traverse to the last valid iter */ + titer = iter; + while (gtk_tree_model_iter_next((GtkTreeModel *) model, &iter)) + titer = iter; /* Preserve the last valid iter */ + + iter = titer; + /* FIXME: camel's IMAP code is totally on crack here, @top's * folder info should be @fi and fi->child should be what we * want to fill our tree with... *sigh* */ diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index aae43e2441..551d14bcec 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -81,7 +81,7 @@ extern CamelSession *session; static gboolean emfu_is_special_local_folder (const char *name) { - return (!strcmp (name, "Drafts") || !strcmp (name, "Inbox") || !strcmp (name, "Outbox") || !strcmp (name, "Sent")); + return (!strcmp (name, "Drafts") || !strcmp (name, "Inbox") || !strcmp (name, "Outbox") || !strcmp (name, "Sent") || !strcmp (name, "Templates")); } struct _EMCopyFolders { diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index c5e6d1047a..7f6ba0898e 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -220,13 +220,6 @@ static const EMFolderViewEnable emfv_enable_map[] = { { "MailStop", 0 }, { NULL }, - - /* always enabled - - { "ViewFullHeaders", IS_0MESSAGE, 0 }, - { "ViewNormal", IS_0MESSAGE, 0 }, - { "ViewSource", IS_0MESSAGE, 0 }, - { "CaretMode", IS_0MESSAGE, 0 }, */ }; struct _EMFolderViewPrivate { @@ -520,6 +513,7 @@ em_folder_view_open_selected(EMFolderView *emfv) } if (em_utils_folder_is_drafts(emfv->folder, emfv->folder_uri) + || em_utils_folder_is_templates(emfv->folder, emfv->folder_uri) || em_utils_folder_is_outbox(emfv->folder, emfv->folder_uri)) { em_utils_edit_messages(emfv->folder, uids, TRUE); return uids->len; @@ -2209,13 +2203,6 @@ emfv_enable_menus(EMFolderView *emfv) g_string_free(name, TRUE); } -/* must match em_format_mode_t order */ -static const char * const emfv_display_styles[] = { - "/commands/ViewNormal", - "/commands/ViewFullHeaders", - "/commands/ViewSource" -}; - static void emfv_view_mode(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data) { @@ -2299,10 +2286,9 @@ emfv_activate(EMFolderView *emfv, BonoboUIComponent *uic, int act) 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); */ + if (style) + bonobo_ui_component_set_prop(uic, "/commands/ViewFullHeaders", "state", "1", NULL); bonobo_ui_component_add_listener(uic, "ViewFullHeaders", 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) @@ -2647,7 +2633,7 @@ emfv_list_double_click(ETree *tree, gint row, ETreePath path, gint col, GdkEvent /* Ignore double-clicks on columns that handle thier own state */ if (MESSAGE_LIST_COLUMN_IS_ACTIVE (col)) return; - + em_folder_view_open_selected(emfv); } diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index d34f08a837..36b7e74cf6 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -100,8 +100,6 @@ #define d(x) -#define EFHD_TABLE_OPEN "<table>" - struct _EMFormatHTMLDisplayPrivate { /* For the interactive search dialogue */ /* TODO: Should this be more subtle, like the mozilla one? */ @@ -1030,10 +1028,10 @@ efhd_xpkcs7mime_viewcert_clicked(GtkWidget *button, struct _smime_pobject *po) #endif static void -efhd_xpkcs7mime_add_cert_table(GtkWidget *vbox, EDList *certlist, struct _smime_pobject *po) +efhd_xpkcs7mime_add_cert_table(GtkWidget *vbox, CamelDList *certlist, struct _smime_pobject *po) { CamelCipherCertInfo *info = (CamelCipherCertInfo *)certlist->head; - GtkTable *table = (GtkTable *)gtk_table_new(e_dlist_length(certlist), 2, FALSE); + GtkTable *table = (GtkTable *)gtk_table_new(camel_dlist_length(certlist), 2, FALSE); int n = 0; while (info->next) { @@ -1135,7 +1133,7 @@ efhd_xpkcs7mime_validity_clicked(GtkWidget *button, EMFormatHTMLPObject *pobject gtk_box_pack_start((GtkBox *)vbox, w, TRUE, TRUE, 6); } - if (!e_dlist_empty(&po->valid->sign.signers)) + if (!camel_dlist_empty(&po->valid->sign.signers)) efhd_xpkcs7mime_add_cert_table(vbox, &po->valid->sign.signers, po); gtk_widget_show_all(vbox); @@ -1167,7 +1165,7 @@ efhd_xpkcs7mime_validity_clicked(GtkWidget *button, EMFormatHTMLPObject *pobject gtk_box_pack_start((GtkBox *)vbox, w, TRUE, TRUE, 6); } - if (!e_dlist_empty(&po->valid->encrypt.encrypters)) + if (!camel_dlist_empty(&po->valid->encrypt.encrypters)) efhd_xpkcs7mime_add_cert_table(vbox, &po->valid->encrypt.encrypters, po); gtk_widget_show_all(vbox); diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 5c76c5e861..bb2d176b6e 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -84,7 +84,6 @@ #define d(x) -#define EFH_TABLE_OPEN "<table>" #define EFM_MESSAGE_START_ANAME "evolution#message#start" #define EFH_MESSAGE_START "<A name=\"" EFM_MESSAGE_START_ANAME "\"></A>" @@ -1868,7 +1867,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) GString *html; if (!(addrs = camel_header_address_decode (header->value, hdr_charset))) - return; + break; html = g_string_new(""); name = efh_format_address(efh, html, addrs, header->name); @@ -1883,7 +1882,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) GString *html; if (!(addrs = camel_header_address_decode (header->value, hdr_charset))) - return; + break; html = g_string_new(""); name = efh_format_address(efh, html, addrs, header->name); @@ -1942,15 +1941,30 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) if (!mailer_shown && mailer && (!g_ascii_strcasecmp (header->name, "X-Mailer") || !g_ascii_strcasecmp (header->name, "User-Agent") || - !g_ascii_strcasecmp (header->name, "X-Newsreader"))) { - struct _camel_header_raw xmailer; + !g_ascii_strcasecmp (header->name, "X-Newsreader") || + !g_ascii_strcasecmp (header->name, "X-MimeOLE"))) { + struct _camel_header_raw xmailer, *use_header = NULL; + + if (!g_ascii_strcasecmp (header->name, "X-MimeOLE")) { + for (use_header = header->next; use_header; use_header = use_header->next) { + if (!g_ascii_strcasecmp (use_header->name, "X-Mailer") || + !g_ascii_strcasecmp (use_header->name, "User-Agent") || + !g_ascii_strcasecmp (use_header->name, "X-Newsreader")) { + /* even we have X-MimeOLE, then use rather the standard one, when available */ + break; + } + } + } + + if (!use_header) + use_header = header; xmailer.name = "X-Evolution-Mailer"; - xmailer.value = header->value; + xmailer.value = use_header->value; mailer_shown = TRUE; efh_format_header (emf, stream, part, &xmailer, h->flags, charset); - if (strstr(header->value, "Evolution")) + if (strstr(use_header->value, "Evolution")) have_icon = TRUE; } else if (!g_ascii_strcasecmp (header->name, "Face") && !face_decoded) { char *cp = header->value; @@ -2086,7 +2100,7 @@ static void efh_format_source(EMFormat *emf, CamelStream *stream, CamelMimePart camel_stream_filter_add(filtered_stream, html_filter); camel_object_unref(html_filter); - camel_stream_write_string((CamelStream *)stream, EFH_TABLE_OPEN "<tr><td><tt>"); + camel_stream_write_string((CamelStream *)stream, "<table><tr><td><tt>"); em_format_format_text(emf, (CamelStream *)filtered_stream, dw); camel_object_unref(filtered_stream); diff --git a/mail/em-format-quote.c b/mail/em-format-quote.c index f7427eb284..804eead5fd 100644 --- a/mail/em-format-quote.c +++ b/mail/em-format-quote.c @@ -343,7 +343,9 @@ emfq_format_header (EMFormat *emf, CamelStream *stream, CamelMedium *part, const } else if (!strcmp (name, "X-Evolution-Mailer")) { /* pseudo-header */ if (!(txt = camel_medium_get_header (part, "x-mailer"))) if (!(txt = camel_medium_get_header (part, "user-agent"))) - return; + if (!(txt = camel_medium_get_header (part, "x-newsreader"))) + if (!(txt = camel_medium_get_header (part, "x-mimeole"))) + return; txt = value = camel_header_format_ctext (txt, charset); diff --git a/mail/em-format.c b/mail/em-format.c index eaa0d77185..483b86cf34 100644 --- a/mail/em-format.c +++ b/mail/em-format.c @@ -735,7 +735,7 @@ emf_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, Camel if (emf->valid == NULL) { emf->valid = valid; } else { - e_dlist_addtail(&emf->valid_parent->children, (EDListNode *)valid); + camel_dlist_addtail(&emf->valid_parent->children, (CamelDListNode *)valid); camel_cipher_validity_envelope(emf->valid_parent, valid); } @@ -1159,6 +1159,7 @@ em_format_describe_part(CamelMimePart *part, const char *mime_type) if ((filename = camel_mime_part_get_filename (part))) g_string_append_printf(stext, " (%s)", filename); if ((description = camel_mime_part_get_description(part)) && + (*description != 0) && !(filename && (strcmp(filename, description) == 0))) g_string_append_printf(stext, ", \"%s\"", description); diff --git a/mail/em-migrate.c b/mail/em-migrate.c index 6fa53646e8..07e9c1cdab 100644 --- a/mail/em-migrate.c +++ b/mail/em-migrate.c @@ -67,16 +67,19 @@ #include "e-util/e-util-private.h" #include "e-util/e-plugin.h" +#include "mail-component.h" #include "mail-config.h" +#include "mail-session.h" #include "em-utils.h" #include "em-migrate.h" #define d(x) x #ifndef G_OS_WIN32 - -/* No previous versions have been available on Win32, so don't bother - * with upgrade support from 1.x on Win32. +/* No versions previous to 2.8 or thereabouts have been available on + * Windows, so don't bother with upgrade support from earlier versions + * on Win32. Do try to support upgrades from 2.12 and later to the + * current version. */ /* upgrade helper functions */ @@ -1189,12 +1192,14 @@ em_migrate_session_new (const char *path) } +#endif /* !G_OS_WIN32 */ + static GtkWidget *window; static GtkLabel *label; static GtkProgressBar *progress; static void -em_migrate_setup_progress_dialog (void) +em_migrate_setup_progress_dialog (const char *desc) { GtkWidget *vbox, *hbox, *w; @@ -1207,9 +1212,8 @@ em_migrate_setup_progress_dialog (void) gtk_widget_show (vbox); gtk_container_add ((GtkContainer *) window, vbox); - w = gtk_label_new (_("The location and hierarchy of the Evolution mailbox " - "folders has changed since Evolution 1.x.\n\nPlease be " - "patient while Evolution migrates your folders...")); + w = gtk_label_new (desc); + gtk_label_set_line_wrap ((GtkLabel *) w, TRUE); gtk_widget_show (w); gtk_box_pack_start_defaults ((GtkBox *) vbox, w); @@ -1240,12 +1244,11 @@ em_migrate_set_folder_name (const char *folder_name) { char *text; - text = g_strdup_printf (_("Migrating `%s':"), folder_name); + text = g_strdup_printf (_("Migrating '%s':"), folder_name); gtk_label_set_text (label, text); g_free (text); gtk_progress_bar_set_fraction (progress, 0.0); - while (gtk_events_pending ()) gtk_main_iteration (); } @@ -1264,6 +1267,8 @@ em_migrate_set_progress (double percent) gtk_main_iteration (); } +#ifndef G_OS_WIN32 + static gboolean is_mail_folder (const char *metadata) { @@ -1476,10 +1481,8 @@ cp (const char *src, const char *dest, gboolean show_progress, int mode) goto exception; total += nwritten; -#ifndef G_OS_WIN32 if (show_progress) em_migrate_set_progress (((double) total) / ((double) st.st_size)); -#endif } while (total < st.st_size); if (fsync (writefd) == -1) @@ -1862,7 +1865,9 @@ em_migrate_local_folders_1_4 (EMMigrateSession *session, CamelException *ex) return -1; } - em_migrate_setup_progress_dialog (); + em_migrate_setup_progress_dialog (_("The location and hierarchy of the Evolution mailbox " + "folders has changed since Evolution 1.x.\n\nPlease be " + "patient while Evolution migrates your folders...")); while (res == 0 && (dent = readdir (dir))) { char *full_path; @@ -2671,7 +2676,7 @@ em_update_accounts_2_11 (void) mail_config_save_accounts (); } -#endif +#endif /* !G_OS_WIN32 */ static int emm_setup_initial(const char *evolution_dir) @@ -2837,6 +2842,113 @@ em_update_sa_junk_setting_2_23 (void) g_object_unref (client); } + +static void +migrate_folders(CamelStore *store, CamelFolderInfo *fi, const char *acc, CamelException *ex) +{ + CamelFolder *folder; + + while (fi) { + char *tmp = g_strdup_printf ("%s/%s", acc, fi->full_name); + em_migrate_set_folder_name (tmp); + g_free (tmp); + folder = camel_store_get_folder (store, fi->full_name, 0, ex); + if (folder != NULL) + camel_folder_summary_migrate_infos (folder->summary); + migrate_folders(store, fi->child, acc, ex); + fi = fi->next; + } +} + +static CamelStore * +setup_local_store (MailComponent *mc) +{ + CamelURL *url; + char *tmp; + CamelStore *store; + + url = camel_url_new("mbox:", NULL); + tmp = g_build_filename (mail_component_peek_base_directory(mc), "local", NULL); + camel_url_set_path(url, tmp); + g_free(tmp); + tmp = camel_url_to_string(url, 0); + store = (CamelStore *)camel_session_get_service(session, tmp, CAMEL_PROVIDER_STORE, NULL); + g_free(tmp); + + return store; + +} +static void +migrate_to_db() +{ + EAccountList *accounts; + EIterator *iter; + int i=0, len; + MailComponent *component = mail_component_peek (); + CamelStore *store = NULL; + CamelFolderInfo *info; + + if (!(accounts = mail_config_get_accounts ())) + return; + + iter = e_list_get_iterator ((EList *) accounts); + len = e_list_length ((EList *) accounts); + + camel_session_set_online ((CamelSession *) session, FALSE); + em_migrate_setup_progress_dialog (_("The summary format of the Evolution mailbox " + "folders has been moved to sqlite since Evolution 2.24.\n\nPlease be " + "patient while Evolution migrates your folders...")); + + em_migrate_set_progress ( (double)i/(len+1)); + store = setup_local_store (component); + info = camel_store_get_folder_info (store, NULL, CAMEL_STORE_FOLDER_INFO_RECURSIVE|CAMEL_STORE_FOLDER_INFO_FAST|CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, NULL); + if (info) { + migrate_folders(store, info, _("On This Computer"), NULL); + } + i++; + em_migrate_set_progress ( (double)i/(len+1)); + + + while (e_iterator_is_valid (iter)) { + EAccount *account = (EAccount *) e_iterator_get (iter); + EAccountService *service; + const char *name; + + + service = account->source; + name = account->name; + em_migrate_set_progress ( (double)i/(len+1)); + if (account->enabled + && service->url != NULL + && service->url[0] + && strncmp(service->url, "mbox:", 5) != 0) { + + CamelException ex; + + camel_exception_init (&ex); + mail_component_load_store_by_uri (component, service->url, name); + + store = (CamelStore *) camel_session_get_service (session, service->url, CAMEL_PROVIDER_STORE, &ex); + info = camel_store_get_folder_info (store, NULL, CAMEL_STORE_FOLDER_INFO_RECURSIVE|CAMEL_STORE_FOLDER_INFO_FAST|CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, &ex); + if (info) { + migrate_folders(store, info, account->name, &ex); + + } else + printf("%s:%s: failed to get folder infos \n", G_STRLOC, G_STRFUNC); + camel_exception_clear(&ex); + + } + i++; + e_iterator_next (iter); + + } + + //camel_session_set_online ((CamelSession *) session, TRUE); + + g_object_unref (iter); + em_migrate_close_progress_dialog (); +} + int em_migrate (const char *evolution_dir, int major, int minor, int revision, CamelException *ex) { @@ -2860,8 +2972,8 @@ em_migrate (const char *evolution_dir, int major, int minor, int revision, Camel if (major == 0) return emm_setup_initial(evolution_dir); -#ifndef G_OS_WIN32 if (major == 1 && minor < 5) { +#ifndef G_OS_WIN32 xmlDocPtr config_xmldb = NULL, filters, vfolders; path = g_build_filename (g_get_home_dir (), "evolution", NULL); @@ -2917,18 +3029,27 @@ em_migrate (const char *evolution_dir, int major, int minor, int revision, Camel } g_free (path); +#else + g_error ("Upgrading from ancient versions not supported on Windows"); +#endif } if (major < 2 || (major == 2 && minor < 12)) { +#ifndef G_OS_WIN32 em_update_accounts_2_11 (); +#else + g_error ("Upgrading from ancient versions not supported on Windows"); +#endif } + if (major < 2 || (major == 2 && minor < 22)) em_update_message_notify_settings_2_21 (); - if (major < 2 || (major == 2 && minor < 24)) + if (major < 2 || (major == 2 && minor < 24)) { em_update_sa_junk_setting_2_23 (); + migrate_to_db(); + } -#endif /* !G_OS_WIN32 */ return 0; } diff --git a/mail/em-network-prefs.c b/mail/em-network-prefs.c index ea44ef46b2..31b703864a 100644 --- a/mail/em-network-prefs.c +++ b/mail/em-network-prefs.c @@ -323,8 +323,7 @@ notify_proxy_type_changed (GtkWidget *widget, EMNetworkPrefs *prefs) emnp_set_sensitiveness (prefs, NETWORK_PROXY_MANUAL, FALSE); emnp_set_sensitiveness (prefs, NETWORK_PROXY_AUTOCONFIG, FALSE); if (type == NETWORK_PROXY_SYS_SETTINGS) { - d(g_print ("%s:%s:%d: Loading sys settings... \n", - __FILE__, __PRETTY_FUNCTION__, __LINE__)); + d(g_print ("%s:%s: Loading sys settings... \n", G_STRLOC, G_STRFUNC)); emnp_load_sys_settings (prefs->gconf); } @@ -357,11 +356,11 @@ widget_entry_changed_cb (GtkWidget *widget, gpointer data) if (GTK_IS_SPIN_BUTTON (widget)) { port = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (widget)); gconf_client_set_int (gconf, (const char *)data, port, NULL); - d(g_print ("%s:%s:%d: %s is SpinButton: value = [%d]\n", __FILE__, __PRETTY_FUNCTION__, __LINE__, (const char *)data, port)); + d(g_print ("%s:%s: %s is SpinButton: value = [%d]\n", G_STRLOC, G_STRFUNC, (const char *)data, port)); } else if (GTK_IS_ENTRY (widget)) { value = gtk_entry_get_text (GTK_ENTRY (widget)); gconf_client_set_string (gconf, (const char *)data, value, NULL); - d(g_print ("%s:%s:%d: %s is Entry: value = [%s]\n", __FILE__, __PRETTY_FUNCTION__, __LINE__, (const char *)data, value)); + d(g_print ("%s:%s: %s is Entry: value = [%s]\n", G_STRLOC, G_STRFUNC, (const char *)data, value)); } } diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index 23aca40c4d..8a5e3fd0dd 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -312,8 +312,8 @@ sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, in e_dlist_addtail(&sub->pending, (EDListNode *)node); } } else { - d(printf("%s:%d:%s: fi->flags & CAMEL_FOLDER_NOINFERIORS=%d\t node->path=[%p]\n", - __FILE__, __LINE__, __GNUC_PRETTY_FUNCTION__, fi->flags & CAMEL_FOLDER_NOINFERIORS, + d(printf("%s:%s: fi->flags & CAMEL_FOLDER_NOINFERIORS=%d\t node->path=[%p]\n", + G_STRLOC, G_STRFUNC, fi->flags & CAMEL_FOLDER_NOINFERIORS, node->path)); } @@ -408,7 +408,7 @@ sub_queue_fill_level(EMSubscribe *sub, EMSubscribeNode *node) struct _emse_folderinfo_msg *m; int id; - d(printf("%s:%d:%s: Starting get folderinfo of '%s'\n", __FILE__, __LINE__, __GNUC_PRETTY_FUNCTION__, + d(printf("%s:%s: Starting get folderinfo of '%s'\n", G_STRLOC, G_STRFUNC, node?node->info->full_name:"<root>")); m = mail_msg_new (&sub_folderinfo_info); @@ -501,7 +501,7 @@ sub_row_expanded(GtkTreeView *tree, GtkTreeIter *iter, GtkTreePath *path, EMSubs char *row_name; gtk_tree_model_get(model, iter, 1, &row_name, -1); - d(printf("%s:%d:%s: row-expanded '%s'\n", __FILE__, __LINE__, __GNUC_PRETTY_FUNCTION__, + d(printf("%s:%s: row-expanded '%s'\n", G_STRLOC, G_STRFUNC, row_name?row_name:"<root>")); /* Do we really need to fetch the children for this row? */ diff --git a/mail/em-utils.c b/mail/em-utils.c index ff686f3d8c..4fd8a98958 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1364,7 +1364,53 @@ em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part, gboolean mode) return path; } +/** em_utils_folder_is_templates: + * @folder: folder + * @uri: uri for this folder, if known + * + * Decides if @folder is a Templates folder. + * + * Returns %TRUE if this is a Drafts folder or %FALSE otherwise. + **/ + +gboolean +em_utils_folder_is_templates (CamelFolder *folder, const char *uri) +{ + EAccountList *accounts; + EAccount *account; + EIterator *iter; + int is = FALSE; + char *templates_uri; + if (folder == mail_component_get_folder (NULL, MAIL_COMPONENT_FOLDER_TEMPLATES)) + return TRUE; + + if (uri == NULL) + return FALSE; + + accounts = mail_config_get_accounts(); + iter = e_list_get_iterator ((EList *)accounts); + while (e_iterator_is_valid (iter)) { + account = (EAccount *)e_iterator_get (iter); + + if (account->templates_folder_uri) { + templates_uri = em_uri_to_camel (account->templates_folder_uri); + if (camel_store_folder_uri_equal (folder->parent_store, templates_uri, uri)) { + g_free (templates_uri); + is = TRUE; + break; + } + g_free (templates_uri); + } + + e_iterator_next (iter); + } + + g_object_unref (iter); + + return is; +} + /** * em_utils_folder_is_drafts: * @folder: folder diff --git a/mail/em-utils.h b/mail/em-utils.h index 045b922e3d..5fd05faafb 100644 --- a/mail/em-utils.h +++ b/mail/em-utils.h @@ -82,6 +82,7 @@ char *em_utils_temp_save_part(struct _GtkWidget *parent, struct _CamelMimePart * void em_utils_save_parts (struct _GtkWidget *parent, const char *prompt, GSList * parts); gboolean em_utils_folder_is_drafts(struct _CamelFolder *folder, const char *uri); +gboolean em_utils_folder_is_templates(struct _CamelFolder *folder, const char *uri); gboolean em_utils_folder_is_sent(struct _CamelFolder *folder, const char *uri); gboolean em_utils_folder_is_outbox(struct _CamelFolder *folder, const char *uri); diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in index 29d7dd12aa..7868d1f44c 100644 --- a/mail/evolution-mail.schemas.in +++ b/mail/evolution-mail.schemas.in @@ -318,9 +318,9 @@ <short>Load images for HTML messages over http</short> <long> Load images for HTML messages over http(s). Possible values are: - 0 - Never load images off the net. - 1 - Load images in messages from contacts. - 2 - Always load images off the net. + "0" - Never load images off the net. + "1" - Load images in messages from contacts. + "2" - Always load images off the net. </long> </locale> </schema> @@ -506,8 +506,9 @@ <locale name="C"> <short>Hides the per-folder preview and removes the selection</short> <long> - This key is read only once and reset to false after read. This unselects the - mail in the list and removes the preview for that folder. + This key is read only once and reset to "false" after read. This + unselects the mail in the list and removes the preview for that + folder. </long> </locale> </schema> @@ -1026,8 +1027,9 @@ <default>0</default> <locale name="C"> <short>Level beyond which the message should be logged.</short> - <long> This can have three possible values. 0 for errors. 1 for warnings. - 2 for debug messages. + <long> + This can have three possible values. "0" for errors. + "1" for warnings. "2" for debug messages. </long> </locale> </schema> @@ -1341,10 +1343,10 @@ <type>int</type> <default>60</default> <locale name="C"> - <short>Time interval, in seconds, how often upload store changes to server.</short> + <short>Server synchronization interval</short> <long> - Time interval, in seconds, how often upload store changes to server. - The actual value cannot be less than 30 seconds. + Controls how frequently local changes are synchronized with the + remote mail server. The interval must be at least 30 seconds. </long> </locale> </schema> diff --git a/mail/mail-component.c b/mail/mail-component.c index 18c489b7ae..f18ccb08d0 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -161,6 +161,7 @@ static struct { { N_("Drafts"), }, { N_("Outbox"), }, { N_("Sent"), }, + { N_("Templates"), }, { "Inbox", }, /* 'always local' inbox */ }; @@ -578,6 +579,8 @@ view_changed(EMFolderView *emfv, EComponentView *component_view) && (!strcmp (name, "Drafts") || !strcmp (name, "Inbox") || !strcmp (name, "Outbox") || !strcmp (name, "Sent"))) use_name = _(name); + else if (!strcmp (name, "INBOX")) + use_name = _("Inbox"); else use_name = name; @@ -753,7 +756,7 @@ impl_createView (PortableServer_Servant servant, gtk_widget_show (statusbar_widget); vbox = gtk_vbox_new(FALSE, 0); - info = e_info_label_new("stock_mail"); + info = e_info_label_new("evolution-mail"); e_info_label_set_info((EInfoLabel *)info, _("Mail"), ""); gtk_box_pack_start((GtkBox *)vbox, info, FALSE, TRUE, 0); gtk_box_pack_start((GtkBox *)vbox, tree_widget, TRUE, TRUE, 0); @@ -911,7 +914,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, CORBA_Environment list->_buffer[0].id = "message"; list->_buffer[0].description = _("New Mail Message"); - list->_buffer[0].menuDescription = _("_Mail Message"); + list->_buffer[0].menuDescription = (char *) C_("New", "_Mail Message"); list->_buffer[0].tooltip = _("Compose a new mail message"); list->_buffer[0].menuShortcut = 'm'; list->_buffer[0].iconName = "mail-message-new"; @@ -919,7 +922,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, CORBA_Environment list->_buffer[1].id = "folder"; list->_buffer[1].description = _("New Mail Folder"); - list->_buffer[1].menuDescription = _("Mail _Folder"); + list->_buffer[1].menuDescription = (char *) C_("New", "Mail _Folder"); list->_buffer[1].tooltip = _("Create a new mail folder"); list->_buffer[1].menuShortcut = '\0'; list->_buffer[1].iconName = "folder-new"; diff --git a/mail/mail-component.h b/mail/mail-component.h index 0a418d2238..9e775ad59f 100644 --- a/mail/mail-component.h +++ b/mail/mail-component.h @@ -47,6 +47,7 @@ enum _mail_component_folder_t { MAIL_COMPONENT_FOLDER_DRAFTS, MAIL_COMPONENT_FOLDER_OUTBOX, MAIL_COMPONENT_FOLDER_SENT, + MAIL_COMPONENT_FOLDER_TEMPLATES, MAIL_COMPONENT_FOLDER_LOCAL_INBOX, }; diff --git a/mail/mail-config.glade b/mail/mail-config.glade index 867f786f9f..41e5b27465 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -4962,7 +4962,7 @@ For example: "Work" or "Personal"</property> <widget class="GtkCheckButton" id="mlimit_checkbutton"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Do not format text contents in messages if the text si_ze exceeds</property> + <property name="label" translatable="yes">Do not format messages when text si_ze exceeds</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> @@ -5646,7 +5646,7 @@ For example: "Work" or "Personal"</property> <widget class="GtkCheckButton" id="chkPromptWantHTML"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">_Prompt when sending HTML messages to contacts that do not want them</property> + <property name="label" translatable="yes">_Prompt on sending HTML mail to contacts that do not want them</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> @@ -6847,7 +6847,7 @@ For example: "Work" or "Personal"</property> <child> <widget class="GtkLabel" id="label590"> <property name="visible">True</property> - <property name="label" translatable="yes">This option will be overridden if a match for custom junk headers is found.</property> + <property name="label" translatable="yes">Option is ignored if a match for custom junk headers is found.</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> diff --git a/mail/mail-dialogs.glade b/mail/mail-dialogs.glade index 398875ff3c..1ecf410ed5 100644 --- a/mail/mail-dialogs.glade +++ b/mail/mail-dialogs.glade @@ -235,17 +235,6 @@ </packing> </child> - <child> - <widget class="GtkNotebook" id="notebook1"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - <child> <widget class="GtkVBox" id="vbox161"> <property name="border_width">12</property> @@ -473,68 +462,8 @@ </packing> </child> </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label473"> - <property name="visible">True</property> - <property name="label" translatable="yes">Summary</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> </child> - <child> - <placeholder/> - </child> - - <child> - <widget class="GtkLabel" id="label474"> - <property name="visible">True</property> - <property name="label" translatable="yes">Details</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> </widget> </child> </widget> diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 7b3fd70551..bc0efb22fa 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1976,7 +1976,7 @@ static gchar * save_messages_desc (struct _save_messages_msg *m) { return g_strdup_printf(ngettext("Saving %d message", - "Saving %d messsages", m->uids->len), + "Saving %d messages", m->uids->len), m->uids->len); } diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index cf21b3c60f..6d0d83e46e 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -50,7 +50,7 @@ #include "mail-tools.h" #include "mail-vfolder.h" -#define d(x) /* (printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__), (x))*/ +#define d(x) /* (printf("%s:%s: ", G_STRLOC, G_STRFUNC), (x))*/ static EMVFolderContext *context; /* context remains open all time */ CamelStore *vfolder_store; /* the 1 static vfolder store */ diff --git a/mail/message-list.c b/mail/message-list.c index 8fd0ea8092..9149fd673b 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -2589,7 +2589,7 @@ find_next_selectable (MessageList *ml) return NULL; info = get_message_info (ml, node); - if (is_node_selectable (ml, info)) + if (info && is_node_selectable (ml, info)) return NULL; last = e_tree_row_count (ml->tree); @@ -2603,7 +2603,7 @@ find_next_selectable (MessageList *ml) while (vrow < last) { node = e_tree_node_at_row (et, vrow); info = get_message_info (ml, node); - if (is_node_selectable (ml, info)) + if (info && is_node_selectable (ml, info)) return g_strdup (camel_message_info_uid (info)); vrow ++; } @@ -2615,7 +2615,7 @@ find_next_selectable (MessageList *ml) while (vrow >= 0) { node = e_tree_node_at_row (et, vrow); info = get_message_info (ml, node); - if (is_node_selectable (ml, info)) + if (info && is_node_selectable (ml, info)) return g_strdup (camel_message_info_uid (info)); vrow --; } @@ -3644,6 +3644,9 @@ glib_crapback(void *key, void *data, void *x) struct _glibsuxcrap *y = x; CamelMessageInfo *mi; + if(y->count) + return; + mi = camel_folder_get_message_info(y->folder, key); if (mi) { y->count++; @@ -3651,7 +3654,7 @@ glib_crapback(void *key, void *data, void *x) } } -/* returns number of hidden messages */ +/* returns 0 or 1 depending if there are hidden messages */ unsigned int message_list_hidden(MessageList *ml) { @@ -4310,6 +4313,15 @@ mail_regen_list (MessageList *ml, const char *search, const char *hideexpr, Came camel_folder_thread_messages_ref(m->tree); } + if (message_list_length (ml) <= 0) { + /* there is some info why the message list is empty, let it be something useful */ + char *txt = g_strconcat (_("Generating message list"), "..." , NULL); + + e_tree_set_info_message (m->ml->tree, txt); + + g_free (txt); + } + /* if we're busy already kick off timeout processing, so normal updates are immediate */ if (ml->regen == NULL) ml_regen_timeout(m); |