2006-10-12 [colin] 2.5.5cvs3
authorColin Leroy <colin@colino.net>
Thu, 12 Oct 2006 17:12:19 +0000 (17:12 +0000)
committerColin Leroy <colin@colino.net>
Thu, 12 Oct 2006 17:12:19 +0000 (17:12 +0000)
* po/POTFILES.in
Add new file
* src/plugins/pgpcore/pgp_viewer.c
* src/plugins/pgpcore/sgpgme.c
Don't try to import without asking

ChangeLog
PATCHSETS
configure.ac
po/POTFILES.in
src/plugins/pgpcore/pgp_viewer.c
src/plugins/pgpcore/sgpgme.c

index e7137cb6c5e1c6e43180ba6e2849ae3308aac9e9..7625a0a19bd5a5c8c0b17eccac7d8b44cf36cce7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-10-12 [colin]     2.5.5cvs3
+
+       * po/POTFILES.in
+               Add new file
+       * src/plugins/pgpcore/pgp_viewer.c
+       * src/plugins/pgpcore/sgpgme.c
+               Don't try to import without asking
+
 2006-10-12 [colin]     2.5.5cvs2
 
        * src/compose.c
 2006-10-12 [colin]     2.5.5cvs2
 
        * src/compose.c
index ea2511688006b0657855735cdc470882148249a2..fc2b884103a3385c6eb6574e4ff0738710b3bfa6 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.8.2.10 -r 1.8.2.11 src/quote_fmt.c;  ) > 2.5.3cvs31.patchset
 ( cvs diff -u -r 1.96.2.154 -r 1.96.2.155 src/textview.c;  ) > 2.5.3cvs32.patchset
 ( cvs diff -u -r 1.382.2.314 -r 1.382.2.315 src/compose.c;  ) > 2.5.5cvs2.patchset
 ( cvs diff -u -r 1.8.2.10 -r 1.8.2.11 src/quote_fmt.c;  ) > 2.5.3cvs31.patchset
 ( cvs diff -u -r 1.96.2.154 -r 1.96.2.155 src/textview.c;  ) > 2.5.3cvs32.patchset
 ( cvs diff -u -r 1.382.2.314 -r 1.382.2.315 src/compose.c;  ) > 2.5.5cvs2.patchset
+( cvs diff -u -r 1.53.2.19 -r 1.53.2.20 po/POTFILES.in;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/plugins/pgpcore/pgp_viewer.c;  cvs diff -u -r 1.1.2.30 -r 1.1.2.31 src/plugins/pgpcore/sgpgme.c;  ) > 2.5.5cvs3.patchset
index e5744b8f6d851944a2bcb99ba144193b354b8e9a..095faeb43881319803bd067bb40556700c190b3b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=2
+EXTRA_VERSION=3
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 9730dd5e9c11bf319ac24b2d916dee78f7d8b5ea..ea326da32bc1578077942db22fe8c2a924ce73e6 100644 (file)
@@ -80,6 +80,7 @@ src/plugins/pgpcore/prefs_gpg.c
 src/plugins/pgpcore/select-keys.c
 src/plugins/pgpcore/sgpgme.c
 src/plugins/pgpcore/plugin.c
 src/plugins/pgpcore/select-keys.c
 src/plugins/pgpcore/sgpgme.c
 src/plugins/pgpcore/plugin.c
+src/plugins/pgpcore/pgp_viewer.c
 src/plugins/pgpinline/pgpinline.c
 src/plugins/pgpinline/plugin.c
 src/plugins/pgpmime/plugin.c
 src/plugins/pgpinline/pgpinline.c
 src/plugins/pgpinline/plugin.c
 src/plugins/pgpmime/plugin.c
index 6473e58857b8860a3c3de0626520779047c23503..41559f7e61796b889e5c9a6499ad6f835deb9998 100644 (file)
@@ -36,6 +36,7 @@
 #include "sgpgme.h"
 #include "prefs_common.h"
 #include "prefs_gpg.h"
 #include "sgpgme.h"
 #include "prefs_common.h"
 #include "prefs_gpg.h"
+#include "alertpanel.h"
 #include "plugin.h"
 
 typedef struct _PgpViewer PgpViewer;
 #include "plugin.h"
 
 typedef struct _PgpViewer PgpViewer;
@@ -107,26 +108,39 @@ static void pgpview_show_mime_part(TextView *textview, MimeInfo *partinfo)
                return;
        }
        gpgme_get_key(ctx, sig->fpr, &key, 0);
                return;
        }
        gpgme_get_key(ctx, sig->fpr, &key, 0);
-       TEXTVIEW_INSERT(_("\n  Importing key ID "));
-       TEXTVIEW_INSERT(sig->fpr);
-       TEXTVIEW_INSERT(":\n\n");
        if (!key) {
        if (!key) {
-               if (prefs_common.work_offline) {
-                       gchar *cmd = g_strdup_printf("gpg --recv-keys %s", sig->fpr);
+               gchar *cmd = g_strdup_printf("gpg --no-tty --recv-keys %s", sig->fpr);
+               AlertValue val = G_ALERTDEFAULT;
+               if (!prefs_common.work_offline) {
+                       val = alertpanel(_("Key import"),
+                               _("This key is not in your keyring. Do you want "
+                                 "Sylpheed-Claws to try and import it from a "
+                                 "keyserver?"),
+                                 GTK_STOCK_NO, "+" GTK_STOCK_YES, NULL);
+                       GTK_EVENTS_FLUSH();
+               }
+               if (val == G_ALERTDEFAULT) {
+                       TEXTVIEW_INSERT(_("\n  Key ID "));
+                       TEXTVIEW_INSERT(sig->fpr);
+                       TEXTVIEW_INSERT(":\n\n");
                        TEXTVIEW_INSERT(_("   This key is not in your keyring.\n"));
                        TEXTVIEW_INSERT(_("   This key is not in your keyring.\n"));
-                       TEXTVIEW_INSERT(_("   It should be possible to import it when working online,\n"));
-                       TEXTVIEW_INSERT(_("   or with the following command: \n\n     "));
+                       TEXTVIEW_INSERT(_("   It should be possible to import it "));
+                       if (prefs_common.work_offline)
+                               TEXTVIEW_INSERT(_("when working online,\n   or "));
+                       TEXTVIEW_INSERT(_("with the following command: \n\n     "));
                        TEXTVIEW_INSERT(cmd);
                        TEXTVIEW_INSERT(cmd);
-                       g_free(cmd);
                } else {
 #ifndef G_OS_WIN32
                } else {
 #ifndef G_OS_WIN32
-                       gchar *cmd = g_strdup_printf("gpg --recv-keys %s", sig->fpr);
                        int res = 0;
                        pid_t pid = 0;
                        int res = 0;
                        pid_t pid = 0;
+       
+                       TEXTVIEW_INSERT(_("\n  Importing key ID "));
+                       TEXTVIEW_INSERT(sig->fpr);
+                       TEXTVIEW_INSERT(":\n\n");
 
                        main_window_cursor_wait(mainwindow_get_mainwindow());
                        GTK_EVENTS_FLUSH();
 
                        main_window_cursor_wait(mainwindow_get_mainwindow());
                        GTK_EVENTS_FLUSH();
-                       
+
                        pid = fork();
                        if (pid == -1) {
                                res = -1;
                        pid = fork();
                        if (pid == -1) {
                                res = -1;
@@ -164,16 +178,18 @@ static void pgpview_show_mime_part(TextView *textview, MimeInfo *partinfo)
                                TEXTVIEW_INSERT(_("   You can try to import it manually with the command:\n\n     "));
                                TEXTVIEW_INSERT(cmd);
                        }
                                TEXTVIEW_INSERT(_("   You can try to import it manually with the command:\n\n     "));
                                TEXTVIEW_INSERT(cmd);
                        }
-                       g_free(cmd);
 #else
                        TEXTVIEW_INSERT(_("   This key is not in your keyring.\n"));
                        TEXTVIEW_INSERT(_("   Key import isn't implemented in Windows.\n"));
 #endif
                }
 #else
                        TEXTVIEW_INSERT(_("   This key is not in your keyring.\n"));
                        TEXTVIEW_INSERT(_("   Key import isn't implemented in Windows.\n"));
 #endif
                }
+               g_free(cmd);
                return;
        } else {
                return;
        } else {
-               TEXTVIEW_INSERT(_("   This key is already in your keyring.\n"));
-
+               TEXTVIEW_INSERT(_("\n  Key ID "));
+               TEXTVIEW_INSERT(sig->fpr);
+               TEXTVIEW_INSERT(":\n\n");
+               TEXTVIEW_INSERT(_("   This key is in your keyring.\n"));
        }
        gpgme_data_release(sigdata);
        gpgme_release(ctx);
        }
        gpgme_data_release(sigdata);
        gpgme_release(ctx);
index 70d0adbeb61cea4054cd96a420b2a69ecbfe2662..77295a684cd226ebcc17e652249a1c65c457779c 100644 (file)
@@ -710,7 +710,7 @@ again:
                g_free(buf);
                if (val == G_ALERTALTERNATE) {
 #ifndef G_OS_WIN32
                g_free(buf);
                if (val == G_ALERTALTERNATE) {
 #ifndef G_OS_WIN32
-                       gchar *cmd = g_strdup_printf("gpg --send-keys %s", key->fpr);
+                       gchar *cmd = g_strdup_printf("gpg --no-tty --send-keys %s", key->fpr);
                        int res = 0;
                        pid_t pid = 0;
                        pid = fork();
                        int res = 0;
                        pid_t pid = 0;
                        pid = fork();