sync with 0.8.8cvs9
authorPaul Mangan <paul@claws-mail.org>
Thu, 16 Jan 2003 11:02:43 +0000 (11:02 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 16 Jan 2003 11:02:43 +0000 (11:02 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/codeconv.c
src/compose.c
src/prefs_common.c
src/prefs_common.h
src/procmime.c

index 14a7e67..046092e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2003-01-16
+
+       * src/prefs_common.c: prefs_send_create(): added a description for
+         the setting of Content-Transfer-Encoding.
+
+2003-01-16
+
+       * src/codeconv.c: fixed locale_table for Russian locales (thanks to
+         Sergey Vlasov).
+       * src/procmime.c: procmime_get_encoding_for_charset(): return
+         ENC_BASE64 for ISO-8859-5, KOI8-* and Windows-1251.
+       * src/compose.c: compose_attach_append(): set correct Content-
+         Transfer-Encoding for message/rfc822.
+         compose_write_to_file(): enabled user-definable Content-Transfer-
+         Encoding.
+       * src/prefs_common.[ch]: added an option for user-defined Content-
+         Transfer-Encoding.
+
 2003-01-15
 
        * src/quoted-printable.[ch]: qp_encode_line(): fixed a bug if the
index 5ded8eb..07c7b10 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-16 [paul]      0.8.8claws105
+
+       * sync with 0.8.8cvs9
+               see ChangeLog 2002-01-16
+
 2003-01-16 [colin]     0.8.8claws104
 
        * src/compose.[ch]
index e33516c..5c726fa 100644 (file)
@@ -1,3 +1,21 @@
+2003-01-16
+
+       * src/prefs_common.c: prefs_send_create(): Content-Transfer-Encoding
+         ¤ÎÀßÄê¤ÎÀâÌÀ¤òÄɲá£
+
+2003-01-16
+
+       * src/codeconv.c: ¥í¥·¥¢¸ì locale ¤Î¤¿¤á¤Î locale_table ¤Î½¤Àµ
+         (Sergey Vlasov ¤µ¤ó thanks)¡£
+       * src/procmime.c: procmime_get_encoding_for_charset(): ISO-8859-5,
+         KOI8-*, Windows-1251 ¤ËÂФ·¤Æ ENC_BASE64 ¤òÊÖ¤¹¤è¤¦¤Ë¤·¤¿¡£
+       * src/compose.c: compose_attach_append(): message/rfc822 ¤ËÂФ·¤Æ
+         Àµ¤·¤¤ Content-Transfer-Encoding ¤ò¥»¥Ã¥È¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         compose_write_to_file(): ¥æ¡¼¥¶ÄêµÁ¤Î Content-Transfer-Encoding
+         ¤òÍ­¸ú¤Ë¤·¤¿¡£
+       * src/prefs_common.[ch]: ¥æ¡¼¥¶ÄêµÁ¤Î Content-Transfer-Encoding
+         ¤Î¥ª¥×¥·¥ç¥ó¤òÄɲá£
+
 2003-01-15
 
        * src/quoted-printable.[ch]: qp_encode_line(): ¹Ô¤¬²þ¹Ô¤Ç½ª¤ï¤é¤Ê¤¤
index fa2c254..a9231c0 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws104
+EXTRA_VERSION=claws105
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 6d0a7a1..25c0e38 100644 (file)
@@ -792,9 +792,12 @@ static const struct {
        {"zh_TW.Big5"   , C_BIG5        , C_BIG5},
        {"zh_TW"        , C_BIG5        , C_BIG5},
 
-       {"ru_RU.KOI8-R" , C_KOI8_R      , C_ISO_8859_5},
-       {"ru_RU.CP1251" , C_WINDOWS_1251, C_ISO_8859_5},
-
+       {"ru_RU.KOI8-R" , C_KOI8_R      , C_KOI8_R},
+       {"ru_RU.CP1251" , C_WINDOWS_1251, C_KOI8_R},
+       {"ru_RU"        , C_ISO_8859_5  , C_KOI8_R},
+       {"ru_UA"        , C_KOI8_U      , C_KOI8_U},
+       {"uk_UA"        , C_KOI8_U      , C_KOI8_U},
+       {"be_BY"        , C_WINDOWS_1251, C_WINDOWS_1251},
        {"bg_BG"        , C_WINDOWS_1251, C_WINDOWS_1251},
 
        {"en_US"        , C_ISO_8859_1  , C_ISO_8859_1},
@@ -819,7 +822,6 @@ static const struct {
        {"ro_RO"        , C_ISO_8859_2  , C_ISO_8859_2},
        {"sk_SK"        , C_ISO_8859_2  , C_ISO_8859_2},
        {"sl_SI"        , C_ISO_8859_2  , C_ISO_8859_2},
-       {"ru_RU"        , C_ISO_8859_5  , C_ISO_8859_5},
        {"el_GR"        , C_ISO_8859_7  , C_ISO_8859_7},
        {"iw_IL"        , C_ISO_8859_8  , C_ISO_8859_8},
        {"tr_TR"        , C_ISO_8859_9  , C_ISO_8859_9},
index bbc2b8d..40cf24d 100644 (file)
@@ -1927,7 +1927,10 @@ static void compose_attach_append(Compose *compose, const gchar *file,
        if (content_type) {
                ainfo->content_type = g_strdup(content_type);
                if (!strcasecmp(content_type, "message/rfc822")) {
-                       ainfo->encoding = ENC_7BIT;
+                       if (procmime_get_encoding_for_file(file) == ENC_7BIT)
+                               ainfo->encoding = ENC_7BIT;
+                       else
+                               ainfo->encoding = ENC_8BIT;
                        ainfo->name = g_strdup_printf
                                (_("Message: %s"),
                                 g_basename(filename ? filename : file));
@@ -3231,7 +3234,15 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
                out_codeset = conv_get_outgoing_charset_str();
                if (!strcasecmp(out_codeset, CS_US_ASCII))
                        out_codeset = CS_ISO_8859_1;
-               encoding = procmime_get_encoding_for_charset(out_codeset);
+
+               if (prefs_common.encoding_method == CTE_BASE64)
+                       encoding = ENC_BASE64;
+               else if (prefs_common.encoding_method == CTE_QUOTED_PRINTABLE)
+                       encoding = ENC_QUOTED_PRINTABLE;
+               else if (prefs_common.encoding_method == CTE_8BIT)
+                       encoding = ENC_8BIT;
+               else
+                       encoding = procmime_get_encoding_for_charset(out_codeset);
 
 #if USE_GPGME
                if (!is_draft &&
index 5bb3e39..3c7f90d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -99,6 +99,7 @@ static struct Send {
        GtkWidget *checkbtn_queuemsg;
 
        GtkWidget *optmenu_charset;
+       GtkWidget *optmenu_encoding_method;
 } p_send;
 
 static struct Compose {
@@ -264,8 +265,12 @@ static guint font_sel_conn_id;
 static GtkWidget *quote_color_win;
 static GtkWidget *color_dialog;
 
-static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam);
-static void prefs_common_charset_set_optmenu         (PrefParam *pparam);
+static void prefs_common_charset_set_data_from_optmenu    (PrefParam *pparam);
+static void prefs_common_charset_set_optmenu              (PrefParam *pparam);
+static void prefs_common_encoding_set_data_from_optmenu    (PrefParam *pparam);
+static void prefs_common_encoding_set_optmenu             (PrefParam *pparam);
+static void prefs_common_recv_dialog_set_data_from_optmenu (PrefParam *pparam);
+static void prefs_common_recv_dialog_set_optmenu          (PrefParam *pparam);
 static void prefs_common_recv_dialog_newmail_notify_toggle_cb  (GtkWidget *w,
                                                                 gpointer data);
 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
@@ -353,6 +358,10 @@ static PrefParam param[] = {
         &p_send.optmenu_charset,
         prefs_common_charset_set_data_from_optmenu,
         prefs_common_charset_set_optmenu},
+       {"encoding_method", "0", &prefs_common.encoding_method, P_ENUM,
+        &p_send.optmenu_encoding_method,
+        prefs_common_encoding_set_data_from_optmenu,
+        prefs_common_encoding_set_optmenu},
 
        /* Compose */
        {"auto_signature", "TRUE", &prefs_common.auto_sig, P_BOOL,
@@ -1297,10 +1306,13 @@ static void prefs_send_create(void)
        GtkWidget *checkbtn_savemsg;
        GtkWidget *checkbtn_queuemsg;
        GtkWidget *label_outcharset;
-       GtkWidget *optmenu;
+       GtkWidget *optmenu_charset;
        GtkWidget *optmenu_menu;
        GtkWidget *menuitem;
        GtkWidget *label_charset_desc;
+       GtkWidget *optmenu_encoding;
+       GtkWidget *label_encoding;
+       GtkWidget *label_encoding_desc;
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
@@ -1353,15 +1365,15 @@ static void prefs_send_create(void)
        gtk_widget_show (label_outcharset);
        gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
 
-       optmenu = gtk_option_menu_new ();
-       gtk_widget_show (optmenu);
-       gtk_box_pack_start (GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
+       optmenu_charset = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_charset);
+       gtk_box_pack_start (GTK_BOX (hbox1), optmenu_charset, FALSE, FALSE, 0);
 
        optmenu_menu = gtk_menu_new ();
 
-#define SET_MENUITEM(str, charset) \
+#define SET_MENUITEM(str, data) \
 { \
-       MENUITEM_ADD(optmenu_menu, menuitem, str, charset); \
+       MENUITEM_ADD(optmenu_menu, menuitem, str, data); \
 }
 
        SET_MENUITEM(_("Automatic (Recommended)"),       CS_AUTO);
@@ -1399,7 +1411,8 @@ static void prefs_send_create(void)
        SET_MENUITEM(_("Thai (TIS-620)"),                CS_TIS_620);
        SET_MENUITEM(_("Thai (Windows-874)"),            CS_WINDOWS_874);
 
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_charset),
+                                 optmenu_menu);
 
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
@@ -1411,7 +1424,43 @@ static void prefs_send_create(void)
        gtk_widget_show (label_charset_desc);
        gtk_box_pack_start (GTK_BOX (hbox1), label_charset_desc,
                            FALSE, FALSE, 0);
-       gtk_label_set_justify(GTK_LABEL (label_charset_desc), GTK_JUSTIFY_LEFT);
+       gtk_label_set_justify (GTK_LABEL (label_charset_desc),
+                              GTK_JUSTIFY_LEFT);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       label_encoding = gtk_label_new (_("Transfer encoding"));
+       gtk_widget_show (label_encoding);
+       gtk_box_pack_start (GTK_BOX (hbox1), label_encoding, FALSE, FALSE, 0);
+
+       optmenu_encoding = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_encoding);
+       gtk_box_pack_start (GTK_BOX (hbox1), optmenu_encoding, FALSE, FALSE, 0);
+
+       optmenu_menu = gtk_menu_new ();
+
+       SET_MENUITEM(_("Automatic"),     CTE_AUTO);
+       SET_MENUITEM("base64",           CTE_BASE64);
+       SET_MENUITEM("quoted-printable", CTE_QUOTED_PRINTABLE);
+       SET_MENUITEM("8bit",             CTE_8BIT);
+
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_encoding),
+                                 optmenu_menu);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       label_encoding_desc = gtk_label_new
+               (_("Specify Content-Transfer-Encoding used when\n"
+                  "message body contains non-ASCII characters."));
+       gtk_widget_show (label_encoding_desc);
+       gtk_box_pack_start (GTK_BOX (hbox1), label_encoding_desc,
+                           FALSE, FALSE, 0);
+       gtk_label_set_justify (GTK_LABEL (label_encoding_desc),
+                              GTK_JUSTIFY_LEFT);
 
        p_send.checkbtn_extsend = checkbtn_extsend;
        p_send.entry_extsend    = entry_extsend;
@@ -1420,7 +1469,8 @@ static void prefs_send_create(void)
        p_send.checkbtn_savemsg  = checkbtn_savemsg;
        p_send.checkbtn_queuemsg = checkbtn_queuemsg;
 
-       p_send.optmenu_charset = optmenu;
+       p_send.optmenu_charset = optmenu_charset;
+       p_send.optmenu_encoding_method = optmenu_encoding;
 }
 
 static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
@@ -4157,6 +4207,36 @@ static void prefs_common_charset_set_optmenu(PrefParam *pparam)
        }
 }
 
+static void prefs_common_encoding_set_data_from_optmenu(PrefParam *pparam)
+{
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       *((TransferEncodingMethod *)pparam->data) = GPOINTER_TO_INT
+               (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
+}
+
+static void prefs_common_encoding_set_optmenu(PrefParam *pparam)
+{
+       TransferEncodingMethod method =
+               *((TransferEncodingMethod *)pparam->data);
+       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
+       gint index;
+
+       g_return_if_fail(optmenu != NULL);
+
+       index = menu_find_option_menu_index(optmenu, GINT_TO_POINTER(method),
+                                           NULL);
+       if (index >= 0)
+               gtk_option_menu_set_history(optmenu, index);
+       else {
+               gtk_option_menu_set_history(optmenu, 0);
+               prefs_common_encoding_set_data_from_optmenu(pparam);
+       }
+}
+
 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
 {
        GtkWidget *menu;
@@ -4174,19 +4254,15 @@ static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
        GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
        GtkWidget *menu;
        GtkWidget *menuitem;
+       gint index;
 
-       switch (mode) {
-       case RECV_DIALOG_ALWAYS:
+       index = menu_find_option_menu_index(optmenu, GINT_TO_POINTER(mode),
+                                           NULL);
+       if (index >= 0)
+               gtk_option_menu_set_history(optmenu, index);
+       else {
                gtk_option_menu_set_history(optmenu, 0);
-               break;
-       case RECV_DIALOG_ACTIVE:
-               gtk_option_menu_set_history(optmenu, 1);
-               break;
-       case RECV_DIALOG_NEVER:
-               gtk_option_menu_set_history(optmenu, 2);
-               break;
-       default:
-               break;
+               prefs_common_recv_dialog_set_data_from_optmenu(pparam);
        }
 
        menu = gtk_option_menu_get_menu(optmenu);
index c680031..6a6bc58 100644 (file)
@@ -39,6 +39,13 @@ typedef enum {
        RECV_DIALOG_NEVER
 } RecvDialogMode;
 
+typedef enum {
+       CTE_AUTO,
+       CTE_BASE64,
+       CTE_QUOTED_PRINTABLE,
+       CTE_8BIT
+} TransferEncodingMethod;
+
 typedef enum {
        SEND_DIALOG_ALWAYS,
        /* SEND_DIALOG_ACTIVE would be irrelevant */
@@ -75,6 +82,7 @@ struct _PrefsCommon
        gboolean savemsg;
        gboolean queue_msg;
        gchar *outgoing_charset;
+       TransferEncodingMethod encoding_method;
 
        /* Compose */
        gboolean auto_sig;
index 3485672..7aedcc3 100644 (file)
@@ -1238,8 +1238,11 @@ EncodingType procmime_get_encoding_for_charset(const gchar *charset)
        else if (!strncasecmp(charset, "ISO-2022-", 9) ||
                 !strcasecmp(charset, "US-ASCII"))
                return ENC_7BIT;
-       else if (!strncasecmp(charset, "ISO-8859-", 9) ||
-                !strncasecmp(charset, "CP125", 5))
+       else if (!strcasecmp(charset, "ISO-8859-5") ||
+                !strncasecmp(charset, "KOI8-", 5) ||
+                !strcasecmp(charset, "Windows-1251"))
+               return ENC_BASE64;
+       else if (!strncasecmp(charset, "ISO-8859-", 9))
                return ENC_QUOTED_PRINTABLE;
        else
                return ENC_8BIT;