CVS: sylpheed-claws/src/gtk logwindow.c,1.1.4.14,1.1.4.15 logwindow.h,1.1.4.3,1.1.4.4

Colin Leroy <[email protected]>
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /cvsroot/sylpheed-claws/sylpheed-claws/src/gtk
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3368/src/gtk

Modified Files:
      Tag: gtk2
	logwindow.c logwindow.h 
Log Message:
2006-04-23 [colin]	2.1.1cvs23

	* src/etpan/imap-thread.c
		Better logging (line-per-line, hide data in fetch)
		Fix a const warning
	* src/gtk/logwindow.c
	* src/gtk/logwindow.h
		Better logging (color for input/output)

Index: logwindow.c
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/gtk/logwindow.c,v
retrieving revision 1.1.4.14
retrieving revision 1.1.4.15
diff -u -r1.1.4.14 -r1.1.4.15
--- logwindow.c	13 Jan 2006 17:24:20 -0000	1.1.4.14
+++ logwindow.c	23 Apr 2006 11:30:37 -0000	1.1.4.15
@@ -138,26 +138,30 @@
 {
 	GtkTextBuffer *buffer;
 	GdkColormap *colormap;
-	GdkColor color[3] =
-		{{0, 0, 0xafff, 0}, {0, 0xefff, 0, 0}, {0, 0xefff, 0, 0}};
-	gboolean success[3];
+	GdkColor color[5] =
+		{{0, 0, 0xafff, 0}, {0, 0xefff, 0, 0}, {0, 0xefff, 0, 0},
+		  {0, 0, 0, 0}, {0, 0, 0, 0xefff}};
+	gboolean success[5];
 	gint i;
 
 	logwin->msg_color   = color[0];
 	logwin->warn_color  = color[1];
 	logwin->error_color = color[2];
+	logwin->in_color    = color[3];
+	logwin->out_color   = color[4];
 
 	colormap = gdk_drawable_get_colormap(logwin->window->window);
-	gdk_colormap_alloc_colors(colormap, color, 3, FALSE, TRUE, success);
+	gdk_colormap_alloc_colors(colormap, color, 5, FALSE, TRUE, success);
 
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < 5; i++) {
 		if (success[i] == FALSE) {
 			GtkStyle *style;
 
 			g_warning("LogWindow: color allocation failed\n");
 			style = gtk_widget_get_style(logwin->window);
 			logwin->msg_color = logwin->warn_color =
-			logwin->error_color = style->black;
+			logwin->error_color = logwin->in_color =
+			logwin->out_color = style->black;
 			break;
 		}
 	}
@@ -172,6 +176,12 @@
 	gtk_text_buffer_create_tag(buffer, "error",
 				   "foreground-gdk", &logwin->error_color,
 				   NULL);
+	gtk_text_buffer_create_tag(buffer, "input",
+				   "foreground-gdk", &logwin->in_color,
+				   NULL);
+	gtk_text_buffer_create_tag(buffer, "output",
+				   "foreground-gdk", &logwin->out_color,
+				   NULL);
 }
 
 void log_window_show(LogWindow *logwin)
@@ -201,7 +211,6 @@
 	GtkTextView *text;
 	GtkTextBuffer *buffer;
 	GtkTextIter iter;
-	GdkColor *color = NULL;
 	gchar *head = NULL;
 	const gchar *tag;
 
@@ -218,17 +227,14 @@
 
 	switch (logtext->type) {
 	case LOG_MSG:
-		color = &logwindow->msg_color;
 		tag = "message";
 		head = "* ";
 		break;
 	case LOG_WARN:
-		color = &logwindow->warn_color;
 		tag = "warn";
 		head = "** ";
 		break;
 	case LOG_ERROR:
-		color = &logwindow->error_color;
 		tag = "error";
 		head = "*** ";
 		break;
@@ -237,6 +243,17 @@
 		break;
 	}
   
+	if (tag == NULL) {
+		if (strstr(logtext->text, "] POP3>")
+		||  strstr(logtext->text, "] IMAP4>")
+		||  strstr(logtext->text, "] NNTP>"))
+			tag = "output";
+		if (strstr(logtext->text, "] POP3<")
+		||  strstr(logtext->text, "] IMAP4<")
+		||  strstr(logtext->text, "] NNTP<"))
+			tag = "input";
+	}
+
 	if (head)
 		gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, head, -1,
 							 tag, NULL);

Index: logwindow.h
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/gtk/logwindow.h,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.4
diff -u -r1.1.4.3 -r1.1.4.4
--- logwindow.h	13 Jan 2006 17:24:21 -0000	1.1.4.3
+++ logwindow.h	23 Apr 2006 11:30:37 -0000	1.1.4.4
@@ -34,6 +34,8 @@
 	GdkColor msg_color;
 	GdkColor warn_color;
 	GdkColor error_color;
+	GdkColor in_color;
+	GdkColor out_color;
 
 	gboolean clip;
 	guint	 clip_length;



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.