aboutsummaryrefslogtreecommitdiff
path: root/src/logwindow.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-10 09:49:06 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-10 09:49:06 +0000
commit0b73715dd9b3033f2ce4e8698a5a1968a9e87646 (patch)
tree08a9f0ee3b0c9521eff68062e8a4f38632e37710 /src/logwindow.c
parent9273d06df99648652b98adf86d7562811eb323b8 (diff)
hide PGP checkboxes if PGP is not available.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@734 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/logwindow.c')
-rw-r--r--src/logwindow.c17
1 files changed, 15 insertions, 2 deletions
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;