aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-11-17 22:55:48 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-11-17 22:55:48 +0800
commit900d019a0332b24d2bee7ea1407b149fca2c0598 (patch)
tree627edf5d63874be616d41c9a043571a80fc542f5 /mail
parentcdb09641dc6be772931e5381cdf1e6a824a15684 (diff)
parentbadc11edcf5e73bc6148c7b5cdccee739eb9d7ae (diff)
downloadgsoc2013-evolution-900d019a0332b24d2bee7ea1407b149fca2c0598.tar
gsoc2013-evolution-900d019a0332b24d2bee7ea1407b149fca2c0598.tar.gz
gsoc2013-evolution-900d019a0332b24d2bee7ea1407b149fca2c0598.tar.bz2
gsoc2013-evolution-900d019a0332b24d2bee7ea1407b149fca2c0598.tar.lz
gsoc2013-evolution-900d019a0332b24d2bee7ea1407b149fca2c0598.tar.xz
gsoc2013-evolution-900d019a0332b24d2bee7ea1407b149fca2c0598.tar.zst
gsoc2013-evolution-900d019a0332b24d2bee7ea1407b149fca2c0598.zip
Merge branch 'master' into wip/gsettings
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-session.c58
-rw-r--r--mail/em-account-editor.c47
-rw-r--r--mail/em-composer-utils.c10
-rw-r--r--mail/em-filter-folder-element.c3
-rw-r--r--mail/em-filter-source-element.c4
-rw-r--r--mail/evolution-mail.schemas.in15
-rw-r--r--mail/mail-config.ui21
-rw-r--r--mail/mail.error.xml18
8 files changed, 105 insertions, 71 deletions
diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c
index af861f575f..f4fcbb26af 100644
--- a/mail/e-mail-session.c
+++ b/mail/e-mail-session.c
@@ -122,10 +122,10 @@ struct _user_message_msg {
CamelSessionAlertType type;
gchar *prompt;
+ GSList *button_captions;
EFlag *done;
- guint allow_cancel : 1;
- guint result : 1;
+ gint result;
guint ismain : 1;
};
@@ -160,8 +160,8 @@ user_message_response (GtkDialog *dialog,
struct _user_message_msg *m)
{
/* if !allow_cancel, then we've already replied */
- if (m->allow_cancel) {
- m->result = button == GTK_RESPONSE_OK;
+ if (m->button_captions) {
+ m->result = button;
e_flag_set (m->done);
}
@@ -175,6 +175,8 @@ user_message_exec (struct _user_message_msg *m,
{
GtkWindow *parent;
const gchar *error_type;
+ gint index;
+ GSList *iter;
if (!m->ismain && user_message_dialog != NULL) {
g_queue_push_tail (&user_message_queue, mail_msg_ref (m));
@@ -183,19 +185,13 @@ user_message_exec (struct _user_message_msg *m,
switch (m->type) {
case CAMEL_SESSION_ALERT_INFO:
- error_type = m->allow_cancel ?
- "mail:session-message-info-cancel" :
- "mail:session-message-info";
+ error_type = "mail:session-message-info";
break;
case CAMEL_SESSION_ALERT_WARNING:
- error_type = m->allow_cancel ?
- "mail:session-message-warning-cancel" :
- "mail:session-message-warning";
+ error_type = "mail:session-message-warning";
break;
case CAMEL_SESSION_ALERT_ERROR:
- error_type = m->allow_cancel ?
- "mail:session-message-error-cancel" :
- "mail:session-message-error";
+ error_type = "mail:session-message-error";
break;
default:
error_type = NULL;
@@ -208,6 +204,25 @@ user_message_exec (struct _user_message_msg *m,
parent, error_type, m->prompt, NULL);
g_object_set (user_message_dialog, "resizable", TRUE, NULL);
+ if (m->button_captions) {
+ GtkWidget *action_area;
+ GList *children, *child;
+
+ /* remove all default buttons and keep only those requested */
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (user_message_dialog));
+
+ children = gtk_container_get_children (GTK_CONTAINER (action_area));
+ for (child = children; child != NULL; child = child->next) {
+ gtk_container_remove (GTK_CONTAINER (action_area), child->data);
+ }
+
+ g_list_free (children);
+ }
+
+ for (index = 0, iter = m->button_captions; iter; index++, iter = iter->next) {
+ gtk_dialog_add_button (GTK_DIALOG (user_message_dialog), iter->data, index);
+ }
+
/* XXX This is a case where we need to be able to construct
* custom EAlerts without a predefined XML definition. */
if (m->ismain) {
@@ -228,6 +243,7 @@ static void
user_message_free (struct _user_message_msg *m)
{
g_free (m->prompt);
+ g_slist_free_full (m->button_captions, g_free);
e_flag_free (m->done);
}
@@ -889,24 +905,28 @@ mail_session_forget_password (CamelSession *session,
return TRUE;
}
-static gboolean
+static gint
mail_session_alert_user (CamelSession *session,
CamelSessionAlertType type,
const gchar *prompt,
- gboolean cancel)
+ GSList *button_captions)
{
struct _user_message_msg *m;
GCancellable *cancellable;
- gboolean result = TRUE;
+ gint result = -1;
+ GSList *iter;
m = mail_msg_new (&user_message_info);
m->ismain = mail_in_main_thread ();
m->type = type;
m->prompt = g_strdup (prompt);
m->done = e_flag_new ();
- m->allow_cancel = cancel;
+ m->button_captions = g_slist_copy (button_captions);
+
+ for (iter = m->button_captions; iter; iter = iter->next)
+ iter->data = g_strdup (iter->data);
- if (cancel)
+ if (g_slist_length (button_captions) > 1)
mail_msg_ref (m);
cancellable = e_activity_get_cancellable (m->base.activity);
@@ -916,7 +936,7 @@ mail_session_alert_user (CamelSession *session,
else
mail_msg_main_loop_push (m);
- if (cancel) {
+ if (g_slist_length (button_captions) > 1) {
e_flag_wait (m->done);
result = m->result;
mail_msg_unref (m);
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 2bc3bf3d81..64aa851d6c 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -2092,13 +2092,6 @@ emae_setup_settings (EMAccountEditorService *service)
settings_type = class->settings_type;
g_type_class_unref (class);
- /* If we already have a CamelSettings instance
- * of the appropriate type, leave it alone. */
- if (service->settings != NULL) {
- if (G_OBJECT_TYPE (service->settings) == settings_type)
- return;
- }
-
url = emae_account_url (
service->emae,
emae_service_info[service->type].account_uri_key);
@@ -2830,8 +2823,8 @@ emae_create_basic_assistant_page (EMAccountEditor *emae,
title = _("Sending Email");
label = _("Please enter information about the way you will send mail. If you are not sure, ask your system administrator or Internet Service Provider.");
} else if (g_ascii_strcasecmp (page_id, "review_page") == 0) {
- title = _("Review Account");
- label = _("Time to check things over before we try and connect to the server and fetch your mail.");
+ title = _("Account Summary");
+ label = _("This is a summary of the settings which will be used to access your mail.");
} else if (g_ascii_strcasecmp (page_id, "finish_page") == 0) {
page_type = GTK_ASSISTANT_PAGE_CONFIRM;
fill_space = TRUE;
@@ -3592,13 +3585,10 @@ emae_send_page (EConfig *ec,
GtkWidget *w;
GtkBuilder *builder;
- provider = emae_get_transport_provider (emae);
-
- if (provider == NULL)
- return NULL;
+ provider = emae_get_store_provider (emae);
/* no transport options page at all for these types of providers */
- if (CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider)) {
+ if (provider && CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider)) {
memset (&priv->transport.frame, 0, ((gchar *) &priv->transport.check_dialog) - ((gchar *) &priv->transport.frame));
return NULL;
}
@@ -4622,9 +4612,9 @@ emae_check_complete (EConfig *ec,
gtk_label_set_text (emae->priv->receive_name, url->user);
g_object_get (emae->priv->source.settings, "security-method", &method, NULL);
if (method == CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT)
- enc = g_strdup (_("Always(SSL)"));
+ enc = g_strdup (_("Always (SSL)"));
else if (method == CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT)
- enc = g_strdup (_("When possible(TLS)"));
+ enc = g_strdup (_("When possible (TLS)"));
else
enc = g_strdup (_("Never"));
@@ -4638,9 +4628,9 @@ emae_check_complete (EConfig *ec,
gtk_label_set_text (emae->priv->send_name, url->user);
g_object_get (emae->priv->transport.settings, "security-method", &method, NULL);
if (method == CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT)
- enc = g_strdup (_("Always(SSL)"));
+ enc = g_strdup (_("Always (SSL)"));
else if (method == CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT)
- enc = g_strdup (_("When possible(TLS)"));
+ enc = g_strdup (_("When possible (TLS)"));
else
enc = g_strdup (_("Never"));
@@ -4766,13 +4756,18 @@ emae_check_complete (EConfig *ec,
}
if (ok && (pageid == NULL || !strcmp (pageid, "30.send"))) {
- if (emae->type != EMAE_NOTEBOOK && refresh) {
- emae_refresh_providers (emae, &emae->priv->transport);
- emae_provider_changed (emae->priv->transport.providers, &emae->priv->transport);
- }
- ok = emae_service_complete (emae, &emae->priv->transport);
- if (!ok) {
- d (printf ("send page incomplete\n"));
+ CamelProvider *provider;
+
+ provider = emae_get_store_provider (emae);
+ if (!provider || !CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider)) {
+ if (emae->type != EMAE_NOTEBOOK && refresh) {
+ emae_refresh_providers (emae, &emae->priv->transport);
+ emae_provider_changed (emae->priv->transport.providers, &emae->priv->transport);
+ }
+ ok = emae_service_complete (emae, &emae->priv->transport);
+ if (!ok) {
+ d (printf ("send page incomplete\n"));
+ }
}
}
@@ -5132,7 +5127,7 @@ emae_commit (EConfig *ec,
} else {
CamelProvider *provider;
- d (printf ("Adding new account '%s'\n", e_account_get_string (account, E_ACCOUNT_NAME)));
+ d (printf ("Adding new account '%s'\n", e_account_get_string (modified_account, E_ACCOUNT_NAME)));
e_account_list_add (accounts, modified_account);
account = modified_account;
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 06db108b8e..85fc96d751 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -1412,17 +1412,23 @@ emu_update_composers_security (EMsgComposer *composer,
guint32 validity_found)
{
GtkToggleAction *action;
+ EShell *shell;
+ EShellSettings *shell_settings;
g_return_if_fail (composer != NULL);
+ shell = e_msg_composer_get_shell (composer);
+ shell_settings = e_shell_get_shell_settings (shell);
+
/* Pre-set only for encrypted messages, not for signed */
- /*if (validity_found & EM_FORMAT_VALIDITY_FOUND_SIGNED) {
+ if ((validity_found & EM_FORMAT_VALIDITY_FOUND_SIGNED) != 0
+ && e_shell_settings_get_boolean (shell_settings, "composer-sign-reply-if-signed")) {
if (validity_found & EM_FORMAT_VALIDITY_FOUND_SMIME)
action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_SMIME_SIGN (composer));
else
action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_PGP_SIGN (composer));
gtk_toggle_action_set_active (action, TRUE);
- }*/
+ }
if (validity_found & EM_FORMAT_VALIDITY_FOUND_ENCRYPTED) {
if (validity_found & EM_FORMAT_VALIDITY_FOUND_SMIME)
diff --git a/mail/em-filter-folder-element.c b/mail/em-filter-folder-element.c
index 74f386481e..6098c9354d 100644
--- a/mail/em-filter-folder-element.c
+++ b/mail/em-filter-folder-element.c
@@ -36,7 +36,6 @@
#include "mail/em-utils.h"
#include "shell/e-shell.h"
#include "filter/e-filter-part.h"
-#include "libedataserver/e-sexp.h"
#include "e-util/e-alert.h"
#define EM_FILTER_FOLDER_ELEMENT_GET_PRIVATE(obj) \
@@ -264,7 +263,7 @@ filter_folder_element_format_sexp (EFilterElement *fe,
{
EMFilterFolderElement *ff = (EMFilterFolderElement *) fe;
- e_sexp_encode_string (out, ff->priv->uri);
+ camel_sexp_encode_string (out, ff->priv->uri);
}
static void
diff --git a/mail/em-filter-source-element.c b/mail/em-filter-source-element.c
index b95c140c58..b6d518d6d6 100644
--- a/mail/em-filter-source-element.c
+++ b/mail/em-filter-source-element.c
@@ -32,8 +32,6 @@
#include <gtk/gtk.h>
#include <camel/camel.h>
-#include <libedataserver/e-sexp.h>
-
#include <e-util/e-account-utils.h>
#include <filter/e-filter-part.h>
@@ -402,7 +400,7 @@ filter_source_element_format_sexp (EFilterElement *fe,
{
EMFilterSourceElement *fs = (EMFilterSourceElement *) fe;
- e_sexp_encode_string (out, fs->priv->active_id);
+ camel_sexp_encode_string (out, fs->priv->active_id);
}
static void
diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in
index c26c0feb96..f7c3844b8a 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -77,6 +77,21 @@
</schema>
<schema>
+ <key>/schemas/apps/evolution/mail/composer/sign_reply_if_signed</key>
+ <applyto>/apps/evolution/mail/composer/sign_reply_if_signed</applyto>
+ <owner>evolution-mail</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Digitally sign messages when original message signed (PGP or S/MIME)</short>
+ <long>
+ Automatically enable PGP or S/MIME signatures when replying
+ to a message which is also PGP or S/MIME signed.
+ </long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/evolution/mail/composer/reply_start_bottom</key>
<applyto>/apps/evolution/mail/composer/reply_start_bottom</applyto>
<owner>evolution-mail</owner>
diff --git a/mail/mail-config.ui b/mail/mail-config.ui
index 02bf640a3a..e95a812b59 100644
--- a/mail/mail-config.ui
+++ b/mail/mail-config.ui
@@ -594,7 +594,7 @@ for display purposes only. </property>
<object class="GtkTable" id="replies-and-forwards-table">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="n_rows">6</property>
+ <property name="n_rows">7</property>
<property name="n_columns">2</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
@@ -697,6 +697,23 @@ for display purposes only. </property>
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="chkSignReplyIfSigned">
+ <property name="label" translatable="yes">Digitally _sign messages when original message signed (PGP or S/MIME)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
<object class="GtkAlignment" id="reply-style-alignment">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -4887,6 +4904,7 @@ For example: "Work" or "Personal"</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">description</property>
<property name="wrap">True</property>
+ <property name="width-chars">40</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -5398,6 +5416,7 @@ For example: "Work" or "Personal"</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">description</property>
<property name="wrap">True</property>
+ <property name="width-chars">40</property>
</object>
<packing>
<property name="left_attach">1</property>
diff --git a/mail/mail.error.xml b/mail/mail.error.xml
index 006cc559a4..f811abb9fd 100644
--- a/mail/mail.error.xml
+++ b/mail/mail.error.xml
@@ -140,32 +140,14 @@ Many email systems add an Apparently-To header to messages that only have BCC re
<secondary>{0}</secondary>
</error>
- <error id="session-message-info-cancel" type="info" default="GTK_RESPONSE_CANCEL">
- <secondary>{0}</secondary>
- <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
- <button stock="gtk-ok" response="GTK_RESPONSE_OK"/>
- </error>
-
<error id="session-message-warning" type="warning">
<secondary>{0}</secondary>
</error>
- <error id="session-message-warning-cancel" type="warning" default="GTK_RESPONSE_CANCEL">
- <secondary>{0}</secondary>
- <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
- <button stock="gtk-ok" response="GTK_RESPONSE_OK"/>
- </error>
-
<error id="session-message-error" type="info">
<secondary>{0}</secondary>
</error>
- <error id="session-message-error-cancel" type="info" default="GTK_RESPONSE_CANCEL">
- <secondary>{0}</secondary>
- <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
- <button stock="gtk-ok" response="GTK_RESPONSE_OK"/>
- </error>
-
<error id="ask-session-password" type="question" default="GTK_RESPONSE_OK">
<_primary>Enter password.</_primary>
<secondary>{0}</secondary>