2006-07-03 [wwp] 2.3.1cvs52
authorTristan Chabredier <wwp@claws-mail.org>
Mon, 3 Jul 2006 12:35:59 +0000 (12:35 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Mon, 3 Jul 2006 12:35:59 +0000 (12:35 +0000)
* src/compose.c
* src/privacy.c
* src/privacy.h
* src/plugins/pgpinline/pgpinline.c
* src/plugins/pgpmime/pgpmime.c
don't report an error when the user cancels the passphrase dialog.

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/plugins/pgpinline/pgpinline.c
src/plugins/pgpmime/pgpmime.c
src/privacy.c
src/privacy.h

index d7c32aa3b062c2a00c33ff18b7a002a5b8473307..4b77824ad7954d5d379649d7714789dea1c857b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-07-03 [wwp]       2.3.1cvs52
+
+       * src/compose.c
+       * src/privacy.c
+       * src/privacy.h
+       * src/plugins/pgpinline/pgpinline.c
+       * src/plugins/pgpmime/pgpmime.c
+               don't report an error when the user cancels the passphrase dialog.
+
 2006-07-02 [colin]     2.3.1cvs51
 
        * src/folderview.c
index ebc0191197a5d31d3c0bb1f9f4c2f0fdb1af3a63..b315789ccbe89fcddf69a94df1f092fbe108bb05 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.105.2.60 -r 1.105.2.61 src/prefs_account.c;  ) > 2.3.1cvs49.patchset
 ( cvs diff -u -r 1.105.2.61 -r 1.105.2.62 src/prefs_account.c;  ) > 2.3.1cvs50.patchset
 ( cvs diff -u -r 1.207.2.105 -r 1.207.2.106 src/folderview.c;  ) > 2.3.1cvs51.patchset
+( cvs diff -u -r 1.382.2.291 -r 1.382.2.292 src/compose.c;  cvs diff -u -r 1.10.2.9 -r 1.10.2.10 src/privacy.c;  cvs diff -u -r 1.10.2.8 -r 1.10.2.9 src/privacy.h;  cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/plugins/pgpinline/pgpinline.c;  cvs diff -u -r 1.1.2.36 -r 1.1.2.37 src/plugins/pgpmime/pgpmime.c;  ) > 2.3.1cvs52.patchset
index 7eaef48d7725ef990cdae728bef13a6351baa37a..90dd42a5456b0d3a39aa2cf84681838cc057df9c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=51
+EXTRA_VERSION=52
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c3710ec1036b9fa78b87ada4cb7b3f6f6abd63d8..b92192e8601bff5f2e7d3d7835fd278e9e9dc164 100644 (file)
@@ -4077,6 +4077,7 @@ gint compose_send(Compose *compose)
                        alertpanel_error(_("Could not queue message for sending:\n\n"
                                           "Charset conversion failed."));
                } else if (val == -3) {
+                       if (privacy_peek_error())
                        alertpanel_error(_("Could not queue message for sending:\n\n"
                                           "Signature failed: %s"), privacy_get_error());
                } else if (val == -2 && errno != 0) {
@@ -7537,6 +7538,7 @@ static void compose_send_later_cb(gpointer data, guint action,
        } else if (val == -2) {
                alertpanel_error(_("Could not queue message:\n\n%s."), strerror(errno));
        } else if (val == -3) {
+               if (privacy_peek_error())
                alertpanel_error(_("Could not queue message for sending:\n\n"
                                   "Signature failed: %s"), privacy_get_error());
        } else if (val == -4) {
index a88bd734428c87b831794fc0798437a4c9f13d9c..2c6ae913e6114ea10b1a0b18bba143d15855e603 100644 (file)
@@ -523,10 +523,17 @@ static gboolean pgpinline_sign(MimeInfo *mimeinfo, PrefsAccount *account)
                gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, &info);
        }
 
-       if ((err = gpgme_op_sign(ctx, gpgtext, gpgsig, GPGME_SIG_MODE_CLEAR)) 
-           != GPG_ERR_NO_ERROR) {
-               gpgme_release(ctx);
-               privacy_set_error(_("Data signing failed, %s"), gpgme_strerror(err));
+       err = gpgme_op_sign(ctx, gpgtext, gpgsig, GPGME_SIG_MODE_CLEAR);
+       if (err != GPG_ERR_NO_ERROR) {
+               if (err == GPG_ERR_CANCELED) {
+                       /* ignore cancelled signing */
+                       privacy_reset_error();
+                       debug_print("gpgme_op_sign cancelled\n");
+               } else {
+                       privacy_set_error(_("Data signing failed, %s"), gpgme_strerror(err));
+                       debug_print("gpgme_op_sign error : %x\n", err);
+               }
+               gpgme_release(ctx);
                return FALSE;
        }
        result = gpgme_op_sign_result(ctx);
index d1378e7c694d0712a0bebfc5cabe6291d20c2b76..6e3026fbda5720bf88758bb1cbec586049fb871b 100644 (file)
@@ -471,8 +471,14 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account)
 
        err = gpgme_op_sign(ctx, gpgtext, gpgsig, GPGME_SIG_MODE_DETACH);
        if (err != GPG_ERR_NO_ERROR) {
-               privacy_set_error(_("Data signing failed, %s"), gpgme_strerror(err));
-               debug_print("gpgme_op_sign error : %x\n", err);
+               if (err == GPG_ERR_CANCELED) {
+                       /* ignore cancelled signing */
+                       privacy_reset_error();
+                       debug_print("gpgme_op_sign cancelled\n");
+               } else {
+                       privacy_set_error(_("Data signing failed, %s"), gpgme_strerror(err));
+                       debug_print("gpgme_op_sign error : %x\n", err);
+               }
                gpgme_release(ctx);
                return FALSE;
        }
index 4d8ed9385ec57b4c428e9785a4fce978d9d75d6f..d99f145e7ee8309c3d2524189ee19020736b3729 100644 (file)
@@ -40,12 +40,22 @@ void privacy_set_error(const gchar *format, ...)
 
 static gchar tmp_privacy_error[BUFSIZ];
 
+void privacy_reset_error(void)
+{
+       g_free(privacy_last_error);
+       privacy_last_error = NULL;
+}
+
+gboolean privacy_peek_error(void)
+{
+       return (privacy_last_error != NULL);
+}
+
 const gchar *privacy_get_error (void)
 {
        if (privacy_last_error) {
                strncpy2(tmp_privacy_error, privacy_last_error, BUFSIZ-1);
-               g_free(privacy_last_error);
-               privacy_last_error = NULL;
+               privacy_reset_error();
                return tmp_privacy_error;
        } else {
                return _("Unknown error");
index 440401db9152c1d80d517ce8bcb5da4cd0b1594e..c1b9ff7946d487590f6438d28d8ae141f7632f31 100644 (file)
@@ -66,6 +66,8 @@ gboolean privacy_encrypt                      (const gchar  *system,
                                                 const gchar  *encdata);
 
 void privacy_set_error                         (const gchar *format, ...);
+void privacy_reset_error                               (void);
+gboolean privacy_peek_error                            (void);
 const gchar *privacy_get_error                 (void);
 
 struct _PrivacySystem {