diff console/libgnt/gntmain.c @ 14004:06f75fb84a78

[gaim-migrate @ 16589] Add a configure file (~/.gntrc) for gnt to configure its looks. This is available only for GLib 2.6 and above. Currently, it only allows changing the colors (r;g;b -- each in [0, 1000]) and color-groups. I have added gntrc.sample as an example. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 28 Jul 2006 04:47:19 +0000
parents b7a99d54a5a9
children 7573bd40a190
line wrap: on
line diff
--- a/console/libgnt/gntmain.c	Thu Jul 27 20:11:55 2006 +0000
+++ b/console/libgnt/gntmain.c	Fri Jul 28 04:47:19 2006 +0000
@@ -2,8 +2,9 @@
 
 #include "gnt.h"
 #include "gntbox.h"
+#include "gntcolors.h"
 #include "gntkeys.h"
-#include "gntcolors.h"
+#include "gntstyle.h"
 #include "gnttree.h"
 
 #include <stdio.h>
@@ -57,6 +58,8 @@
 
 	if (lock_focus_list)
 		return;
+	if (g_list_find(g_list_first(focus_list), widget))
+		return;
 
 	if (focus_list)
 		w = focus_list->data;
@@ -525,6 +528,7 @@
 void gnt_init()
 {
 	static GIOChannel *channel = NULL;
+	char *filename;
 	
 	if (channel)
 		return;
@@ -548,6 +552,10 @@
 	initscr();
 	gnt_init_colors();
 
+	filename = g_build_filename(g_get_home_dir(), ".gntrc", NULL);
+	gnt_style_read_configure_file(filename);
+	g_free(filename);
+
 	X_MIN = 0;
 	Y_MIN = 0;
 	X_MAX = getmaxx(stdscr);