diff src/util.c @ 5545:7a64114641c3

[gaim-migrate @ 5946] I've been rewriting the prefs to move from gaimrc to prefs.xml. This will NOT compile! I don't want to see complaints about this, as it's CVS, and you should only be using it if you can put up with things like this. Also, don't ask how long it'll take until it compiles again. It may be several days. This is a big migration. Even when it works, it may not run right. However, it's made a lot of progress, and I plan to actively work on it today and tomorrow. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 29 May 2003 19:10:24 +0000
parents 6f35b80c5ffa
children 9eb5b13fd412
line wrap: on
line diff
--- a/src/util.c	Thu May 29 17:35:28 2003 +0000
+++ b/src/util.c	Thu May 29 19:10:24 2003 +0000
@@ -45,6 +45,7 @@
 #include <math.h>
 #include "gaim.h"
 #include "prpl.h"
+#include "prefs.h"
 
 #ifndef _WIN32
 #include <sys/socket.h>
@@ -654,45 +655,63 @@
 	buf = g_malloc(length);
 	g_snprintf(buf, length, "%s", text);
 
-	if (font_options & OPT_FONT_BOLD) {
+	if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_bold")) {
 		g_snprintf(tmp, length, "<B>%s</B>", buf);
 		strcpy(buf, tmp);
 	}
 
-	if (font_options & OPT_FONT_ITALIC) {
+	if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_italic")) {
 		g_snprintf(tmp, length, "<I>%s</I>", buf);
 		strcpy(buf, tmp);
 	}
 
-	if (font_options & OPT_FONT_UNDERLINE) {
+	if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_underline")) {
 		g_snprintf(tmp, length, "<U>%s</U>", buf);
 		strcpy(buf, tmp);
 	}
 
-	if (font_options & OPT_FONT_STRIKE) {
+	if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_strikethrough")) {
 		g_snprintf(tmp, length, "<S>%s</S>", buf);
 		strcpy(buf, tmp);
 	}
 
-	if (font_options & OPT_FONT_FACE) {
+	if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_font")) {
+		const char *fontface;
+
+		fontface = gaim_prefs_get_string("/gaim/gtk/conversations/font_face");
+
 		g_snprintf(tmp, length, "<FONT FACE=\"%s\">%s</FONT>", fontface, buf);
 		strcpy(buf, tmp);
 	}
 
-	if (font_options & OPT_FONT_SIZE) {
+	if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_size")) {
+		int fontsize = gaim_prefs_get_int("/gaim/gtk/conversations/font_size");
+
 		g_snprintf(tmp, length, "<FONT SIZE=\"%d\">%s</FONT>", fontsize, buf);
 		strcpy(buf, tmp);
 	}
 
-	if (font_options & OPT_FONT_FGCOL) {
-		g_snprintf(tmp, length, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>", fgcolor.red/256,
-			   fgcolor.green/256, fgcolor.blue/256, buf);
+	if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_fgcolor")) {
+		GdkColor fgcolor;
+
+		gdk_color_parse(
+			gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"),
+			&fgcolor);
+
+		g_snprintf(tmp, length, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>",
+				   fgcolor.red/256, fgcolor.green/256, fgcolor.blue/256, buf);
 		strcpy(buf, tmp);
 	}
 
-	if (font_options & OPT_FONT_BGCOL) {
-		g_snprintf(tmp, length, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>", bgcolor.red/256,
-			   bgcolor.green/256, bgcolor.blue/256, buf);
+	if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_bgcolor")) {
+		GdkColor bgcolor;
+
+		gdk_color_parse(
+			gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"),
+			&bgcolor);
+
+		g_snprintf(tmp, length, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>",
+				   bgcolor.red/256, bgcolor.green/256, bgcolor.blue/256, buf);
 		strcpy(buf, tmp);
 	}