2007-02-18 [paul] 2.7.2cvs50
authorPaul Mangan <paul@claws-mail.org>
Sun, 18 Feb 2007 23:20:33 +0000 (23:20 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sun, 18 Feb 2007 23:20:33 +0000 (23:20 +0000)
* src/plugins/pgpcore/prefs_gpg.c
* src/plugins/pgpcore/prefs_gpg.h
* src/plugins/pgpcore/sgpgme.c
* src/plugins/pgpinline/pgpinline.c
* src/plugins/pgpmime/pgpmime.c
improved GUI interoperability with gpg-agent

ChangeLog
PATCHSETS
configure.ac
src/plugins/pgpcore/prefs_gpg.c
src/plugins/pgpcore/prefs_gpg.h
src/plugins/pgpcore/sgpgme.c
src/plugins/pgpinline/pgpinline.c
src/plugins/pgpmime/pgpmime.c

index 640b522..2e50d1d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-02-18 [paul]      2.7.2cvs50
+
+       * src/plugins/pgpcore/prefs_gpg.c
+       * src/plugins/pgpcore/prefs_gpg.h
+       * src/plugins/pgpcore/sgpgme.c
+       * src/plugins/pgpinline/pgpinline.c
+       * src/plugins/pgpmime/pgpmime.c
+               improved GUI interoperability with gpg-agent
+
 2007-02-18 [paul]      2.7.2cvs49
 
        * src/prefs_account.c
index 0f6c64f..757f960 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.207.2.147 -r 1.207.2.148 src/folderview.c;  ) > 2.7.2cvs47.patchset
 ( cvs diff -u -r 1.94.2.123 -r 1.94.2.124 src/messageview.c;  ) > 2.7.2cvs48.patchset
 ( cvs diff -u -r 1.105.2.86 -r 1.105.2.87 src/prefs_account.c;  ) > 2.7.2cvs49.patchset
+( cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/plugins/pgpcore/prefs_gpg.c;  cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/plugins/pgpcore/prefs_gpg.h;  cvs diff -u -r 1.1.2.40 -r 1.1.2.41 src/plugins/pgpcore/sgpgme.c;  cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/plugins/pgpinline/pgpinline.c;  cvs diff -u -r 1.1.2.44 -r 1.1.2.45 src/plugins/pgpmime/pgpmime.c;  ) > 2.7.2cvs50.patchset
index 9c39985..d79b36f 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=7
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=49
+EXTRA_VERSION=50
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 2156de9..b6bb239 100644 (file)
@@ -36,7 +36,7 @@ static PrefParam param[] = {
        {"auto_check_signatures", "FALSE",
         &prefs_gpg.auto_check_signatures, P_BOOL,
         NULL, NULL, NULL},
-       {"use_agent_if_available", "TRUE", &prefs_gpg.use_agent_if_available, P_BOOL,
+       {"use_gpg_agent", "TRUE", &prefs_gpg.use_gpg_agent, P_BOOL,
         NULL, NULL, NULL},
        {"store_passphrase", "FALSE", &prefs_gpg.store_passphrase, P_BOOL,
         NULL, NULL, NULL},
@@ -58,7 +58,7 @@ struct GPGPage
        PrefsPage page;
 
        GtkWidget *checkbtn_auto_check_signatures;
-       GtkWidget *checkbtn_use_agent_if_available;
+       GtkWidget *checkbtn_use_gpg_agent;
         GtkWidget *checkbtn_store_passphrase;  
         GtkWidget *spinbtn_store_passphrase;  
         GtkWidget *checkbtn_passphrase_grab;  
@@ -72,7 +72,7 @@ static void prefs_gpg_create_widget_func(PrefsPage *_page,
        struct GPGPage *page = (struct GPGPage *) _page;
        struct GPGConfig *config;
 
-       GtkWidget *checkbtn_use_agent_if_available;
+       GtkWidget *checkbtn_use_gpg_agent;
        GtkWidget *checkbtn_passphrase_grab;
        GtkWidget *checkbtn_store_passphrase;
        GtkWidget *checkbtn_auto_check_signatures;
@@ -84,7 +84,6 @@ static void prefs_gpg_create_widget_func(PrefsPage *_page,
        GtkWidget *spinbtn_store_passphrase;
        GtkWidget *label_expire2;
        GtkWidget *frame_passphrase;
-       GtkWidget *label;
        GtkTooltips *tooltips;
        
        tooltips = gtk_tooltips_new();
@@ -102,22 +101,22 @@ static void prefs_gpg_create_widget_func(PrefsPage *_page,
 
        vbox2 = gtkut_get_options_frame(vbox1, &frame_passphrase, _("Passphrase"));
 
-       PACK_CHECK_BUTTON (vbox2, checkbtn_use_agent_if_available,
-                       _("Use gpg-agent if it is available"));
+       PACK_CHECK_BUTTON (vbox2, checkbtn_use_gpg_agent,
+                       _("Use gpg-agent to manage passwords"));
+       if (!getenv("GPG_AGENT_INFO"))
+               gtk_widget_set_sensitive(checkbtn_use_gpg_agent, FALSE);
 
-       label = gtk_label_new(_("Else,"));
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-       gtk_widget_show (label);
-
-       gtk_box_pack_start(GTK_BOX(vbox2), label, FALSE, FALSE, 0);
-       
        PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase,
                        _("Store passphrase in memory"));
 
+       SET_TOGGLE_SENSITIVITY_REVERSE(checkbtn_use_gpg_agent, checkbtn_store_passphrase);
+
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
 
+       SET_TOGGLE_SENSITIVITY_REVERSE(checkbtn_use_gpg_agent, hbox1);
+
        label_expire1 = gtk_label_new(_("Expire after"));
        gtk_widget_show (label_expire1);
        gtk_box_pack_start (GTK_BOX (hbox1), label_expire1, FALSE, FALSE, 0);
@@ -160,8 +159,12 @@ static void prefs_gpg_create_widget_func(PrefsPage *_page,
        config = prefs_gpg_get_config();
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_auto_check_signatures), config->auto_check_signatures);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_use_agent_if_available), config->use_agent_if_available);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_store_passphrase), config->store_passphrase);
+       if (!getenv("GPG_AGENT_INFO"))
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_use_gpg_agent), FALSE);
+       else
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_use_gpg_agent), config->use_gpg_agent);
+       if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbtn_use_gpg_agent)))
+               gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_store_passphrase), config->store_passphrase);
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_store_passphrase), (float) config->store_passphrase_timeout);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_passphrase_grab), config->passphrase_grab);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_gpg_warning), config->gpg_warning);
@@ -171,7 +174,7 @@ static void prefs_gpg_create_widget_func(PrefsPage *_page,
        page->spinbtn_store_passphrase = spinbtn_store_passphrase;
        page->checkbtn_passphrase_grab = checkbtn_passphrase_grab;
        page->checkbtn_gpg_warning = checkbtn_gpg_warning;
-       page->checkbtn_use_agent_if_available = checkbtn_use_agent_if_available;
+       page->checkbtn_use_gpg_agent = checkbtn_use_gpg_agent;
        page->page.widget = vbox1;
 }
 
@@ -186,8 +189,8 @@ static void prefs_gpg_save_func(PrefsPage *_page)
 
        config->auto_check_signatures =
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_auto_check_signatures));
-       config->use_agent_if_available = 
-               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_use_agent_if_available));
+       config->use_gpg_agent = 
+               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_use_gpg_agent));
        config->store_passphrase = 
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_store_passphrase));
        config->store_passphrase_timeout = 
index 5df4de0..6cb7711 100644 (file)
@@ -31,7 +31,7 @@ typedef enum {
 struct GPGConfig
 {
        gboolean         auto_check_signatures;
-       gboolean         use_agent_if_available;
+       gboolean         use_gpg_agent;
        gboolean         store_passphrase;
        gint             store_passphrase_timeout;
        gboolean         passphrase_grab;
index 62bd15e..918127e 100644 (file)
@@ -377,7 +377,7 @@ gpgme_data_t sgpgme_decrypt_verify(gpgme_data_t cipher, gpgme_verify_result_t *s
        }
        
        if (gpgme_get_protocol(ctx) == GPGME_PROTOCOL_OpenPGP) {
-               if (!getenv("GPG_AGENT_INFO") || !prefs_gpg_get_config()->use_agent_if_available) {
+               if (!getenv("GPG_AGENT_INFO") || !prefs_gpg_get_config()->use_gpg_agent) {
                        info.c = ctx;
                        gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, &info);
                }
index e7b5040..7ad5bb6 100644 (file)
@@ -540,7 +540,7 @@ static gboolean pgpinline_sign(MimeInfo *mimeinfo, PrefsAccount *account)
                return FALSE;
        }
 
-       if (!getenv("GPG_AGENT_INFO") || !prefs_gpg_get_config()->use_agent_if_available) {
+       if (!getenv("GPG_AGENT_INFO") || !prefs_gpg_get_config()->use_gpg_agent) {
                info.c = ctx;
                gpgme_set_passphrase_cb (ctx, gpgmegtk_passphrase_cb, &info);
        }
index 1b7110e..b28fe04 100644 (file)
@@ -477,7 +477,7 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account)
                return FALSE;
        }
 
-       if (getenv("GPG_AGENT_INFO") && prefs_gpg_get_config()->use_agent_if_available) {
+       if (getenv("GPG_AGENT_INFO") && prefs_gpg_get_config()->use_gpg_agent) {
                debug_print("GPG_AGENT_INFO environment defined, running without passphrase callback\n");
        } else {
                info.c = ctx;