From 0b73715dd9b3033f2ce4e8698a5a1968a9e87646 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 10 Nov 2005 09:49:06 +0000 Subject: hide PGP checkboxes if PGP is not available. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@734 ee746299-78ed-0310-b773-934348b2243d --- src/logwindow.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/logwindow.c') diff --git a/src/logwindow.c b/src/logwindow.c index ccd6b987..017bb37b 100644 --- a/src/logwindow.c +++ b/src/logwindow.c @@ -35,6 +35,7 @@ #include "prefs_common.h" #include "utils.h" #include "gtkutils.h" +#include "codeconv.h" #define TRIM_LINES 25 @@ -210,8 +211,20 @@ void log_window_append(const gchar *str, LogType type) if (head) gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, head, -1, tag, NULL); - gtk_text_buffer_insert_with_tags_by_name - (buffer, &iter, str, -1, tag, NULL); + + if (!g_utf8_validate(str, -1, NULL)) { + gchar *str_; + + str_ = conv_utf8todisp(str, NULL); + if (str_) { + gtk_text_buffer_insert_with_tags_by_name + (buffer, &iter, str_, -1, tag, NULL); + g_free(str_); + } + } else { + gtk_text_buffer_insert_with_tags_by_name + (buffer, &iter, str, -1, tag, NULL); + } if (GTK_WIDGET_VISIBLE(text)) { GtkTextMark *mark; -- cgit v1.2.3