aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/e-mail-browser.c38
-rw-r--r--mail/e-mail-enums.h7
-rw-r--r--mail/e-mail-notebook-view.c51
-rw-r--r--mail/e-mail-paned-view.c42
-rw-r--r--mail/e-mail-reader-utils.c9
-rw-r--r--mail/e-mail-reader-utils.h2
-rw-r--r--mail/e-mail-reader.c126
-rw-r--r--mail/e-mail-reader.h7
-rw-r--r--mail/em-composer-utils.c334
-rw-r--r--mail/em-composer-utils.h62
-rw-r--r--modules/mail/Makefile.am2
-rw-r--r--modules/mail/e-mail-attachment-handler.c27
-rw-r--r--modules/mail/e-mail-config-reader.c80
-rw-r--r--modules/mail/e-mail-config-reader.h30
-rw-r--r--modules/mail/e-mail-shell-backend.c34
-rw-r--r--modules/mail/e-mail-shell-content.c48
-rw-r--r--modules/mail/e-mail-shell-settings.c4
-rw-r--r--modules/mail/evolution-module-mail.c2
18 files changed, 614 insertions, 291 deletions
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c
index d1fe7ca90c..ed4d4c471c 100644
--- a/mail/e-mail-browser.c
+++ b/mail/e-mail-browser.c
@@ -67,8 +67,10 @@ enum {
PROP_0,
PROP_BACKEND,
PROP_FOCUS_TRACKER,
+ PROP_FORWARD_STYLE,
PROP_GROUP_BY_THREADS,
PROP_SHOW_DELETED,
+ PROP_REPLY_STYLE,
PROP_UI_MANAGER
};
@@ -361,12 +363,24 @@ mail_browser_set_property (GObject *object,
g_value_get_object (value));
return;
+ case PROP_FORWARD_STYLE:
+ e_mail_reader_set_forward_style (
+ E_MAIL_READER (object),
+ g_value_get_enum (value));
+ return;
+
case PROP_GROUP_BY_THREADS:
e_mail_reader_set_group_by_threads (
E_MAIL_READER (object),
g_value_get_boolean (value));
return;
+ case PROP_REPLY_STYLE:
+ e_mail_reader_set_reply_style (
+ E_MAIL_READER (object),
+ g_value_get_enum (value));
+ return;
+
case PROP_SHOW_DELETED:
e_mail_browser_set_show_deleted (
E_MAIL_BROWSER (object),
@@ -396,12 +410,24 @@ mail_browser_get_property (GObject *object,
E_MAIL_BROWSER (object)));
return;
+ case PROP_FORWARD_STYLE:
+ g_value_set_enum (
+ value, e_mail_reader_get_forward_style (
+ E_MAIL_READER (object)));
+ return;
+
case PROP_GROUP_BY_THREADS:
g_value_set_boolean (
value, e_mail_reader_get_group_by_threads (
E_MAIL_READER (object)));
return;
+ case PROP_REPLY_STYLE:
+ g_value_set_enum (
+ value, e_mail_reader_get_reply_style (
+ E_MAIL_READER (object)));
+ return;
+
case PROP_SHOW_DELETED:
g_value_set_boolean (
value, e_mail_browser_get_show_deleted (
@@ -805,9 +831,21 @@ mail_browser_class_init (EMailBrowserClass *class)
/* Inherited from EMailReader */
g_object_class_override_property (
object_class,
+ PROP_FORWARD_STYLE,
+ "forward-style");
+
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
PROP_GROUP_BY_THREADS,
"group-by-threads");
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
+ PROP_REPLY_STYLE,
+ "reply-style");
+
g_object_class_install_property (
object_class,
PROP_SHOW_DELETED,
diff --git a/mail/e-mail-enums.h b/mail/e-mail-enums.h
index 6dd985e1ad..1e2e4a2865 100644
--- a/mail/e-mail-enums.h
+++ b/mail/e-mail-enums.h
@@ -61,6 +61,13 @@ typedef enum {
E_MAIL_REPLY_STYLE_OUTLOOK
} EMailReplyStyle;
+typedef enum {
+ E_MAIL_REPLY_TO_SENDER,
+ E_MAIL_REPLY_TO_FROM,
+ E_MAIL_REPLY_TO_ALL,
+ E_MAIL_REPLY_TO_LIST
+} EMailReplyType;
+
G_END_DECLS
#endif /* E_MAIL_ENUMS_H */
diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c
index 9b0d36076b..1fd9c73a23 100644
--- a/mail/e-mail-notebook-view.c
+++ b/mail/e-mail-notebook-view.c
@@ -64,7 +64,9 @@ struct _EMailNotebookViewPrivate {
enum {
PROP_0,
+ PROP_FORWARD_STYLE,
PROP_GROUP_BY_THREADS,
+ PROP_REPLY_STYLE
};
#define E_SHELL_WINDOW_ACTION_GROUP_MAIL(window) \
@@ -573,12 +575,28 @@ mail_notebook_view_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
+ EMailNotebookViewPrivate *priv;
+
+ priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (object);
+
switch (property_id) {
+ case PROP_FORWARD_STYLE:
+ e_mail_reader_set_forward_style (
+ E_MAIL_READER (priv->current_view),
+ g_value_get_enum (value));
+ return;
+
case PROP_GROUP_BY_THREADS:
e_mail_reader_set_group_by_threads (
- E_MAIL_READER (E_MAIL_NOTEBOOK_VIEW (object)->priv->current_view),
+ E_MAIL_READER (priv->current_view),
g_value_get_boolean (value));
return;
+
+ case PROP_REPLY_STYLE:
+ e_mail_reader_set_reply_style (
+ E_MAIL_READER (priv->current_view),
+ g_value_get_enum (value));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -590,14 +608,31 @@ mail_notebook_view_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
+ EMailNotebookViewPrivate *priv;
+
+ priv = E_MAIL_NOTEBOOK_VIEW_GET_PRIVATE (object);
+
switch (property_id) {
+ case PROP_FORWARD_STYLE:
+ g_value_set_enum (
+ value,
+ e_mail_reader_get_forward_style (
+ E_MAIL_READER (priv->current_view)));
+ return;
+
case PROP_GROUP_BY_THREADS:
g_value_set_boolean (
value,
e_mail_reader_get_group_by_threads (
- E_MAIL_READER (E_MAIL_NOTEBOOK_VIEW (object)->priv->current_view)));
+ E_MAIL_READER (priv->current_view)));
return;
+ case PROP_REPLY_STYLE:
+ g_value_set_enum (
+ value,
+ e_mail_reader_get_reply_style (
+ E_MAIL_READER (priv->current_view)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -1255,8 +1290,20 @@ e_mail_notebook_view_class_init (EMailNotebookViewClass *class)
/* Inherited from EMailReader */
g_object_class_override_property (
object_class,
+ PROP_FORWARD_STYLE,
+ "forward-style");
+
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
PROP_GROUP_BY_THREADS,
"group-by-threads");
+
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
+ PROP_REPLY_STYLE,
+ "reply-style");
}
static void
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index 236c7cb782..b298c5e08f 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -75,7 +75,9 @@ struct _EMailPanedViewPrivate {
enum {
PROP_0,
- PROP_GROUP_BY_THREADS
+ PROP_FORWARD_STYLE,
+ PROP_GROUP_BY_THREADS,
+ PROP_REPLY_STYLE
};
#define STATE_KEY_GROUP_BY_THREADS "GroupByThreads"
@@ -260,11 +262,23 @@ mail_paned_view_set_property (GObject *object,
GParamSpec *pspec)
{
switch (property_id) {
+ case PROP_FORWARD_STYLE:
+ e_mail_reader_set_forward_style (
+ E_MAIL_READER (object),
+ g_value_get_enum (value));
+ return;
+
case PROP_GROUP_BY_THREADS:
e_mail_reader_set_group_by_threads (
E_MAIL_READER (object),
g_value_get_boolean (value));
return;
+
+ case PROP_REPLY_STYLE:
+ e_mail_reader_set_reply_style (
+ E_MAIL_READER (object),
+ g_value_get_enum (value));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -277,12 +291,26 @@ mail_paned_view_get_property (GObject *object,
GParamSpec *pspec)
{
switch (property_id) {
+ case PROP_FORWARD_STYLE:
+ g_value_set_enum (
+ value,
+ e_mail_reader_get_forward_style (
+ E_MAIL_READER (object)));
+ return;
+
case PROP_GROUP_BY_THREADS:
g_value_set_boolean (
value,
e_mail_reader_get_group_by_threads (
E_MAIL_READER (object)));
return;
+
+ case PROP_REPLY_STYLE:
+ g_value_set_enum (
+ value,
+ e_mail_reader_get_reply_style (
+ E_MAIL_READER (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -895,8 +923,20 @@ e_mail_paned_view_class_init (EMailPanedViewClass *class)
/* Inherited from EMailReader */
g_object_class_override_property (
object_class,
+ PROP_FORWARD_STYLE,
+ "forward-style");
+
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
PROP_GROUP_BY_THREADS,
"group-by-threads");
+
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
+ PROP_REPLY_STYLE,
+ "reply-style");
}
static void
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index 84fdfd8c16..a049e6eb84 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -392,7 +392,7 @@ html_contains_nonwhitespace (const gchar *html,
void
e_mail_reader_reply_to_message (EMailReader *reader,
CamelMimeMessage *src_message,
- gint reply_mode)
+ EMailReplyType reply_type)
{
EShell *shell;
EMailBackend *backend;
@@ -401,6 +401,7 @@ e_mail_reader_reply_to_message (EMailReader *reader,
GtkWidget *message_list;
CamelMimeMessage *new_message;
CamelFolder *folder;
+ EMailReplyStyle reply_style;
EWebView *web_view;
struct _camel_header_raw *header;
const gchar *uid;
@@ -417,6 +418,7 @@ e_mail_reader_reply_to_message (EMailReader *reader,
folder = e_mail_reader_get_folder (reader);
formatter = e_mail_reader_get_formatter (reader);
message_list = e_mail_reader_get_message_list (reader);
+ reply_style = e_mail_reader_get_reply_style (reader);
shell_backend = E_SHELL_BACKEND (backend);
shell = e_shell_backend_get_shell (shell_backend);
@@ -469,7 +471,8 @@ e_mail_reader_reply_to_message (EMailReader *reader,
g_object_unref (src_message);
em_utils_reply_to_message (
- shell, folder, uid, new_message, reply_mode, NULL);
+ shell, folder, uid, new_message,
+ reply_type, reply_style, NULL);
g_free (selection);
@@ -478,7 +481,7 @@ e_mail_reader_reply_to_message (EMailReader *reader,
whole_message:
em_utils_reply_to_message (
shell, folder, uid, src_message,
- reply_mode, EM_FORMAT (formatter));
+ reply_type, reply_style, EM_FORMAT (formatter));
}
void
diff --git a/mail/e-mail-reader-utils.h b/mail/e-mail-reader-utils.h
index 9f3a06bb81..04b46b6257 100644
--- a/mail/e-mail-reader-utils.h
+++ b/mail/e-mail-reader-utils.h
@@ -49,7 +49,7 @@ void e_mail_reader_print (EMailReader *reader,
GtkPrintOperationAction action);
void e_mail_reader_reply_to_message (EMailReader *reader,
CamelMimeMessage *message,
- gint reply_mode);
+ EMailReplyType reply_type);
void e_mail_reader_select_next_message
(EMailReader *reader,
gboolean or_else_previous);
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 92f6129530..a45301f3fe 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -40,6 +40,7 @@
#include "mail/e-mail-backend.h"
#include "mail/e-mail-browser.h"
#include "mail/e-mail-display.h"
+#include "mail/e-mail-enumtypes.h"
#include "mail/e-mail-reader-utils.h"
#include "mail/em-composer-utils.h"
#include "mail/em-event.h"
@@ -106,6 +107,8 @@ enum {
static gchar *default_xfer_messages_uri;
static GQuark quark_private;
+static GQuark quark_forward_style;
+static GQuark quark_reply_style;
static guint signals[LAST_SIGNAL];
G_DEFINE_INTERFACE (EMailReader, e_mail_reader, G_TYPE_OBJECT)
@@ -601,7 +604,9 @@ action_mail_forward_cb (GtkAction *action,
shell = e_shell_backend_get_shell (shell_backend);
if (em_utils_ask_open_many (window, uids->len))
- em_utils_forward_messages (shell, folder, uids, folder_uri);
+ em_utils_forward_messages (
+ shell, folder, uids, folder_uri,
+ e_mail_reader_get_forward_style (reader));
else
em_utils_uids_free (uids);
@@ -632,7 +637,9 @@ action_mail_forward_attached_cb (GtkAction *action,
shell = e_shell_backend_get_shell (shell_backend);
if (em_utils_ask_open_many (window, uids->len))
- em_utils_forward_attached (shell, folder, uids, folder_uri);
+ em_utils_forward_messages (
+ shell, folder, uids, folder_uri,
+ E_MAIL_FORWARD_STYLE_ATTACHED);
else
em_utils_uids_free (uids);
@@ -663,7 +670,9 @@ action_mail_forward_inline_cb (GtkAction *action,
shell = e_shell_backend_get_shell (shell_backend);
if (em_utils_ask_open_many (window, uids->len))
- em_utils_forward_inline (shell, folder, uids, folder_uri);
+ em_utils_forward_messages (
+ shell, folder, uids, folder_uri,
+ E_MAIL_FORWARD_STYLE_INLINE);
else
em_utils_uids_free (uids);
@@ -694,7 +703,9 @@ action_mail_forward_quoted_cb (GtkAction *action,
shell = e_shell_backend_get_shell (shell_backend);
if (em_utils_ask_open_many (window, uids->len))
- em_utils_forward_quoted (shell, folder, uids, folder_uri);
+ em_utils_forward_messages (
+ shell, folder, uids, folder_uri,
+ E_MAIL_FORWARD_STYLE_QUOTED);
else
em_utils_uids_free (uids);
@@ -1118,7 +1129,7 @@ action_mail_reply_all_check (CamelFolder *folder,
EMailReader *reader = user_data;
CamelInternetAddress *to, *cc;
gint recip_count = 0;
- gint mode = REPLY_MODE_ALL;
+ EMailReplyType type = E_MAIL_REPLY_TO_ALL;
if (!message)
return;
@@ -1163,12 +1174,12 @@ action_mail_reply_all_check (CamelFolder *folder,
gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_NO)
- mode = REPLY_MODE_SENDER;
+ type = E_MAIL_REPLY_TO_SENDER;
else if (response == GTK_RESPONSE_CANCEL)
return;
}
- e_mail_reader_reply_to_message (reader, message, mode);
+ e_mail_reader_reply_to_message (reader, message, type);
check_close_browser_reader (reader);
}
@@ -1218,13 +1229,13 @@ action_mail_reply_all_cb (GtkAction *action,
return;
}
- e_mail_reader_reply_to_message (reader, NULL, REPLY_MODE_ALL);
+ e_mail_reader_reply_to_message (reader, NULL, E_MAIL_REPLY_TO_ALL);
check_close_browser_reader (reader);
}
static void
action_mail_reply_group_cb (GtkAction *action,
- EMailReader *reader)
+ EMailReader *reader)
{
GConfClient *client;
gboolean reply_list;
@@ -1239,7 +1250,8 @@ action_mail_reply_group_cb (GtkAction *action,
g_object_unref (client);
if (reply_list && (state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
- e_mail_reader_reply_to_message (reader, NULL, REPLY_MODE_LIST);
+ e_mail_reader_reply_to_message (
+ reader, NULL, E_MAIL_REPLY_TO_LIST);
check_close_browser_reader (reader);
} else
action_mail_reply_all_cb (action, reader);
@@ -1249,7 +1261,7 @@ static void
action_mail_reply_list_cb (GtkAction *action,
EMailReader *reader)
{
- e_mail_reader_reply_to_message (reader, NULL, REPLY_MODE_LIST);
+ e_mail_reader_reply_to_message (reader, NULL, E_MAIL_REPLY_TO_LIST);
check_close_browser_reader (reader);
}
@@ -1261,7 +1273,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
{
EMailReader *reader = user_data;
GConfClient *client;
- gint mode = REPLY_MODE_SENDER;
+ EMailReplyType type = E_MAIL_REPLY_TO_SENDER;
const gchar *key;
gboolean ask_ignore_list_reply_to;
gboolean ask_list_reply_to;
@@ -1313,9 +1325,9 @@ action_mail_reply_sender_check (CamelFolder *folder,
gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_YES)
- mode = REPLY_MODE_ALL;
+ type = E_MAIL_REPLY_TO_ALL;
else if (response == GTK_RESPONSE_OK)
- mode = REPLY_MODE_LIST;
+ type = E_MAIL_REPLY_TO_LIST;
else if (response == GTK_RESPONSE_CANCEL)
goto exit;
@@ -1363,14 +1375,14 @@ action_mail_reply_sender_check (CamelFolder *folder,
gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_NO)
- mode = REPLY_MODE_FROM;
+ type = E_MAIL_REPLY_TO_FROM;
else if (response == GTK_RESPONSE_OK)
- mode = REPLY_MODE_LIST;
+ type = E_MAIL_REPLY_TO_LIST;
else if (response == GTK_RESPONSE_CANCEL)
goto exit;
}
- e_mail_reader_reply_to_message (reader, message, mode);
+ e_mail_reader_reply_to_message (reader, message, type);
check_close_browser_reader (reader);
exit:
@@ -1426,7 +1438,7 @@ action_mail_reply_sender_cb (GtkAction *action,
action_mail_reply_sender_check (NULL, NULL, message, reader);
return;
}
- e_mail_reader_reply_to_message (reader, NULL, REPLY_MODE_SENDER);
+ e_mail_reader_reply_to_message (reader, NULL, E_MAIL_REPLY_TO_SENDER);
check_close_browser_reader (reader);
}
@@ -3189,7 +3201,17 @@ mail_reader_init_charset_actions (EMailReader *reader)
static void
e_mail_reader_default_init (EMailReaderInterface *interface)
{
- quark_private = g_quark_from_static_string ("EMailReader-private");
+ quark_private = g_quark_from_static_string ("e-mail-reader-private");
+
+ /* Forward and reply styles are stored outside of the private
+ * structure as a workaround for EMailShellContent, which loads
+ * extensions long before the private structure is initialized,
+ * and one of those extensions binds our "forward-style" and
+ * "reply-style" properties to EShellSettings properties. */
+ quark_forward_style =
+ g_quark_from_static_string ("e-mail-reader-forward-style");
+ quark_reply_style =
+ g_quark_from_static_string ("e-mail-reader-reply-style");
interface->get_selected_uids = mail_reader_get_selected_uids;
interface->get_folder = mail_reader_get_folder;
@@ -3202,6 +3224,16 @@ e_mail_reader_default_init (EMailReaderInterface *interface)
g_object_interface_install_property (
interface,
+ g_param_spec_enum (
+ "forward-style",
+ "Forward Style",
+ "How to forward messages",
+ E_TYPE_MAIL_FORWARD_STYLE,
+ E_MAIL_FORWARD_STYLE_ATTACHED,
+ G_PARAM_READWRITE));
+
+ g_object_interface_install_property (
+ interface,
g_param_spec_boolean (
"group-by-threads",
"Group by Threads",
@@ -3209,6 +3241,16 @@ e_mail_reader_default_init (EMailReaderInterface *interface)
FALSE,
G_PARAM_READWRITE));
+ g_object_interface_install_property (
+ interface,
+ g_param_spec_enum (
+ "reply-style",
+ "Reply Style",
+ "How to reply to messages",
+ E_TYPE_MAIL_REPLY_STYLE,
+ E_MAIL_REPLY_STYLE_QUOTED,
+ G_PARAM_READWRITE));
+
signals[CHANGED] = g_signal_new (
"changed",
G_OBJECT_CLASS_TYPE (interface),
@@ -3913,6 +3955,29 @@ e_mail_reader_open_selected_mail (EMailReader *reader)
return interface->open_selected_mail (reader);
}
+EMailForwardStyle
+e_mail_reader_get_forward_style (EMailReader *reader)
+{
+ g_return_val_if_fail (E_IS_MAIL_READER (reader), 0);
+
+ return (EMailForwardStyle)
+ GPOINTER_TO_INT (g_object_get_qdata (
+ G_OBJECT (reader), quark_forward_style));
+}
+
+void
+e_mail_reader_set_forward_style (EMailReader *reader,
+ EMailForwardStyle style)
+{
+ g_return_if_fail (E_IS_MAIL_READER (reader));
+
+ g_object_set_qdata (
+ G_OBJECT (reader), quark_forward_style,
+ GINT_TO_POINTER (style));
+
+ g_object_notify (G_OBJECT (reader), "forward-style");
+}
+
gboolean
e_mail_reader_get_group_by_threads (EMailReader *reader)
{
@@ -3949,6 +4014,29 @@ e_mail_reader_set_group_by_threads (EMailReader *reader,
g_object_notify (G_OBJECT (reader), "group-by-threads");
}
+EMailReplyStyle
+e_mail_reader_get_reply_style (EMailReader *reader)
+{
+ g_return_val_if_fail (E_IS_MAIL_READER (reader), 0);
+
+ return (EMailReplyStyle)
+ GPOINTER_TO_INT (g_object_get_qdata (
+ G_OBJECT (reader), quark_reply_style));
+}
+
+void
+e_mail_reader_set_reply_style (EMailReader *reader,
+ EMailReplyStyle style)
+{
+ g_return_if_fail (E_IS_MAIL_READER (reader));
+
+ g_object_set_qdata (
+ G_OBJECT (reader), quark_reply_style,
+ GINT_TO_POINTER (style));
+
+ g_object_notify (G_OBJECT (reader), "reply-style");
+}
+
void
e_mail_reader_create_charset_menu (EMailReader *reader,
GtkUIManager *ui_manager,
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index 5dcbaaa010..ff7ae4210b 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -139,11 +139,18 @@ void e_mail_reader_set_folder_uri (EMailReader *reader,
const gchar *folder_uri);
void e_mail_reader_set_message (EMailReader *reader,
const gchar *uid);
+EMailForwardStyle
+ e_mail_reader_get_forward_style (EMailReader *reader);
+void e_mail_reader_set_forward_style (EMailReader *reader,
+ EMailForwardStyle style);
gboolean e_mail_reader_get_group_by_threads
(EMailReader *reader);
void e_mail_reader_set_group_by_threads
(EMailReader *reader,
gboolean group_by_threads);
+EMailReplyStyle e_mail_reader_get_reply_style (EMailReader *reader);
+void e_mail_reader_set_reply_style (EMailReader *reader,
+ EMailReplyStyle style);
void e_mail_reader_create_charset_menu
(EMailReader *reader,
GtkUIManager *ui_manager,
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 505d50e850..704bd2bd37 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -71,6 +71,7 @@
#define GCONF_KEY_TEMPLATE_PLACEHOLDERS "/apps/evolution/mail/template_placeholders"
typedef struct _AsyncContext AsyncContext;
+typedef struct _ForwardData ForwardData;
struct _AsyncContext {
CamelMimeMessage *message;
@@ -80,6 +81,14 @@ struct _AsyncContext {
gchar *message_uid;
};
+struct _ForwardData {
+ EShell *shell;
+ CamelFolder *folder;
+ GPtrArray *uids;
+ gchar *from_uri;
+ EMailForwardStyle style;
+};
+
static void
async_context_free (AsyncContext *context)
{
@@ -98,6 +107,23 @@ async_context_free (AsyncContext *context)
g_slice_free (AsyncContext, context);
}
+static void
+forward_data_free (ForwardData *data)
+{
+ if (data->shell != NULL)
+ g_object_unref (data->shell);
+
+ if (data->folder != NULL)
+ g_object_unref (data->folder);
+
+ if (data->uids != NULL)
+ em_utils_uids_free (data->uids);
+
+ g_free (data->from_uri);
+
+ g_slice_free (ForwardData, data);
+}
+
static gboolean
ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EDestination **recipients)
{
@@ -1194,15 +1220,6 @@ emu_update_composers_security (EMsgComposer *composer, guint32 validity_found)
}
}
-/* Forwarding messages... */
-struct forward_attached_data
-{
- EShell *shell;
- CamelFolder *folder;
- GPtrArray *uids;
- gchar *from_uri;
-};
-
static void
real_update_forwarded_flag (gpointer uid, gpointer folder)
{
@@ -1213,44 +1230,40 @@ real_update_forwarded_flag (gpointer uid, gpointer folder)
}
static void
-update_forwarded_flags_cb (EMsgComposer *composer, gpointer user_data)
-{
- struct forward_attached_data *fad = (struct forward_attached_data *) user_data;
-
- if (fad && fad->uids && fad->folder)
- g_ptr_array_foreach (fad->uids, real_update_forwarded_flag, fad->folder);
-}
-
-static void
-composer_destroy_fad_cb (gpointer user_data, GObject *deadbeef)
+update_forwarded_flags_cb (EMsgComposer *composer,
+ ForwardData *data)
{
- struct forward_attached_data *fad = (struct forward_attached_data*) user_data;
-
- if (fad) {
- g_object_unref (fad->folder);
- em_utils_uids_free (fad->uids);
- g_free (fad);
- }
+ if (data && data->uids && data->folder)
+ g_ptr_array_foreach (
+ data->uids, real_update_forwarded_flag, data->folder);
}
static void
-setup_forward_attached_callbacks (EMsgComposer *composer, CamelFolder *folder, GPtrArray *uids)
+setup_forward_attached_callbacks (EMsgComposer *composer,
+ CamelFolder *folder,
+ GPtrArray *uids)
{
- struct forward_attached_data *fad;
+ ForwardData *data;
if (!composer || !folder || !uids || !uids->len)
return;
g_object_ref (folder);
- fad = g_new0 (struct forward_attached_data, 1);
- fad->folder = folder;
- fad->uids = em_utils_uids_copy (uids);
+ data = g_slice_new0 (ForwardData);
+ data->folder = g_object_ref (folder);
+ data->uids = em_utils_uids_copy (uids);
- g_signal_connect (composer, "send", G_CALLBACK (update_forwarded_flags_cb), fad);
- g_signal_connect (composer, "save-draft", G_CALLBACK (update_forwarded_flags_cb), fad);
+ g_signal_connect (
+ composer, "send",
+ G_CALLBACK (update_forwarded_flags_cb), data);
+ g_signal_connect (
+ composer, "save-draft",
+ G_CALLBACK (update_forwarded_flags_cb), data);
- g_object_weak_ref ((GObject *) composer, (GWeakNotify) composer_destroy_fad_cb, fad);
+ g_object_set_data_full (
+ G_OBJECT (composer), "forward-data", data,
+ (GDestroyNotify) forward_data_free);
}
static EMsgComposer *
@@ -1287,49 +1300,14 @@ forward_attached_cb (CamelFolder *folder,
gchar *subject,
gpointer user_data)
{
- struct forward_attached_data *fad = user_data;
+ ForwardData *data = user_data;
if (part)
forward_attached (
- fad->shell, folder, fad->uids,
- messages, part, subject, fad->from_uri);
-
- g_object_unref (fad->shell);
- g_free (fad->from_uri);
- g_free (fad);
-}
+ data->shell, folder, data->uids,
+ messages, part, subject, data->from_uri);
-/**
- * em_utils_forward_attached:
- * @shell: an #EShell
- * @folder: folder containing messages to forward
- * @uids: uids of messages to forward
- * @from_uri: from folder uri
- *
- * If there is more than a single message in @uids, a multipart/digest
- * will be constructed and attached to a new composer window preset
- * with the appropriate header defaults for forwarding the first
- * message in the list. If only one message is to be forwarded, it is
- * forwarded as a simple message/rfc822 attachment.
- **/
-void
-em_utils_forward_attached (EShell *shell,
- CamelFolder *folder,
- GPtrArray *uids,
- const gchar *from_uri)
-{
- struct forward_attached_data *fad;
-
- g_return_if_fail (E_IS_SHELL (shell));
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
- g_return_if_fail (uids != NULL);
-
- fad = g_new0 (struct forward_attached_data, 1);
- fad->shell = g_object_ref (shell);
- fad->uids = uids;
- fad->from_uri = g_strdup (from_uri);
-
- mail_build_attachment (folder, uids, forward_attached_cb, fad);
+ forward_data_free (data);
}
static EMsgComposer *
@@ -1393,133 +1371,33 @@ forward_non_attached (EShell *shell,
return composer;
}
-typedef struct {
- EShell *shell;
- gchar *from_uri;
-} ForwardData;
-
-static void
-forward_inline_cb (CamelFolder *folder,
- GPtrArray *uids,
- GPtrArray *messages,
- gpointer user_data)
-{
- ForwardData *data = user_data;
-
- forward_non_attached (
- data->shell, folder, uids, messages,
- E_MAIL_FORWARD_STYLE_INLINE, data->from_uri);
-
- g_free (data->from_uri);
- g_object_unref (data->shell);
- g_slice_free (ForwardData, data);
-}
-
-/**
- * em_utils_forward_inline:
- * @shell: an #EShell
- * @folder: folder containing messages to forward
- * @uids: uids of messages to forward
- * @from_uri: from folder/account uri
- *
- * Forwards each message in the 'inline' form, each in its own composer window.
- **/
-void
-em_utils_forward_inline (EShell *shell,
- CamelFolder *folder,
- GPtrArray *uids,
- const gchar *from_uri)
-{
- ForwardData *data;
-
- g_return_if_fail (E_IS_SHELL (shell));
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
- g_return_if_fail (uids != NULL);
-
- data = g_slice_new (ForwardData);
- data->shell = g_object_ref (shell);
- data->from_uri = g_strdup (from_uri);
-
- mail_get_messages (folder, uids, forward_inline_cb, data);
-}
-
-static void
-forward_quoted_cb (CamelFolder *folder,
- GPtrArray *uids,
- GPtrArray *messages,
- gpointer user_data)
-{
- ForwardData *data = user_data;
-
- forward_non_attached (
- data->shell, folder, uids, messages,
- E_MAIL_FORWARD_STYLE_QUOTED, data->from_uri);
-
- g_free (data->from_uri);
- g_object_unref (data->shell);
- g_slice_free (ForwardData, data);
-}
-
-/**
- * em_utils_forward_quoted:
- * @shell: an #EShell
- * @folder: folder containing messages to forward
- * @uids: uids of messages to forward
- * @from_uri: from folder uri
- *
- * Forwards each message in the 'quoted' form (each line starting with
- * a "> "), each in its own composer window.
- **/
-void
-em_utils_forward_quoted (EShell *shell,
- CamelFolder *folder,
- GPtrArray *uids,
- const gchar *from_uri)
-{
- ForwardData *data;
-
- g_return_if_fail (E_IS_SHELL (shell));
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
- g_return_if_fail (uids != NULL);
-
- data = g_slice_new (ForwardData);
- data->shell = g_object_ref (shell);
- data->from_uri = g_strdup (from_uri);
-
- mail_get_messages (folder, uids, forward_quoted_cb, data);
-}
-
/**
* em_utils_forward_message:
* @shell: an #EShell
* @message: message to be forwarded
* @from_uri: from folder uri
+ * @style: the forward style to use
*
- * Forwards a message in the user's configured default style.
+ * Forwards a message in the given style. See em_utils_forward_messages()
+ * for more details about forwarding styles.
**/
EMsgComposer *
em_utils_forward_message (EShell *shell,
CamelMimeMessage *message,
- const gchar *from_uri)
+ const gchar *from_uri,
+ EMailForwardStyle style)
{
GPtrArray *messages;
CamelMimePart *part;
- GConfClient *client;
- const gchar *key;
gchar *subject;
- EMailForwardStyle style;
EMsgComposer *composer = NULL;
g_return_val_if_fail (E_IS_SHELL (shell), NULL);
+ g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), NULL);
messages = g_ptr_array_new ();
g_ptr_array_add (messages, message);
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/format/forward_style";
- style = gconf_client_get_int (client, key, NULL);
- g_object_unref (client);
-
switch (style) {
case E_MAIL_FORWARD_STYLE_ATTACHED:
default:
@@ -1552,43 +1430,75 @@ em_utils_forward_message (EShell *shell,
return composer;
}
+static void
+forward_got_messages_cb (CamelFolder *folder,
+ GPtrArray *uids,
+ GPtrArray *messages,
+ gpointer user_data)
+{
+ ForwardData *data = user_data;
+
+ forward_non_attached (
+ data->shell, folder, uids, messages,
+ data->style, data->from_uri);
+
+ forward_data_free (data);
+}
+
/**
* em_utils_forward_messages:
* @shell: an #EShell
* @folder: folder containing messages to forward
* @uids: uids of messages to forward
+ * @style: the forward style to use
+ *
+ * Forwards a group of messages in the given style.
+ *
+ * If @style is #E_MAIL_FORWARD_STYLE_ATTACHED, the new message is
+ * created as follows. If there is more than a single message in @uids,
+ * a multipart/digest will be constructed and attached to a new composer
+ * window preset with the appropriate header defaults for forwarding the
+ * first message in the list. If only one message is to be forwarded,
+ * it is forwarded as a simple message/rfc822 attachment.
+ *
+ * If @style is #E_MAIL_FORWARD_STYLE_INLINE, each message is forwarded
+ * in its own composer window in 'inline' form.
*
- * Forwards a group of messages in the user's configured default
- * style.
+ * If @style is #E_MAIL_FORWARD_STYLE_QUOTED, each message is forwarded
+ * in its own composer window in 'quoted' form (each line starting with
+ * a "> ").
**/
void
em_utils_forward_messages (EShell *shell,
CamelFolder *folder,
GPtrArray *uids,
- const gchar *from_uri)
+ const gchar *from_uri,
+ EMailForwardStyle style)
{
- GConfClient *client;
- const gchar *key;
- EMailForwardStyle style;
+ ForwardData *data;
g_return_if_fail (E_IS_SHELL (shell));
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/format/forward_style";
- style = gconf_client_get_int (client, key, NULL);
- g_object_unref (client);
+ data = g_slice_new0 (ForwardData);
+ data->shell = g_object_ref (shell);
+ data->uids = em_utils_uids_copy (uids);
+ data->from_uri = g_strdup (from_uri);
+ data->style = style;
switch (style) {
case E_MAIL_FORWARD_STYLE_ATTACHED:
- default:
- em_utils_forward_attached (shell, folder, uids, from_uri);
+ mail_build_attachment (
+ folder, uids, forward_attached_cb, data);
break;
+
case E_MAIL_FORWARD_STYLE_INLINE:
- em_utils_forward_inline (shell, folder, uids, from_uri);
- break;
case E_MAIL_FORWARD_STYLE_QUOTED:
- em_utils_forward_quoted (shell, folder, uids, from_uri);
+ mail_get_messages (
+ folder, uids, forward_got_messages_cb, data);
break;
+
+ default:
+ g_return_if_reached ();
}
}
@@ -2457,7 +2367,10 @@ attribution_format (const gchar *format, CamelMimeMessage *message)
}
static void
-composer_set_body (EMsgComposer *composer, CamelMimeMessage *message, EMFormat *source)
+composer_set_body (EMsgComposer *composer,
+ CamelMimeMessage *message,
+ EMailReplyStyle style,
+ EMFormat *source)
{
gchar *text, *credits;
CamelMimePart *part;
@@ -2466,16 +2379,12 @@ composer_set_body (EMsgComposer *composer, CamelMimeMessage *message, EMFormat *
gboolean start_bottom;
guint32 validity_found = 0;
const gchar *key;
- EMailReplyStyle style;
client = gconf_client_get_default ();
key = "/apps/evolution/mail/composer/reply_start_bottom";
start_bottom = gconf_client_get_bool (client, key, NULL);
- key = "/apps/evolution/mail/format/reply_style";
- style = gconf_client_get_int (client, key, NULL);
-
switch (style) {
case E_MAIL_REPLY_STYLE_DO_NOT_QUOTE:
/* do nothing */
@@ -2527,7 +2436,8 @@ composer_set_body (EMsgComposer *composer, CamelMimeMessage *message, EMFormat *
struct _reply_data {
EShell *shell;
EMFormat *source;
- gint mode;
+ EMailReplyType reply_type;
+ EMailReplyStyle reply_style;
};
gchar *
@@ -2557,7 +2467,8 @@ reply_to_message (CamelFolder *folder,
an extra ref for em_utils_reply_to_message () to drop. */
g_object_ref (message);
em_utils_reply_to_message (
- rd->shell, folder, uid, message, rd->mode, rd->source);
+ rd->shell, folder, uid, message,
+ rd->reply_type, rd->reply_style, rd->source);
}
if (rd->shell != NULL)
@@ -2575,7 +2486,8 @@ reply_to_message (CamelFolder *folder,
* @folder: optional folder
* @uid: optional uid
* @message: message to reply to, optional
- * @mode: reply mode
+ * @type: the type of reply to create
+ * @style: the reply style to use
* @source: source to inherit view settings from
*
* Creates a new composer ready to reply to @message.
@@ -2592,7 +2504,8 @@ em_utils_reply_to_message (EShell *shell,
CamelFolder *folder,
const gchar *uid,
CamelMimeMessage *message,
- gint mode,
+ EMailReplyType type,
+ EMailReplyStyle style,
EMFormat *source)
{
CamelInternetAddress *to, *cc;
@@ -2607,7 +2520,8 @@ em_utils_reply_to_message (EShell *shell,
struct _reply_data *rd = g_malloc0 (sizeof (*rd));
rd->shell = g_object_ref (shell);
- rd->mode = mode;
+ rd->reply_type = type;
+ rd->reply_style = style;
rd->source = source;
if (rd->source)
g_object_ref (rd->source);
@@ -2626,25 +2540,25 @@ em_utils_reply_to_message (EShell *shell,
account = em_utils_guess_account_with_recipients (message, folder);
flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_SEEN;
- switch (mode) {
- case REPLY_MODE_FROM:
+ switch (type) {
+ case E_MAIL_REPLY_TO_FROM:
if (folder)
postto = camel_nntp_address_new ();
get_reply_from (message, to, postto);
break;
- case REPLY_MODE_SENDER:
+ case E_MAIL_REPLY_TO_SENDER:
if (folder)
postto = camel_nntp_address_new ();
get_reply_sender (message, to, postto);
break;
- case REPLY_MODE_LIST:
+ case E_MAIL_REPLY_TO_LIST:
flags |= CAMEL_MESSAGE_ANSWERED_ALL;
if (get_reply_list (message, to))
break;
/* falls through */
- case REPLY_MODE_ALL:
+ case E_MAIL_REPLY_TO_ALL:
flags |= CAMEL_MESSAGE_ANSWERED_ALL;
if (folder)
postto = camel_nntp_address_new ();
@@ -2662,7 +2576,7 @@ em_utils_reply_to_message (EShell *shell,
g_object_unref (to);
g_object_unref (cc);
- composer_set_body (composer, message, source);
+ composer_set_body (composer, message, style, source);
g_object_unref (message);
diff --git a/mail/em-composer-utils.h b/mail/em-composer-utils.h
index e1974aa8f3..5dbd8e1409 100644
--- a/mail/em-composer-utils.h
+++ b/mail/em-composer-utils.h
@@ -21,10 +21,11 @@
*
*/
-#ifndef __EM_COMPOSER_UTILS_H__
-#define __EM_COMPOSER_UTILS_H__
+#ifndef EM_COMPOSER_UTILS_H
+#define EM_COMPOSER_UTILS_H
#include <em-format/em-format.h>
+#include <mail/e-mail-enums.h>
#include <mail/e-mail-session.h>
#include <composer/e-msg-composer.h>
@@ -43,25 +44,15 @@ void em_utils_edit_messages (EShell *shell,
CamelFolder *folder,
GPtrArray *uids,
gboolean replace);
-void em_utils_forward_attached (EShell *shell,
- CamelFolder *folder,
- GPtrArray *uids,
- const gchar *from_uri);
-void em_utils_forward_inline (EShell *shell,
- CamelFolder *folder,
- GPtrArray *uids,
- const gchar *from_uri);
-void em_utils_forward_quoted (EShell *shell,
- CamelFolder *folder,
- GPtrArray *uids,
- const gchar *from_uri);
EMsgComposer * em_utils_forward_message (EShell *shell,
CamelMimeMessage *msg,
- const gchar *from_uri);
+ const gchar *from_uri,
+ EMailForwardStyle style);
void em_utils_forward_messages (EShell *shell,
CamelFolder *folder,
GPtrArray *uids,
- const gchar *from_uri);
+ const gchar *from_uri,
+ EMailForwardStyle style);
void em_utils_redirect_message (EShell *shell,
CamelMimeMessage *message);
void em_utils_redirect_message_by_uid (EShell *shell,
@@ -74,23 +65,28 @@ void em_utils_handle_receipt (EMailSession *session,
void em_utils_send_receipt (EMailSession *session,
CamelFolder *folder,
CamelMimeMessage *message);
-
-enum {
- REPLY_MODE_SENDER, /* Reply-To?:From */
- REPLY_MODE_FROM,
- REPLY_MODE_ALL,
- REPLY_MODE_LIST
-};
-
-gchar *em_utils_construct_composer_text (CamelMimeMessage *message, EMFormat *source);
-gboolean em_utils_is_munged_list_message (CamelMimeMessage *message);
-void em_utils_get_reply_sender (CamelMimeMessage *message, CamelInternetAddress *to, CamelNNTPAddress *postto);
-void em_utils_get_reply_all (CamelMimeMessage *message, CamelInternetAddress *to, CamelInternetAddress *cc, CamelNNTPAddress *postto);
-EMsgComposer * em_utils_reply_to_message (EShell *shell, CamelFolder *, const gchar *uid, CamelMimeMessage *message, gint mode, EMFormat *source);
-EDestination ** em_utils_camel_address_to_destination (CamelInternetAddress *iaddr);
-
-void em_configure_new_composer (struct _EMsgComposer *composer);
+gchar * em_utils_construct_composer_text
+ (CamelMimeMessage *message,
+ EMFormat *source);
+gboolean em_utils_is_munged_list_message (CamelMimeMessage *message);
+void em_utils_get_reply_sender (CamelMimeMessage *message,
+ CamelInternetAddress *to,
+ CamelNNTPAddress *postto);
+void em_utils_get_reply_all (CamelMimeMessage *message,
+ CamelInternetAddress *to,
+ CamelInternetAddress *cc,
+ CamelNNTPAddress *postto);
+EMsgComposer * em_utils_reply_to_message (EShell *shell,
+ CamelFolder *folder,
+ const gchar *uid,
+ CamelMimeMessage *message,
+ EMailReplyType type,
+ EMailReplyStyle style,
+ EMFormat *source);
+EDestination ** em_utils_camel_address_to_destination
+ (CamelInternetAddress *iaddr);
+void em_configure_new_composer (EMsgComposer *composer);
G_END_DECLS
-#endif /* __EM_COMPOSER_UTILS_H__ */
+#endif /* EM_COMPOSER_UTILS_H */
diff --git a/modules/mail/Makefile.am b/modules/mail/Makefile.am
index 323820217b..884d050d78 100644
--- a/modules/mail/Makefile.am
+++ b/modules/mail/Makefile.am
@@ -21,6 +21,8 @@ libevolution_module_mail_la_SOURCES = \
e-mail-config-format-html.h \
e-mail-config-hook.c \
e-mail-config-hook.h \
+ e-mail-config-reader.c \
+ e-mail-config-reader.h \
e-mail-config-web-view.c \
e-mail-config-web-view.h \
e-mail-event-hook.c \
diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c
index 2b74b2a1ed..b868c3069d 100644
--- a/modules/mail/e-mail-attachment-handler.c
+++ b/modules/mail/e-mail-attachment-handler.c
@@ -61,10 +61,13 @@ mail_attachment_handler_forward (GtkAction *action,
EAttachmentHandler *handler)
{
EMailAttachmentHandlerPrivate *priv;
+ EShellSettings *shell_settings;
EAttachment *attachment;
EAttachmentView *view;
CamelMimePart *mime_part;
CamelDataWrapper *wrapper;
+ EMailForwardStyle style;
+ const gchar *property_name;
GList *selected;
view = e_attachment_handler_get_view (handler);
@@ -77,8 +80,12 @@ mail_attachment_handler_forward (GtkAction *action,
mime_part = e_attachment_get_mime_part (attachment);
wrapper = camel_medium_get_content (CAMEL_MEDIUM (mime_part));
+ property_name = "mail-forward-style";
+ shell_settings = e_shell_get_shell_settings (priv->shell);
+ style = e_shell_settings_get_int (shell_settings, property_name);
+
em_utils_forward_message (
- priv->shell, CAMEL_MIME_MESSAGE (wrapper), NULL);
+ priv->shell, CAMEL_MIME_MESSAGE (wrapper), NULL, style);
g_list_foreach (selected, (GFunc) g_object_unref, NULL);
g_list_free (selected);
@@ -89,10 +96,13 @@ mail_attachment_handler_reply_all (GtkAction *action,
EAttachmentHandler *handler)
{
EMailAttachmentHandlerPrivate *priv;
+ EShellSettings *shell_settings;
EAttachment *attachment;
EAttachmentView *view;
CamelMimePart *mime_part;
CamelDataWrapper *wrapper;
+ EMailReplyStyle style;
+ const gchar *property_name;
GList *selected;
view = e_attachment_handler_get_view (handler);
@@ -105,9 +115,13 @@ mail_attachment_handler_reply_all (GtkAction *action,
mime_part = e_attachment_get_mime_part (attachment);
wrapper = camel_medium_get_content (CAMEL_MEDIUM (mime_part));
+ property_name = "mail-reply-style";
+ shell_settings = e_shell_get_shell_settings (priv->shell);
+ style = e_shell_settings_get_int (shell_settings, property_name);
+
em_utils_reply_to_message (
priv->shell, NULL, NULL, CAMEL_MIME_MESSAGE (wrapper),
- REPLY_MODE_ALL, NULL);
+ E_MAIL_REPLY_TO_ALL, style, NULL);
g_list_foreach (selected, (GFunc) g_object_unref, NULL);
g_list_free (selected);
@@ -118,10 +132,13 @@ mail_attachment_handler_reply_sender (GtkAction *action,
EAttachmentHandler *handler)
{
EMailAttachmentHandlerPrivate *priv;
+ EShellSettings *shell_settings;
EAttachment *attachment;
EAttachmentView *view;
CamelMimePart *mime_part;
CamelDataWrapper *wrapper;
+ EMailForwardStyle style;
+ const gchar *property_name;
GList *selected;
view = e_attachment_handler_get_view (handler);
@@ -134,9 +151,13 @@ mail_attachment_handler_reply_sender (GtkAction *action,
mime_part = e_attachment_get_mime_part (attachment);
wrapper = camel_medium_get_content (CAMEL_MEDIUM (mime_part));
+ property_name = "mail-reply-style";
+ shell_settings = e_shell_get_shell_settings (priv->shell);
+ style = e_shell_settings_get_int (shell_settings, property_name);
+
em_utils_reply_to_message (
priv->shell, NULL, NULL, CAMEL_MIME_MESSAGE (wrapper),
- REPLY_MODE_SENDER, NULL);
+ E_MAIL_REPLY_TO_SENDER, style, NULL);
g_list_foreach (selected, (GFunc) g_object_unref, NULL);
g_list_free (selected);
diff --git a/modules/mail/e-mail-config-reader.c b/modules/mail/e-mail-config-reader.c
new file mode 100644
index 0000000000..f1e43228d2
--- /dev/null
+++ b/modules/mail/e-mail-config-reader.c
@@ -0,0 +1,80 @@
+/*
+ * e-mail-config-reader.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include "e-mail-config-reader.h"
+
+#include <shell/e-shell.h>
+#include <e-util/e-extension.h>
+#include <mail/e-mail-reader.h>
+
+static void
+mail_config_reader_constructed (GObject *object)
+{
+ EExtension *extension;
+ EExtensible *extensible;
+ EShellSettings *shell_settings;
+ EShell *shell;
+
+ extension = E_EXTENSION (object);
+ extensible = e_extension_get_extensible (extension);
+
+ shell = e_shell_get_default ();
+ shell_settings = e_shell_get_shell_settings (shell);
+
+ g_object_bind_property (
+ shell_settings, "mail-forward-style",
+ extensible, "forward-style",
+ G_BINDING_SYNC_CREATE);
+
+ g_object_bind_property (
+ shell_settings, "mail-reply-style",
+ extensible, "reply-style",
+ G_BINDING_SYNC_CREATE);
+}
+
+static void
+mail_config_reader_class_init (EExtensionClass *class)
+{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->constructed = mail_config_reader_constructed;
+
+ class->extensible_type = E_TYPE_MAIL_READER;
+}
+
+void
+e_mail_config_reader_register_type (GTypeModule *type_module)
+{
+ static const GTypeInfo type_info = {
+ sizeof (EExtensionClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) mail_config_reader_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class_data */
+ sizeof (EExtension),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) NULL,
+ NULL /* value_table */
+ };
+
+ g_type_module_register_type (
+ type_module, E_TYPE_EXTENSION,
+ "EMailConfigReader", &type_info, 0);
+}
diff --git a/modules/mail/e-mail-config-reader.h b/modules/mail/e-mail-config-reader.h
new file mode 100644
index 0000000000..6dd856c97c
--- /dev/null
+++ b/modules/mail/e-mail-config-reader.h
@@ -0,0 +1,30 @@
+/*
+ * e-mail-config-reader.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#ifndef E_MAIL_CONFIG_READER_H
+#define E_MAIL_CONFIG_READER_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+void e_mail_config_reader_register_type (GTypeModule *type_module);
+
+G_END_DECLS
+
+#endif /* E_MAIL_CONFIG_READER_H */
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 73386911ec..09db9ce0e8 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -236,6 +236,7 @@ mail_shell_backend_handle_email_uri_cb (gchar *folder_uri,
gpointer user_data)
{
EShellBackend *shell_backend = user_data;
+ EShellSettings *shell_settings;
EMailBackend *backend;
CamelURL *url = user_data;
EShell *shell;
@@ -245,6 +246,7 @@ mail_shell_backend_handle_email_uri_cb (gchar *folder_uri,
backend = E_MAIL_BACKEND (shell_backend);
shell = e_shell_backend_get_shell (shell_backend);
+ shell_settings = e_shell_get_shell_settings (shell);
if (folder == NULL) {
g_warning ("Could not open folder '%s'", folder_uri);
@@ -256,36 +258,42 @@ mail_shell_backend_handle_email_uri_cb (gchar *folder_uri,
uid = camel_url_get_param (url, "uid");
if (reply != NULL) {
- gint mode;
+ EMailReplyType reply_type;
+ EMailReplyStyle reply_style;
if (g_strcmp0 (reply, "all") == 0)
- mode = REPLY_MODE_ALL;
+ reply_type = E_MAIL_REPLY_TO_ALL;
else if (g_strcmp0 (reply, "list") == 0)
- mode = REPLY_MODE_LIST;
+ reply_type = E_MAIL_REPLY_TO_LIST;
else
- mode = REPLY_MODE_SENDER;
+ reply_type = E_MAIL_REPLY_TO_SENDER;
+
+ reply_style = e_shell_settings_get_int (
+ shell_settings, "mail-reply-style");
em_utils_reply_to_message (
- shell, folder, uid, NULL, mode, NULL);
+ shell, folder, uid, NULL,
+ reply_type, reply_style, NULL);
} else if (forward != NULL) {
+ EMailForwardStyle forward_style;
GPtrArray *uids;
uids = g_ptr_array_new ();
g_ptr_array_add (uids, g_strdup (uid));
if (g_strcmp0 (forward, "attached") == 0)
- em_utils_forward_attached (
- shell, folder, uids, folder_uri);
+ forward_style = E_MAIL_FORWARD_STYLE_ATTACHED;
else if (g_strcmp0 (forward, "inline") == 0)
- em_utils_forward_inline (
- shell, folder, uids, folder_uri);
+ forward_style = E_MAIL_FORWARD_STYLE_INLINE;
else if (g_strcmp0 (forward, "quoted") == 0)
- em_utils_forward_quoted (
- shell, folder, uids, folder_uri);
+ forward_style = E_MAIL_FORWARD_STYLE_QUOTED;
else
- em_utils_forward_messages (
- shell, folder, uids, folder_uri);
+ forward_style = e_shell_settings_get_int (
+ shell_settings, "mail-forward-style");
+
+ em_utils_forward_messages (
+ shell, folder, uids, folder_uri, forward_style);
} else {
GtkWidget *browser;
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index b28b02eee0..2872da53bd 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -53,21 +53,25 @@ struct _EMailShellContentPrivate {
enum {
PROP_0,
+ PROP_FORWARD_STYLE,
PROP_GROUP_BY_THREADS,
- PROP_MAIL_VIEW
+ PROP_MAIL_VIEW,
+ PROP_REPLY_STYLE
};
static gpointer parent_class;
static GType mail_shell_content_type;
static void
-reconnect_changed_event (EMailReader *child, EMailReader *parent)
+reconnect_changed_event (EMailReader *child,
+ EMailReader *parent)
{
g_signal_emit_by_name (parent, "changed");
}
static void
-reconnect_folder_loaded_event (EMailReader *child, EMailReader *parent)
+reconnect_folder_loaded_event (EMailReader *child,
+ EMailReader *parent)
{
g_signal_emit_by_name (parent, "folder-loaded");
}
@@ -88,11 +92,23 @@ mail_shell_content_set_property (GObject *object,
GParamSpec *pspec)
{
switch (property_id) {
+ case PROP_FORWARD_STYLE:
+ e_mail_reader_set_forward_style (
+ E_MAIL_READER (object),
+ g_value_get_enum (value));
+ return;
+
case PROP_GROUP_BY_THREADS:
e_mail_reader_set_group_by_threads (
E_MAIL_READER (object),
g_value_get_boolean (value));
return;
+
+ case PROP_REPLY_STYLE:
+ e_mail_reader_set_reply_style (
+ E_MAIL_READER (object),
+ g_value_get_enum (value));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -105,6 +121,12 @@ mail_shell_content_get_property (GObject *object,
GParamSpec *pspec)
{
switch (property_id) {
+ case PROP_FORWARD_STYLE:
+ g_value_set_enum (
+ value, e_mail_reader_get_forward_style (
+ E_MAIL_READER (object)));
+ return;
+
case PROP_GROUP_BY_THREADS:
g_value_set_boolean (
value, e_mail_reader_get_group_by_threads (
@@ -116,6 +138,12 @@ mail_shell_content_get_property (GObject *object,
value, e_mail_shell_content_get_mail_view (
E_MAIL_SHELL_CONTENT (object)));
return;
+
+ case PROP_REPLY_STYLE:
+ g_value_set_enum (
+ value, e_mail_reader_get_reply_style (
+ E_MAIL_READER (object)));
+ return;
}
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -181,7 +209,6 @@ mail_shell_content_constructed (GObject *object)
g_signal_connect (
widget, "folder-loaded",
G_CALLBACK (reconnect_folder_loaded_event), object);
-
}
static guint32
@@ -375,6 +402,13 @@ mail_shell_content_class_init (EMailShellContentClass *class)
shell_content_class->check_state = mail_shell_content_check_state;
shell_content_class->focus_search_results = mail_shell_content_focus_search_results;
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
+ PROP_FORWARD_STYLE,
+ "forward-style");
+
+ /* Inherited from EMailReader */
g_object_class_override_property (
object_class,
PROP_GROUP_BY_THREADS,
@@ -389,6 +423,12 @@ mail_shell_content_class_init (EMailShellContentClass *class)
NULL,
E_TYPE_MAIL_VIEW,
G_PARAM_READABLE));
+
+ /* Inherited from EMailReader */
+ g_object_class_override_property (
+ object_class,
+ PROP_REPLY_STYLE,
+ "reply-style");
}
static void
diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c
index 503edaf121..3e55a98aa8 100644
--- a/modules/mail/e-mail-shell-settings.c
+++ b/modules/mail/e-mail-shell-settings.c
@@ -144,7 +144,7 @@ e_mail_shell_settings_init (EShellBackend *shell_backend)
"mail-force-message-limit",
"/apps/evolution/mail/display/force_message_limit");
- /* This value corresponds to MailConfigForwardStyle enum. */
+ /* This value corresponds to the EMailForwardStyle enum. */
e_shell_settings_install_property_for_key (
"mail-forward-style",
"/apps/evolution/mail/format/forward_style");
@@ -195,7 +195,7 @@ e_mail_shell_settings_init (EShellBackend *shell_backend)
"mail-prompt-delete-in-vfolder",
"/apps/evolution/mail/prompts/delete_in_vfolder");
- /* This value corresponds to MailConfigReplyStyle enum,
+ /* This value corresponds to the EMailReplyStyle enum,
* but the ordering of the combo box items in preferences
* has changed. We use transformation functions there. */
e_shell_settings_install_property_for_key (
diff --git a/modules/mail/evolution-module-mail.c b/modules/mail/evolution-module-mail.c
index 9e9744569b..b7e2a77be7 100644
--- a/modules/mail/evolution-module-mail.c
+++ b/modules/mail/evolution-module-mail.c
@@ -31,6 +31,7 @@
#include "e-mail-shell-view.h"
#include "e-mail-config-format-html.h"
+#include "e-mail-config-reader.h"
#include "e-mail-config-web-view.h"
/* Module Entry Points */
@@ -55,6 +56,7 @@ e_module_load (GTypeModule *type_module)
e_mail_shell_view_register_type (type_module);
e_mail_config_format_html_register_type (type_module);
+ e_mail_config_reader_register_type (type_module);
e_mail_config_web_view_register_type (type_module);
}