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 df5e885..ae91dac 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
index aad4ce4..9e09379 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.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 e265c06..3bc4008 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 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
index 0f97a46..ba19b25 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)
 {
-       const gchar *str;
-
        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);
index c8d1ae6..4ba15af 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_decode_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
 
+#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>"},
@@ -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;
index a4d59f0..1b50340 100644 (file)
@@ -57,6 +57,7 @@ struct _MessageView
        MsgInfo *msginfo;
 
        gchar *forced_charset;
+       EncodingType forced_encoding;
 
        gboolean visible;
 
index a0bb26c..d6f2dae 100644 (file)
@@ -566,6 +566,8 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
 
        conv = conv_code_converter_new(charset);
 
+       procmime_force_encoding(textview->messageview->forced_encoding);
+       
        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);
+       procmime_force_encoding(0);
 }
 
 static void textview_show_html(TextView *textview, FILE *fp,