From da17f7c507da6fb68d1147864cf76b23ab3826e7 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Mon, 4 Oct 2004 10:22:00 +0000 Subject: [PATCH] 2004-10-04 [colin] 0.9.12cvs122.1 * src/mainwindow.c * src/messageview.c * src/messageview.h * src/textview.c Sync with HEAD --- ChangeLog-gtk2.claws | 8 ++++++++ PATCHSETS | 1 + configure.ac | 2 +- src/mainwindow.c | 6 ++---- src/messageview.c | 32 ++++++++++++++++++++++++++++++++ src/messageview.h | 1 + src/textview.c | 3 +++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index d4eb965ce..130e6f86d 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -1,3 +1,11 @@ +2004-10-04 [colin] 0.9.12cvs122.1 + + * src/mainwindow.c + * src/messageview.c + * src/messageview.h + * src/textview.c + Sync with HEAD + 2004-10-04 [colin] 0.9.12cvs121.1 * src/summaryview.c diff --git a/PATCHSETS b/PATCHSETS index b83e06d6d..6dacc5270 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -193,3 +193,4 @@ ( cvs diff -u -r 1.1.4.7 -r 1.1.4.8 src/gtk/gtksctree.c; cvs diff -u -r 1.395.2.33 -r 1.395.2.34 src/summaryview.c; ) > 0.9.12cvs119.3.patchset ( cvs diff -u -r 1.654.2.225 -r 1.654.2.226 configure.ac; ) > 0.9.12cvs120.1.patchset ( cvs diff -u -r 1.395.2.34 -r 1.395.2.35 src/summaryview.c; ) > 0.9.12cvs121.1.patchset +( cvs diff -u -r 1.274.2.21 -r 1.274.2.22 src/mainwindow.c; cvs diff -u -r 1.94.2.31 -r 1.94.2.32 src/messageview.c; cvs diff -u -r 1.19.2.3 -r 1.19.2.4 src/messageview.h; cvs diff -u -r 1.96.2.19 -r 1.96.2.20 src/textview.c; ) > 0.9.12cvs122.1.patchset diff --git a/configure.ac b/configure.ac index f5b3316f0..2286ac201 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=12 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=121 +EXTRA_VERSION=122 EXTRA_RELEASE= EXTRA_GTK2_VERSION=.1 diff --git a/src/mainwindow.c b/src/mainwindow.c index 244b6fbb6..47d5e0f73 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -2658,11 +2658,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); diff --git a/src/messageview.c b/src/messageview.c index 84b220ee3..c7cb84d33 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -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, ""} +#define DECODE_ACTION(action) \ + NULL, set_decode_cb, action, "/View/Decode/Auto detect" + {N_("/_View/Decode"), NULL, NULL, 0, ""}, + {N_("/_View/Decode/_Auto detect"), + NULL, set_decode_cb, 0, ""}, + {N_("/_View/Decode/---"), NULL, NULL, 0, ""}, + {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, ""}, {N_("/_View/Mess_age source"), NULL, view_source_cb, 0, NULL}, {N_("/_View/Show all _headers"),NULL, show_all_header_cb, 0, ""}, @@ -1295,6 +1314,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; diff --git a/src/messageview.h b/src/messageview.h index a4d59f0c7..1b50340d2 100644 --- a/src/messageview.h +++ b/src/messageview.h @@ -57,6 +57,7 @@ struct _MessageView MsgInfo *msginfo; gchar *forced_charset; + EncodingType forced_encoding; gboolean visible; diff --git a/src/textview.c b/src/textview.c index beb6f34bc..13bff83a3 100644 --- a/src/textview.c +++ b/src/textview.c @@ -539,6 +539,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); @@ -576,6 +578,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, -- 2.25.1