changeset 1244:eaa0e2f5ace4

[gaim-migrate @ 1254] Ignore incoming fonts option committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Tue, 12 Dec 2000 23:09:07 +0000
parents 6c05af408b71
children 2ac6ccb94229
files src/conversation.c src/gaim.h src/gtkhtml.c src/prefs.c
diffstat 4 files changed, 28 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Tue Dec 12 22:52:01 2000 +0000
+++ b/src/conversation.c	Tue Dec 12 23:09:07 2000 +0000
@@ -1178,6 +1178,13 @@
 	/* hopefully we can later use this for bgcolors in smileys */
 	GdkColor *trans = &window->style->base[GTK_STATE_NORMAL];
 	gboolean in_tag = FALSE;
+	int gtk_font_options = 0;
+			
+	if (display_options & OPT_DISP_IGNORE_COLOUR)	
+		gtk_font_options = gtk_font_options ^ HTML_OPTION_NO_COLOURS;
+
+	if (display_options & OPT_DISP_IGNORE_FONTS) 
+		gtk_font_options = gtk_font_options ^ HTML_OPTION_NO_FONTS;
 
 	for (i = 0; i < strlen(what); i++)
 	{
@@ -1188,8 +1195,9 @@
 				y++;
 				in_tag = TRUE;
 			} else if ((face = is_smiley(window, &what[i], &len, trans)) != NULL) {
+
 				buf2[y] = 0;
-				gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
+				gtk_html_append_text(GTK_HTML(html), buf2,  gtk_font_options);
 				gtk_html_add_pixmap(GTK_HTML(html), face, 0, 0);
 				y = 0;
 				i += len - 1;
@@ -1208,7 +1216,7 @@
 	if (y)
 	{
 		buf2[y] = 0;
-		gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
+		gtk_html_append_text(GTK_HTML(html), buf2, gtk_font_options);
 	}
 	g_free(buf2);
 }
@@ -1226,6 +1234,14 @@
 	char *clr;
 	char *smiley = g_malloc(7);
 	struct buddy *b;
+	int gtk_font_options = 0;
+			
+	if (display_options & OPT_DISP_IGNORE_COLOUR)	
+		gtk_font_options = gtk_font_options ^ HTML_OPTION_NO_COLOURS;
+
+	if (display_options & OPT_DISP_IGNORE_FONTS) 
+		gtk_font_options = gtk_font_options ^ HTML_OPTION_NO_FONTS;
+
 
 	if (!who) {
 		if (flags & WFLAG_SEND) {
@@ -1330,7 +1346,7 @@
 
 		if (colorv != -1) {
 			sprintf(buf2, "<BODY BGCOLOR=\"#%x\">", colorv);
-			gtk_html_append_text(GTK_HTML(c->text), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
+			gtk_html_append_text(GTK_HTML(c->text), buf2, gtk_font_options);
 		}
 
 		gtk_html_append_text(GTK_HTML(c->text), buf, 0);
@@ -1341,13 +1357,13 @@
 		}
 		else
 		{
-			gtk_html_append_text(GTK_HTML(c->text), what, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
+			gtk_html_append_text(GTK_HTML(c->text), what, gtk_font_options);
 		}
 
 		if (colorv != -1) {
-			gtk_html_append_text(GTK_HTML(c->text), "</BODY>", (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
+			gtk_html_append_text(GTK_HTML(c->text), "</BODY>", gtk_font_options);
 		}
-                gtk_html_append_text(GTK_HTML(c->text), "<BR>", (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0);
+                gtk_html_append_text(GTK_HTML(c->text), "<BR>", gtk_font_options);
 
 
                 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) {
--- a/src/gaim.h	Tue Dec 12 22:52:01 2000 +0000
+++ b/src/gaim.h	Tue Dec 12 23:09:07 2000 +0000
@@ -469,6 +469,7 @@
 #define OPT_DISP_CONV_BUTTON_XPM  0x00080000
 #define OPT_DISP_CHAT_BUTTON_XPM  0x00100000
 #define OPT_DISP_SHOW_WARN        0x00200000
+#define OPT_DISP_IGNORE_FONTS     0x00400000
 
 extern int sound_options;
 #define OPT_SOUND_LOGIN          0x00000001
--- a/src/gtkhtml.c	Tue Dec 12 22:52:01 2000 +0000
+++ b/src/gtkhtml.c	Tue Dec 12 23:09:07 2000 +0000
@@ -3471,7 +3471,10 @@
 							}
 							if (d[strlen(d) - 1] == '\"')
 								d[strlen(d) - 1] = 0;
-							strcpy(current->font, d);
+
+							if (!(options & HTML_OPTION_NO_FONTS)) { 
+								strcpy(current->font, d);
+							}
 						}
 						else if (!strncasecmp(d, "BACK=", strlen("BACK=")))
 						{
--- a/src/prefs.c	Tue Dec 12 22:52:01 2000 +0000
+++ b/src/prefs.c	Tue Dec 12 23:09:07 2000 +0000
@@ -245,6 +245,7 @@
 	gaim_button(_("Show graphical smileys"), &display_options, OPT_DISP_SHOW_SMILEY, box);
 	gaim_button(_("Show timestamp on messages"), &display_options, OPT_DISP_SHOW_TIME, box);
 	gaim_button(_("Ignore incoming colors"), &display_options, OPT_DISP_IGNORE_COLOUR, box);
+	gaim_button(_("Ignore incoming fonts"), &display_options, OPT_DISP_IGNORE_FONTS, box);
 	gaim_button(_("Ignore white backgrounds"), &display_options, OPT_DISP_IGN_WHITE, box);
 
 	sep = gtk_hseparator_new();