2004-10-04 [colin] 0.9.12cvs122
authorColin Leroy <colin@colino.net>
Mon, 4 Oct 2004 10:20:34 +0000 (10:20 +0000)
committerColin Leroy <colin@colino.net>
Mon, 4 Oct 2004 10:20:34 +0000 (10:20 +0000)
* src/mainwindow.c
* src/messageview.c
* src/messageview.h
* src/textview.c
Make forced encoding limited to messageview and
apply only to parts displayed using textview

ChangeLog.claws
PATCHSETS
configure.ac
src/mainwindow.c
src/messageview.c
src/messageview.h
src/textview.c

index df5e88536bd66c24233bd9d8d187e2dc221136ec..ae91dac210ccdb7d6443f19863ac304efcd1f530 100644 (file)
@@ -1,3 +1,12 @@
+2004-10-04 [colin]     0.9.12cvs122
+
+       * src/mainwindow.c
+       * src/messageview.c
+       * src/messageview.h
+       * src/textview.c
+               Make forced encoding limited to messageview and
+               apply only to parts displayed using textview
+
 2004-10-04 [colin]     0.9.12cvs121
 
        * src/summaryview.c
 2004-10-04 [colin]     0.9.12cvs121
 
        * src/summaryview.c
index aad4ce4fc3f6de98420941a3d5f85c0d5b224b6b..9e093792f7587d93b0f7e93ce299f3be94455a3c 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.310 -r 1.311 src/mainwindow.c; cvs diff -u -r 1.124 -r 1.125 src/messageview.c; cvs diff -u -r 1.114 -r 1.115 src/prefs_common.h; cvs diff -u -r 1.84 -r 1.85 src/procmime.c; cvs diff -u -r 1.29 -r 1.30 src/procmime.h; cvs diff -u -r 1.123 -r 1.124 src/textview.c; ) > 0.9.12cvs119.patchset
 ( cvs diff -u -r 1.446 -r 1.447 src/summaryview.c; ) > 0.9.12cvs120.patchset
 ( cvs diff -u -r 1.447 -r 1.448 src/summaryview.c; ) > 0.9.12cvs121.patchset
 ( cvs diff -u -r 1.310 -r 1.311 src/mainwindow.c; cvs diff -u -r 1.124 -r 1.125 src/messageview.c; cvs diff -u -r 1.114 -r 1.115 src/prefs_common.h; cvs diff -u -r 1.84 -r 1.85 src/procmime.c; cvs diff -u -r 1.29 -r 1.30 src/procmime.h; cvs diff -u -r 1.123 -r 1.124 src/textview.c; ) > 0.9.12cvs119.patchset
 ( cvs diff -u -r 1.446 -r 1.447 src/summaryview.c; ) > 0.9.12cvs120.patchset
 ( cvs diff -u -r 1.447 -r 1.448 src/summaryview.c; ) > 0.9.12cvs121.patchset
+( cvs diff -u -r 1.311 -r 1.312 src/mainwindow.c; cvs diff -u -r 1.125 -r 1.126 src/messageview.c; cvs diff -u -r 1.25 -r 1.26 src/messageview.h; cvs diff -u -r 1.124 -r 1.125 src/textview.c; ) > 0.9.12cvs122.patchset
index e265c06a863f13dc765d9568359f91e2b9102312..3bc40086d679dc41bf105aba45033ebad8523346 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=121
+EXTRA_VERSION=122
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index 0f97a465a3c1443cdbe4dd6cc41b4df5ebbb7b70..ba19b25334abeecbae23153a7de3be900e6dc35a 100644 (file)
@@ -2637,11 +2637,9 @@ static void set_charset_cb(MainWindow *mainwin, guint action,
 static void set_decode_cb(MainWindow *mainwin, guint action,
                           GtkWidget *widget)
 {
 static void set_decode_cb(MainWindow *mainwin, guint action,
                           GtkWidget *widget)
 {
-       const gchar *str;
-
        if (GTK_CHECK_MENU_ITEM(widget)->active) {
        if (GTK_CHECK_MENU_ITEM(widget)->active) {
-               procmime_force_encoding((EncodingType)action);
-
+               mainwin->messageview->forced_encoding = (EncodingType)action;
+               
                summary_redisplay_msg(mainwin->summaryview);
                
                debug_print("forced encoding: %d\n", action);
                summary_redisplay_msg(mainwin->summaryview);
                
                debug_print("forced encoding: %d\n", action);
index c8d1ae6d7d9f37584103de32bbe71045c028942a..4ba15af77ac85a8c3d5885a3cbe1a4c4d7aa57aa 100644 (file)
@@ -107,6 +107,9 @@ static void search_cb                       (gpointer        data,
 static void set_charset_cb             (gpointer        data,
                                         guint           action,
                                         GtkWidget      *widget);
 static void set_charset_cb             (gpointer        data,
                                         guint           action,
                                         GtkWidget      *widget);
+static void set_decode_cb              (gpointer        data,
+                                        guint           action,
+                                        GtkWidget      *widget);
 static void view_source_cb             (gpointer        data,
                                         guint           action,
                                         GtkWidget      *widget);
 static void view_source_cb             (gpointer        data,
                                         guint           action,
                                         GtkWidget      *widget);
@@ -245,6 +248,22 @@ static GtkItemFactoryEntry msgview_entries[] =
 #undef CODESET_SEPARATOR
 #undef CODESET_ACTION
 
 #undef CODESET_SEPARATOR
 #undef CODESET_ACTION
 
+#define DECODE_SEPARATOR \
+       {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"}
+#define DECODE_ACTION(action) \
+        NULL, set_decode_cb, action, "/View/Decode/Auto detect"
+       {N_("/_View/Decode"),           NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Decode/_Auto detect"),
+        NULL, set_decode_cb, 0, "<RadioItem>"},
+       {N_("/_View/Decode/---"),               NULL, NULL, 0, "<Separator>"},
+       {N_("/_View/Decode/_8bit"),             DECODE_ACTION(ENC_8BIT)},
+       {N_("/_View/Decode/_Quoted printable"), DECODE_ACTION(ENC_QUOTED_PRINTABLE)},
+       {N_("/_View/Decode/_Base64"),           DECODE_ACTION(ENC_BASE64)},
+       {N_("/_View/Decode/_Uuencode"),         DECODE_ACTION(ENC_X_UUENCODE)},
+
+#undef DECODE_SEPARATOR
+#undef DECODE_ACTION
+
        {N_("/_View/---"),              NULL, NULL, 0, "<Separator>"},
        {N_("/_View/Mess_age source"),  NULL, view_source_cb, 0, NULL},
        {N_("/_View/Show all _headers"),NULL, show_all_header_cb, 0, "<ToggleItem>"},
        {N_("/_View/---"),              NULL, NULL, 0, "<Separator>"},
        {N_("/_View/Mess_age source"),  NULL, view_source_cb, 0, NULL},
        {N_("/_View/Show all _headers"),NULL, show_all_header_cb, 0, "<ToggleItem>"},
@@ -1280,6 +1299,19 @@ static void set_charset_cb(gpointer data, guint action, GtkWidget *widget)
        }
 }
 
        }
 }
 
+static void set_decode_cb(gpointer data, guint action, GtkWidget *widget)
+{
+       MessageView *messageview = (MessageView *)data;
+       if (GTK_CHECK_MENU_ITEM(widget)->active) {
+               messageview->forced_encoding = (EncodingType)action;
+
+               messageview_show(messageview, messageview->msginfo, FALSE);
+               
+               debug_print("forced encoding: %d\n", action);
+       }
+}
+
+
 static void view_source_cb(gpointer data, guint action, GtkWidget *widget)
 {
        MessageView *messageview = (MessageView *)data;
 static void view_source_cb(gpointer data, guint action, GtkWidget *widget)
 {
        MessageView *messageview = (MessageView *)data;
index a4d59f0c7279323828f11be7952b39c1cb5a4f55..1b50340d2a098c77d4b7a99163f4d917c5b44f70 100644 (file)
@@ -57,6 +57,7 @@ struct _MessageView
        MsgInfo *msginfo;
 
        gchar *forced_charset;
        MsgInfo *msginfo;
 
        gchar *forced_charset;
+       EncodingType forced_encoding;
 
        gboolean visible;
 
 
        gboolean visible;
 
index a0bb26ccc14ed747318ed99549e124813699050e..d6f2dae5938440c89270af4c09a772e5f66a0535 100644 (file)
@@ -566,6 +566,8 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
 
        conv = conv_code_converter_new(charset);
 
 
        conv = conv_code_converter_new(charset);
 
+       procmime_force_encoding(textview->messageview->forced_encoding);
+       
        textview->is_in_signature = FALSE;
 
        procmime_decode_content(mimeinfo);
        textview->is_in_signature = FALSE;
 
        procmime_decode_content(mimeinfo);
@@ -603,6 +605,7 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
        }
 
        conv_code_converter_destroy(conv);
        }
 
        conv_code_converter_destroy(conv);
+       procmime_force_encoding(0);
 }
 
 static void textview_show_html(TextView *textview, FILE *fp,
 }
 
 static void textview_show_html(TextView *textview, FILE *fp,