prevent mixed-mode Privacy settings
authorPaul Mangan <paul@claws-mail.org>
Fri, 8 Nov 2002 15:12:54 +0000 (15:12 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 8 Nov 2002 15:12:54 +0000 (15:12 +0000)
ChangeLog.claws
configure.in
src/compose.c
src/prefs_account.c
src/prefs_account.h

index 20567cf..467a145 100644 (file)
@@ -1,3 +1,11 @@
+2002-11-08 [paul]      0.8.5claws92
+
+       * src/compose.c
+         src/prefs_account.[ch]
+               remove account options 'clearsign' and 'ascii_armored',
+               replace with 'default_gnupg_mode' to prevent mixed-mode
+               Privacy settings
+
 2002-11-08 [paul]      0.8.5claws91
 
        * src/compose.[ch]
index 7c97a5d..0a44518 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws91
+EXTRA_VERSION=claws92
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 4ebb461..c7865ef 100644 (file)
@@ -148,14 +148,6 @@ typedef enum
        PRIORITY_LOWEST
 } PriorityLevel;
 
-#if USE_GPGME
-typedef enum
-{
-       GNUPG_MODE_DETACH,
-       GNUPG_MODE_INLINE
-} ComposeGnuPGMode;
-#endif
-
 #define B64_LINE_SIZE          57
 #define B64_BUFFSIZE           77
 
@@ -6831,7 +6823,7 @@ static void compose_toggle_encrypt_cb(gpointer data, guint action,
 
 static void activate_gnupg_mode (Compose *compose, PrefsAccount *account) 
 {
-       if (account->clearsign || account->ascii_armored)
+       if (account->default_gnupg_mode)
                compose->gnupg_mode = GNUPG_MODE_INLINE;
        else
                compose->gnupg_mode = GNUPG_MODE_DETACH;
index f8ba0d3..0d92fc1 100644 (file)
@@ -129,8 +129,8 @@ static struct Compose {
 static struct Privacy {
        GtkWidget *default_encrypt_chkbtn;
        GtkWidget *default_sign_chkbtn;
-       GtkWidget *ascii_armored_chkbtn;
-       GtkWidget *clearsign_chkbtn;
+       GtkWidget *gnupg_mime_radiobtn;
+       GtkWidget *gnupg_inline_radiobtn;
        GtkWidget *defaultkey_radiobtn;
        GtkWidget *emailkey_radiobtn;
        GtkWidget *customkey_radiobtn;
@@ -207,7 +207,7 @@ static void prefs_account_enum_set_radiobtn         (PrefParam *pparam);
 #endif /* USE_GPGME || USE_SSL */
 
 #if USE_GPGME
-static void prefs_account_ascii_armored_warning                (GtkWidget *widget);
+static void prefs_account_gnupg_inline_warning         (GtkWidget *widget);
 #endif /* USE_GPGME */
 
 static void prefs_account_crosspost_set_data_from_colormenu(PrefParam *pparam);
@@ -380,12 +380,10 @@ static PrefParam param[] = {
        {"default_sign", "FALSE", &tmp_ac_prefs.default_sign, P_BOOL,
         &privacy.default_sign_chkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"ascii_armored", "FALSE", &tmp_ac_prefs.ascii_armored, P_BOOL,
-        &privacy.ascii_armored_chkbtn,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"clearsign", "FALSE", &tmp_ac_prefs.clearsign, P_BOOL,
-        &privacy.clearsign_chkbtn,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"default_gnupg_mode", "FALSE", &tmp_ac_prefs.default_gnupg_mode, P_ENUM,
+        &privacy.gnupg_mime_radiobtn,
+        prefs_account_enum_set_data_from_radiobtn,
+        prefs_account_enum_set_radiobtn},
        {"sign_key", NULL, &tmp_ac_prefs.sign_key, P_ENUM,
         &privacy.defaultkey_radiobtn,
         prefs_account_enum_set_data_from_radiobtn,
@@ -1505,14 +1503,16 @@ static void prefs_account_compose_create(void)
 static void prefs_account_privacy_create(void)
 {
        GtkWidget *vbox1;
+       GtkWidget *frame_mode;
+       GtkWidget *vbox_mode;
        GtkWidget *frame1;
        GtkWidget *vbox2;
        GtkWidget *hbox1;
        GtkWidget *label;
        GtkWidget *default_encrypt_chkbtn;
        GtkWidget *default_sign_chkbtn;
-       GtkWidget *ascii_armored_chkbtn;
-       GtkWidget *clearsign_chkbtn;
+       GtkWidget *gnupg_mime_radiobtn;
+       GtkWidget *gnupg_inline_radiobtn;
        GtkWidget *defaultkey_radiobtn;
        GtkWidget *emailkey_radiobtn;
        GtkWidget *customkey_radiobtn;
@@ -1531,12 +1531,33 @@ static void prefs_account_privacy_create(void)
                           _("Encrypt message by default"));
        PACK_CHECK_BUTTON (vbox2, default_sign_chkbtn,
                           _("Sign message by default"));
-       PACK_CHECK_BUTTON (vbox2, ascii_armored_chkbtn,
-                          _("Use ASCII-armored format for encryption"));
-       PACK_CHECK_BUTTON (vbox2, clearsign_chkbtn,
-                          _("Use clear text signature"));
-       gtk_signal_connect (GTK_OBJECT (ascii_armored_chkbtn), "toggled",
-                           prefs_account_ascii_armored_warning, NULL);
+                           
+       PACK_FRAME (vbox1, frame_mode, _("Mode"));
+       
+       vbox_mode = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox_mode);
+       gtk_container_add (GTK_CONTAINER (frame_mode), vbox_mode);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_mode), 8);
+
+       gnupg_mime_radiobtn = gtk_radio_button_new_with_label
+               (NULL, _("Use PGP/MIME"));
+       gtk_widget_show (gnupg_mime_radiobtn);
+       gtk_box_pack_start (GTK_BOX (vbox_mode), gnupg_mime_radiobtn,
+                           FALSE, FALSE, 0);
+       gtk_object_set_user_data (GTK_OBJECT (gnupg_mime_radiobtn),
+                                 GINT_TO_POINTER (GNUPG_MODE_DETACH));
+
+       gnupg_inline_radiobtn = gtk_radio_button_new_with_label_from_widget
+               (GTK_RADIO_BUTTON (gnupg_mime_radiobtn),
+                _("Use Inline"));
+       gtk_widget_show (gnupg_inline_radiobtn);
+       gtk_box_pack_start (GTK_BOX (vbox_mode), gnupg_inline_radiobtn,
+                           FALSE, FALSE, 0);
+       gtk_object_set_user_data (GTK_OBJECT (gnupg_inline_radiobtn),
+                                 GINT_TO_POINTER (GNUPG_MODE_INLINE));
+       gtk_signal_connect (GTK_OBJECT (gnupg_inline_radiobtn), "clicked",
+                           prefs_account_gnupg_inline_warning, NULL);
+
 
        PACK_FRAME (vbox1, frame1, _("Sign key"));
 
@@ -1593,8 +1614,8 @@ static void prefs_account_privacy_create(void)
 
        privacy.default_encrypt_chkbtn = default_encrypt_chkbtn;
        privacy.default_sign_chkbtn    = default_sign_chkbtn;
-       privacy.ascii_armored_chkbtn   = ascii_armored_chkbtn;
-       privacy.clearsign_chkbtn       = clearsign_chkbtn;
+       privacy.gnupg_mime_radiobtn    = gnupg_mime_radiobtn;
+       privacy.gnupg_inline_radiobtn  = gnupg_inline_radiobtn;
        privacy.defaultkey_radiobtn    = defaultkey_radiobtn;
        privacy.emailkey_radiobtn      = emailkey_radiobtn;
        privacy.customkey_radiobtn     = customkey_radiobtn;
@@ -2158,13 +2179,13 @@ static void prefs_account_enum_set_radiobtn(PrefParam *pparam)
 #endif /* USE_GPGME || USE_SSL */
 
 #if USE_GPGME
-static void prefs_account_ascii_armored_warning(GtkWidget *widget)
+static void prefs_account_gnupg_inline_warning(GtkWidget *widget)
 {
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) &&
            gtk_notebook_get_current_page(GTK_NOTEBOOK(dialog.notebook)) > 0)
                alertpanel_warning
-                       (_("It's not recommended to use the old style ASCII-armored\n"
-                          "mode for encrypted messages. It doesn't comply with the\n"
+                       (_("Its not recommended to use the old style Inline\n"
+                          "mode for GnuPG messages. It doesn't comply with\n"
                           "RFC 3156 - MIME Security with OpenPGP."));
 }
 #endif /* USE_GPGME */
index 35d9136..cf7d781 100644 (file)
@@ -65,6 +65,11 @@ typedef enum {
        SIGN_KEY_BY_FROM,
        SIGN_KEY_CUSTOM
 } SignKeyType;
+
+typedef enum {
+       GNUPG_MODE_DETACH,
+       GNUPG_MODE_INLINE
+} DefaultGnuPGMode;
 #endif /* USE_GPGME */
 
 struct _PrefsAccount
@@ -146,8 +151,7 @@ struct _PrefsAccount
        /* Privacy */
        gboolean default_encrypt;
        gboolean default_sign;
-       gboolean ascii_armored;
-       gboolean clearsign;
+       gboolean default_gnupg_mode;;
        SignKeyType sign_key;
        gchar *sign_key_id;
 #endif /* USE_GPGME */