Index: gnect/src/theme.c
===================================================================
--- gnect/src/theme.c	(revision 7635)
+++ gnect/src/theme.c	(working copy)
@@ -26,6 +26,8 @@
 
 #include "config.h"
 #include <gnome.h>
+#include <string.h>
+#include <confuse.h>
 #include "main.h"
 #include "theme.h"
 #include "prefs.h"
@@ -35,68 +37,57 @@
 
 
 extern Prefs p;
+Theme *theme;
+gint n_themes = 0;
 
+void configThemes()
+{
+	cfg_opt_t theme_opts[] =
+	{
+		CFG_STR("name","name",CFGF_NONE),
+		CFG_STR("tileset","name",CFGF_NONE),
+		CFG_STR("bgimage","name",CFGF_NONE),
+		CFG_STR("color","name",CFGF_NONE),
+		CFG_STR("gridstyle","name",CFGF_NONE),
+		CFG_STR("playercolor","name",CFGF_NONE),
+		CFG_STR("cpucolor","name",CFGF_NONE),
+		CFG_END()
+	};
+	cfg_opt_t opts[] =
+	{
+		CFG_SEC("theme", theme_opts, CFGF_TITLE | CFGF_MULTI),
+		CFG_END()
+	};
+	
+	cfg_t *cfg, *cfg_theme;
+	int i;
+	
+	cfg = cfg_init(opts, CFGF_NONE);
+	if(cfg_parse(cfg, "gnect.conf") == CFG_PARSE_ERROR)
+		return;
+	
+	n_themes = cfg_size(cfg, "theme");           
+	printf("n_themes:%d\n",n_themes);
+	
 
-Theme theme[] = {
-  {
-   N_("Classic"),
-   "tileset_50x50_sunspot.svg",
-   NULL,
-   "#9999CC",
-   DEFAULT_GRID_STYLE,
-   N_("Red"), N_("Yellow")
-   },
-  {
-   N_("High Contrast"),
-   "tileset_50x50_hcontrast.svg",
-   NULL,
-   "#000000",
-   DEFAULT_GRID_STYLE,
-   N_("Light"), N_("Dark")
-   },
-  {
-   N_("High Contrast Inverse"),
-   "tileset_50x50_hcinverse.svg",
-   NULL,
-   "#FFFFFF",
-   DEFAULT_GRID_STYLE,
-   N_("Light"), N_("Dark")
-   },
-  {
-   N_("Cream Marbles"),
-   "tileset_50x50_catseyes.png",
-   "bg_toplight.png",
-   "#727F8C",
-   DEFAULT_GRID_STYLE,
-   N_("Red"), N_("Blue")
-   },
-  {
-   N_("Glass Marbles"),
-   "tileset_50x50_glassy.png",
-   "bg_grotty.jpg",
-   "#727F8C",
-   DEFAULT_GRID_STYLE,
-   N_("Red"), N_("Blue")
-   },
-  {
-   N_("Nightfall"),
-   "tileset_50x50_glassy.png",
-   "bg_nightfall.jpg",
-   "#727F8C",
-   DEFAULT_GRID_STYLE,
-   N_("Red"), N_("Yellow")
-   },
-  {
-   N_("Blocks"),
-   "tileset_50x50_square.png",
-   NULL,
-   "#666666",
-   DEFAULT_GRID_STYLE,
-   N_("Orange"), N_("Blue")
-   }
-};
+	theme = malloc(sizeof(Theme)*n_themes);
+	
+	for(i = 0; i < n_themes; i++)
+	{
+		cfg_theme = cfg_getnsec(cfg, "theme", i);
+		printf("title: %s\n",theme[i].title = cfg_title(cfg_theme));
+		printf("tileset: %s\n",theme[i].fname_tileset = cfg_getstr(cfg_theme, "tileset"));
+		printf("bgimage: --%s--\n",theme[i].fname_bground = cfg_getstr(cfg_theme, "bgimage"));
+		if(strcmp(theme[i].fname_bground,"NULL")==0)
+			theme[i].fname_bground = NULL;
+		printf("color: %s\n",theme[i].grid_rgb = cfg_getstr(cfg_theme, "color"));
+		printf("gridstyle: %d\n",theme[i].grid_style = DEFAULT_GRID_STYLE);/* cfg_getstr(cfg_theme, "gridstyle");*/
+		printf("playercolor: %s\n",theme[i].player1 = cfg_getstr(cfg_theme, "playercolor"));
+		printf("cpucolor: %s\n",theme[i].player2 = cfg_getstr(cfg_theme, "cpucolor"));         
+	}
+	    printf("theme[0].fname_tileset: %s\n",theme[0].fname_tileset);
+}
 
-gint n_themes = G_N_ELEMENTS (theme);
 
 
 
Index: gnect/src/theme.h
===================================================================
--- gnect/src/theme.h	(revision 7635)
+++ gnect/src/theme.h	(working copy)
@@ -1,14 +1,14 @@
 /* theme.h */
 
+void configThemes();
 
-
 typedef struct _Theme Theme;
 struct _Theme {
   const gchar *title;
   const gchar *fname_tileset;
   const gchar *fname_bground;
   const gchar *grid_rgb;
-  const GdkLineStyle grid_style;
+  /* const */ GdkLineStyle grid_style;
   const gchar *player1;
   const gchar *player2;
 };
Index: gnect/src/prefs.c
===================================================================
--- gnect/src/prefs.c	(revision 7635)
+++ gnect/src/prefs.c	(working copy)
@@ -49,7 +49,7 @@
 Prefs p;
 
 extern GtkWidget *app;
-extern Theme theme[];
+extern Theme *theme;
 extern gint n_themes;
 
 static GtkWidget *prefsbox = NULL;
Index: gnect/src/gfx.c
===================================================================
--- gnect/src/gfx.c	(revision 7635)
+++ gnect/src/gfx.c	(working copy)
@@ -33,7 +33,7 @@
 
 
 extern Prefs p;
-extern Theme theme[];
+extern Theme *theme;
 extern gint gboard[7][7];
 extern GtkWidget *app;
 extern GtkWidget *drawarea;
Index: gnect/src/main.c
===================================================================
--- gnect/src/main.c	(revision 7635)
+++ gnect/src/main.c	(working copy)
@@ -1482,6 +1482,8 @@
 {
   GnomeProgram *program;
   GOptionContext *context;
+  
+  configThemes();
 
   bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
Index: gnect/src/Makefile.am
===================================================================
--- gnect/src/Makefile.am	(revision 7635)
+++ gnect/src/Makefile.am	(working copy)
@@ -61,6 +61,7 @@
 		$(GGZ_FILES)
 
 INCLUDES = -I.. \
+	-I/usr/include \
 	-I$(top_srcdir)/libgames-support                \
 	-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
 	-DDATADIR=\""$(datadir)"\"         \
@@ -74,4 +75,5 @@
 	$(GNOME_GAMES_LIBS)     \
 	$(INTLLIBS) \
 	$(LIB_GGZMOD) \
-	$(LIB_GGZ_GTK)
+	$(LIB_GGZ_GTK) \
+	-L/usr/lib -lconfuse
