[gnome-mud] Profile patch



This patch changes the way profiles are stored in gconf, and modifies
some other code to match.  

No ChangeLog as yet, I'm still planning on ironing out a few bugs before
the completed patch.  Sending on Jordi's request, in case I suddenly get
removed from the world of the living.  Stay tuned.

-- 
Daniel Patton <seven-nation army com>
? po/stamp-it
? src/less
Index: gnome-mud.schemas.in
===================================================================
RCS file: /cvs/gnome/gnome-mud/gnome-mud.schemas.in,v
retrieving revision 1.24
diff -u -r1.24 gnome-mud.schemas.in
--- gnome-mud.schemas.in	27 Dec 2005 12:45:22 -0000	1.24
+++ gnome-mud.schemas.in	23 Feb 2006 11:16:50 -0000
@@ -2,8 +2,8 @@
 	<schemalist>
 		<!-- user interface settings -->
 		<schema>
-			<key>/schemas/apps/gnome-mud/ui/font</key>
-			<applyto>/apps/gnome-mud/ui/font</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/font</key>
+			<applyto>/apps/gnome-mud/profiles/Default/font</applyto>
 			<owner>gnome-mud</owner>
 			<type>string</type>
 			<default>monospace 12</default>
@@ -17,8 +17,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/ui/background_color</key>
-			<applyto>/apps/gnome-mud/ui/background_color</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/background_color</key>
+			<applyto>/apps/gnome-mud/profiles/Default/background_color</applyto>
 			<owner>gnome-mud</owner>
 			<type>string</type>
 			<default>#000000</default>
@@ -33,8 +33,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/ui/foreground_color</key>
-			<applyto>/apps/gnome-mud/ui/foreground_color</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/foreground_color</key>
+			<applyto>/apps/gnome-mud/profiles/Default/foreground_color</applyto>
 			<owner>gnome-mud</owner>
 			<type>string</type>
 			<default>#FFFFDD</default>
@@ -49,8 +49,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/ui/palette</key>
-			<applyto>/apps/gnome-mud/ui/palette</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/palette</key>
+			<applyto>/apps/gnome-mud/profiles/Default/palette</applyto>
 			<owner>gnome-mud</owner>
 			<type>string</type>
 			<default>#000000:#AA0000:#00AA00:#AA5500:#0000AA:#AA00AA:#00AAAA:#AAAAAA:#555555:#FF5555:#55FF55:#FFFF55:#5555FF:#FF55FF:#55FFFF:#FFFFFF</default>
@@ -67,8 +67,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/ui/tab_location</key>
-			<applyto>/apps/gnome-mud/ui/tab_location</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/tab_location</key>
+			<applyto>/apps/gnome-mud/profiles/Default/tab_location</applyto>
 			<owner>gnome-mud</owner>
 			<type>string</type>
 			<default>bottom</default>
@@ -83,8 +83,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/ui/scrollback_lines</key>
-			<applyto>/apps/gnome-mud/ui/scrollback_lines</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/scrollback_lines</key>
+			<applyto>/apps/gnome-mud/profiles/Default/scrollback_lines</applyto>
 			<owner>gnome-mud</owner>
 			<type>int</type>
 			<default>500</default>
@@ -101,8 +101,8 @@
 	
 		<!-- functionality settings -->
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/commdev</key>
-			<applyto>/apps/gnome-mud/functionality/commdev</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/commdev</key>
+			<applyto>/apps/gnome-mud/profiles/Default/commdev</applyto>
 			<owner>gnome-mud</owner>
 			<type>string</type>
 			<default>;</default>
@@ -117,8 +117,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/echo</key>
-			<applyto>/apps/gnome-mud/functionality/echo</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/echo</key>
+			<applyto>/apps/gnome-mud/profiles/Default/echo</applyto>
 			<owner>gnome-mud</owner>
 			<type>bool</type>
 			<default>true</default>
@@ -133,8 +133,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/keeptext</key>
-			<applyto>/apps/gnome-mud/functionality/keeptext</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/keeptext</key>
+			<applyto>/apps/gnome-mud/profiles/Default/keeptext</applyto>
 			<owner>gnome-mud</owner>
 			<type>bool</type>
 			<default>false</default>
@@ -150,8 +150,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/system_keys</key>
-			<applyto>/apps/gnome-mud/functionality/system_keys</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/system_keys</key>
+			<applyto>/apps/gnome-mud/profiles/Default/system_keys</applyto>
 			<owner>gnome-mud</owner>
 			<type>bool</type>
 			<default>false</default>
@@ -167,8 +167,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/terminal_type</key>
-			<applyto>/apps/gnome-mud/functionality/terminal_type</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/terminal_type</key>
+			<applyto>/apps/gnome-mud/profiles/Default/terminal_type</applyto>
 			<owner>gnome-mud</owner>
 			<type>string</type>
 			<default>xterm</default>
@@ -184,8 +184,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/mudlist_file</key>
-			<applyto>/apps/gnome-mud/functionality/mudlist_file</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/mudlist_file</key>
+			<applyto>/apps/gnome-mud/profiles/Default/mudlist_file</applyto>
 			<owner>gnome-mud</owner>
 			<type>string</type>
 			<default></default>
@@ -199,8 +199,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/scroll_on_output</key>
-			<applyto>/apps/gnome-mud/functionality/scroll_on_output</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/scroll_on_output</key>
+			<applyto>/apps/gnome-mud/profiles/Default/scroll_on_output</applyto>
 			<owner>gnome-mud</owner>
 			<type>bool</type>
 			<default>false</default>
@@ -214,8 +214,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/history_count</key>
-			<applyto>/apps/gnome-mud/functionality/history_count</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/history_count</key>
+			<applyto>/apps/gnome-mud/profiles/Default/history_count</applyto>
 			<owner>gnome-mud</owner>
 			<type>int</type>
 			<default>10</default>
@@ -229,8 +229,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/last_log_dir</key>
-			<applyto>/apps/gnome-mud/functionality/last_log_dir</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/last_log_dir</key>
+			<applyto>/apps/gnome-mud/profiles/Default/last_log_dir</applyto>
 			<owner>gnome-mud</owner>
 			<type>string</type>
 			<default></default>
@@ -244,8 +244,8 @@
 		</schema>
 
 		<schema>
-			<key>/schemas/apps/gnome-mud/functionality/flush_interval</key>
-			<applyto>/apps/gnome-mud/functionality/flush_interval</applyto>
+			<key>/schemas/apps/gnome-mud/profiles/Default/flush_interval</key>
+			<applyto>/apps/gnome-mud/profiles/Default/flush_interval</applyto>
 			<owner>gnome-mud</owner>
 			<type>int</type>
 			<default>30</default>
Index: src/gconf-helper.c
===================================================================
RCS file: /cvs/gnome/gnome-mud/src/gconf-helper.c,v
retrieving revision 1.3
diff -u -r1.3 gconf-helper.c
--- src/gconf-helper.c	11 Jan 2006 00:43:27 -0000	1.3
+++ src/gconf-helper.c	23 Feb 2006 11:16:50 -0000
@@ -21,29 +21,12 @@
 	struct    stat file_stat;
 	gchar     dirname[256], buf[256];
 	gchar    *p = NULL;
-	gchar     extra_path[512] = "", keyname[2048];
+	gchar    keyname[2048];
 	
 	gconf_client = gconf_client_get_default();
 	prefs = profile->preferences;
 
-	if (strcmp(profile->name, "Default"))
-	{
-		GError *error = NULL;
-		
-		/* Sanity check for whether profile has data or not */
-		g_snprintf(keyname, 2048, "/apps/gnome-mud/profiles/%s/functionality/terminal_type", profile->name);
-		p = gconf_client_get_string(gconf_client, keyname, &error);
-		if (error || p == NULL)
-		{
-			g_message("Error getting data for profile %s, using default instead.", profile->name);
-			mud_profile_copy_preferences(mud_profile_new("Default"), profile);
-		}
-		else
-		{	
-			g_snprintf(extra_path, 512, "profiles/%s/", profile->name);
-		}
-	}
-
+	g_message("Loading profile %s...", profile->name);
 	
 	/*
 	 * Check for ~/.gnome-mud
@@ -54,6 +37,7 @@
 		if ( !(S_ISDIR(file_stat.st_mode))) /* if it's not a directory */
 		{
 			g_snprintf (buf, 255, _("%s already exists and is not a directory!"), dirname);
+			g_message("%s", buf);
 			//popup_window (buf); FIXME
 			return;
 		}
@@ -63,49 +47,50 @@
 		if ((mkdir (dirname, 0777)) != 0) /* this isn't dangerous, umask modifies it */
 		{
 			g_snprintf (buf, 255, _("%s does not exist and can NOT be created: %s"), dirname, strerror(errno));
+			g_print("%s", buf);
 			//popup_window (buf); FIXME
 			return;
 		}
 	}
 
-#define	GCONF_GET_STRING(entry, subdir, variable)                                          \
-	g_snprintf(keyname, 2048, "/apps/gnome-mud/%s" #subdir "/" #entry, extra_path); \
-	p = gconf_client_get_string(gconf_client, keyname, NULL);\
+#define	GCONF_GET_STRING(entry, variable)                                                  \
+	g_snprintf(keyname, 2048, "/apps/gnome-mud/profiles/%s/%s", profile->name, entry); \
+	p = gconf_client_get_string(gconf_client, keyname, NULL);                          \
 	prefs->variable = g_strdup(p);
 
-#define GCONF_GET_BOOLEAN(entry, subdir, variable)                                         \
-	g_snprintf(keyname, 2048, "/apps/gnome-mud/%s" #subdir "/" #entry, extra_path); \
+#define GCONF_GET_BOOLEAN(entry, variable)                                                 \
+	g_snprintf(keyname, 2048, "/apps/gnome-mud/profiles/%s/%s", profile->name, entry); \
 	prefs->variable = gconf_client_get_bool(gconf_client, keyname, NULL);
 
-#define GCONF_GET_INT(entry, subdir, variable)                                             \
-	g_snprintf(keyname, 2048, "/apps/gnome-mud/%s" #subdir "/" #entry, extra_path); \
+#define GCONF_GET_INT(entry, variable)                                                     \
+	g_snprintf(keyname, 2048, "/apps/gnome-mud/profiles/%s/%s", profile->name, entry); \
 	prefs->variable = gconf_client_get_int(gconf_client, keyname, NULL);
 	
-#define GCONF_GET_COLOR(entry, subdir, variable)                                           \
-	g_snprintf(keyname, 2048, "/apps/gnome-mud/%s" #subdir "/" #entry, extra_path); \
-	p = gconf_client_get_string(gconf_client, keyname, NULL);\
-	if (p && gdk_color_parse(p, &color))                                                   \
-	{                                                                                      \
-		prefs->variable = color;                                                            \
+#define GCONF_GET_COLOR(entry, variable)                                                   \
+	g_snprintf(keyname, 2048, "/apps/gnome-mud/profiles/%s/%s", profile->name, entry); \
+	p = gconf_client_get_string(gconf_client, keyname, NULL);                          \
+	if (p && gdk_color_parse(p, &color))                                               \
+	{                                                                                  \
+		prefs->variable = color;                                                   \
 	}
 
-	GCONF_GET_STRING(font, 				ui,				FontName); 
-	GCONF_GET_COLOR(foreground_color,	ui,				Foreground);
-	GCONF_GET_COLOR(background_color,	ui,				Background);
-	GCONF_GET_INT(scrollback_lines,		ui,				Scrollback);
-	GCONF_GET_STRING(tab_location,		ui,				TabLocation);
-	GCONF_GET_STRING(commdev, 			functionality,	CommDev);
-	GCONF_GET_BOOLEAN(echo,     		functionality,	EchoText);
-	GCONF_GET_BOOLEAN(keeptext,			functionality,	KeepText);
-	GCONF_GET_BOOLEAN(system_keys,		functionality,	DisableKeys);
-	GCONF_GET_STRING(terminal_type,		functionality,	TerminalType);
-	GCONF_GET_STRING(mudlist_file,		functionality,	MudListFile);
-	GCONF_GET_BOOLEAN(scroll_on_output,	functionality,	ScrollOnOutput);
-	GCONF_GET_INT(history_count,		functionality,	History);
-	GCONF_GET_INT(flush_interval,		functionality,	FlushInterval);
+        GCONF_GET_STRING("font", 		FontName); 
+	GCONF_GET_COLOR("foreground_color",	Foreground);
+	GCONF_GET_COLOR("background_color",	Background);
+	GCONF_GET_INT("scrollback_lines",	Scrollback);
+	GCONF_GET_STRING("tab_location",	TabLocation);
+	GCONF_GET_STRING("commdev", 		CommDev);
+	GCONF_GET_BOOLEAN("echo",     		EchoText);
+	GCONF_GET_BOOLEAN("keeptext",		KeepText);
+	GCONF_GET_BOOLEAN("system_keys",	DisableKeys);
+	GCONF_GET_STRING("terminal_type",	TerminalType);
+	GCONF_GET_STRING("mudlist_file",	MudListFile);
+	GCONF_GET_BOOLEAN("scroll_on_output",	ScrollOnOutput);
+	GCONF_GET_INT("history_count",		History);
+	GCONF_GET_INT("flush_interval",		FlushInterval);
 		
 	/* palette */
-	g_snprintf(keyname, 2048, "/apps/gnome-mud/%sui/palette", extra_path);
+	g_snprintf(keyname, 2048, "/apps/gnome-mud/profiles/%s/palette", profile->name);
 	p = gconf_client_get_string(gconf_client, keyname, NULL);
 
 	if (p)
@@ -123,7 +108,7 @@
 	}
 
 	/* last log dir */
-	g_snprintf(keyname, 2048, "/apps/gnome-mud/%sfunctionality/last_log_dir", extra_path);
+	g_snprintf(keyname, 2048, "/apps/gnome-mud/profiles/%s/last_log_dir", profile->name);
 	p = gconf_client_get_string(gconf_client, keyname, NULL);
 
 	if (p == NULL || !g_ascii_strncasecmp(p, "", sizeof("")))
Index: src/gnome-mud.c
===================================================================
RCS file: /cvs/gnome/gnome-mud/src/gnome-mud.c,v
retrieving revision 1.21
diff -u -r1.21 gnome-mud.c
--- src/gnome-mud.c	5 Jan 2006 19:42:09 -0000	1.21
+++ src/gnome-mud.c	23 Feb 2006 11:16:51 -0000
@@ -109,7 +109,8 @@
 	
 	/* Start a GConf client */
 	gconf_client = gconf_client_get_default();
-	if (!gconf_sanity_check_string (gconf_client, "/apps/gnome-mud/functionality/terminal_type")) {
+	// FIXME:  Use profile
+	if (!gconf_sanity_check_string (gconf_client, "/apps/gnome-mud/profiles/Default/terminal_type")) {
 		return 1;
 	}
 	gconf_client_add_dir(gconf_client, "/apps/gnome-mud", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
Index: src/mud-profile.c
===================================================================
RCS file: /cvs/gnome/gnome-mud/src/mud-profile.c,v
retrieving revision 1.4
diff -u -r1.4 mud-profile.c
--- src/mud-profile.c	5 Jan 2006 19:42:09 -0000	1.4
+++ src/mud-profile.c	23 Feb 2006 11:16:51 -0000
@@ -161,6 +161,7 @@
 	GConfClient *client;
 	
 
+	if (!strcmp(name, "Default")) return;
 	client = gconf_client_get_default();
 	
 	rementry = NULL;
@@ -210,7 +211,7 @@
 		if (!strcmp(name, "Default"))
 		{
 			gconf_client_notify_add(profile->priv->gconf_client,
-						"/apps/gnome-mud", 
+						"/apps/gnome-mud/profiles/Default", 
 						mud_profile_gconf_changed,
 						profile, NULL, NULL);
 		}
@@ -251,7 +252,9 @@
 static gboolean
 set_TerminalType(MudProfile *profile, const gchar *candidate)
 {
-	if (candidate && strcmp(profile->priv->preferences.TerminalType, candidate) == 0)
+	if (candidate && 
+	    profile->priv->preferences.TerminalType != NULL && 
+	    strcmp(profile->priv->preferences.TerminalType, candidate) == 0)
 		return FALSE;
 
 	if (candidate != NULL)
@@ -333,7 +336,9 @@
 static gboolean
 set_FontName(MudProfile *profile, const gchar *candidate)
 {
-	if (candidate && strcmp(profile->priv->preferences.FontName, candidate) == 0)
+	if (candidate && 
+	    profile->priv->preferences.FontName != NULL && 
+	    strcmp(profile->priv->preferences.FontName, candidate) == 0)
 		return FALSE;
 
 	if (candidate != NULL)
@@ -349,7 +354,9 @@
 static gboolean
 set_CommDev(MudProfile *profile, const gchar *candidate)
 {
-	if (candidate && strcmp(profile->priv->preferences.CommDev, candidate) == 0)
+	if (candidate && 
+	    profile->priv->preferences.CommDev != NULL && 
+	    strcmp(profile->priv->preferences.CommDev, candidate) == 0)
 		return FALSE;
 	
 	if (candidate != NULL)
@@ -394,14 +401,8 @@
 mud_profile_gconf_get_key(MudProfile *profile, const gchar *key)
 {
 	static gchar buf[2048];
-	gchar extra_path[512] = "";
 
-	if (strcmp(profile->name, "Default"))
-	{
-		g_snprintf(extra_path, 512, "profiles/%s/", profile->name);
-	}
-
-	g_snprintf(buf, 2048, "/apps/gnome-mud/%s%s", extra_path, key);
+	g_snprintf(buf, 2048, "/apps/gnome-mud/profiles/%s/%s", profile->name, key);
 
 	return buf;
 }
@@ -446,13 +447,12 @@
 #define UPDATE_STRING(KName, FName, Preset)         \
 	}                                               \
 else if (strcmp(key, KName) == 0)                   \
-	{                                               \
+	{        \
 		const gchar *setting = (Preset);            \
 			                                        \
 		if (val && val->type == GCONF_VALUE_STRING) \
 			setting = gconf_value_get_string(val);  \
-			                                        \
-		mask.FName = set_##FName(profile, setting);
+		mask.FName = set_##FName(profile, setting); 
 #define UPDATE_INTEGER(KName, FName, Preset)        \
 	}                                               \
 else if (strcmp(key, KName) == 0)                   \
@@ -482,7 +482,6 @@
 		UPDATE_STRING("background_color",	Background,		"#000000");
 		UPDATE_STRING("palette",			Colors,			"#000000:#AA0000:#00AA00:#AA5500:#0000AA:#AA00AA:#00AAAA:#AAAAAA:#555555:#FF5555:#55FF55:#FFFF55:#5555FF:#FF55FF:#55FFFF:#FFFFFF");
 	}
-	
 #undef UPDATE_BOOLEAN
 #undef UPDATE_STRING
 #undef UPDATE_INTEGER
@@ -492,7 +491,7 @@
 void
 mud_profile_set_scrolloutput (MudProfile *profile, gboolean value)
 {
-	const gchar *key = mud_profile_gconf_get_key(profile, "functionality/scroll_on_output");
+	const gchar *key = mud_profile_gconf_get_key(profile, "scroll_on_output");
 	RETURN_IF_NOTIFYING(profile);
 
 	gconf_client_set_bool(profile->priv->gconf_client, key, value, NULL);
@@ -501,7 +500,7 @@
 void
 mud_profile_set_disablekeys (MudProfile *profile, gboolean value)
 {
-	const gchar *key = mud_profile_gconf_get_key(profile, "functionality/system_keys");
+	const gchar *key = mud_profile_gconf_get_key(profile, "system_keys");
 	RETURN_IF_NOTIFYING(profile);
 
 	gconf_client_set_bool(profile->priv->gconf_client, key, value, NULL);
@@ -510,7 +509,7 @@
 void
 mud_profile_set_keeptext (MudProfile *profile, gboolean value)
 {
-	const gchar *key = mud_profile_gconf_get_key(profile, "functionality/keeptext");
+	const gchar *key = mud_profile_gconf_get_key(profile, "keeptext");
 	RETURN_IF_NOTIFYING(profile);
 
 	gconf_client_set_bool(profile->priv->gconf_client, key, value, NULL);
@@ -519,7 +518,7 @@
 void
 mud_profile_set_echotext (MudProfile *profile, gboolean value)
 {
-	const gchar *key = mud_profile_gconf_get_key(profile, "functionality/echo");
+	const gchar *key = mud_profile_gconf_get_key(profile, "echo");
 	RETURN_IF_NOTIFYING(profile);
 
 	gconf_client_set_bool(profile->priv->gconf_client, key, value, NULL);
@@ -528,7 +527,7 @@
 void
 mud_profile_set_commdev (MudProfile *profile, const gchar *value)
 {
-	const gchar *key = mud_profile_gconf_get_key(profile, "functionality/commdev");
+	const gchar *key = mud_profile_gconf_get_key(profile, "commdev");
 	RETURN_IF_NOTIFYING(profile);
 
 	gconf_client_set_string(profile->priv->gconf_client, key, value, NULL);
@@ -537,7 +536,7 @@
 void
 mud_profile_set_terminal (MudProfile *profile, const gchar *value)
 {
-	const gchar *key = mud_profile_gconf_get_key(profile, "functionality/terminal_type");
+	const gchar *key = mud_profile_gconf_get_key(profile, "terminal_type");
 	RETURN_IF_NOTIFYING(profile);
 
 	gconf_client_set_string(profile->priv->gconf_client, key, value, NULL);
@@ -546,7 +545,7 @@
 void
 mud_profile_set_font (MudProfile *profile, const gchar *value)
 {
-	const gchar *key = mud_profile_gconf_get_key(profile, "ui/font");
+	const gchar *key = mud_profile_gconf_get_key(profile, "font");
 	RETURN_IF_NOTIFYING(profile);
 
 	gconf_client_set_string(profile->priv->gconf_client, key, value, NULL);
@@ -557,7 +556,7 @@
 {
 	GdkColor color;
 	gchar *s;
-	const gchar *key = mud_profile_gconf_get_key(profile, "ui/foreground_color");
+	const gchar *key = mud_profile_gconf_get_key(profile, "foreground_color");
 	
 	RETURN_IF_NOTIFYING(profile);
 
@@ -575,7 +574,7 @@
 {
 	GdkColor color;
 	gchar *s;
-	const gchar *key = mud_profile_gconf_get_key(profile, "ui/background_color");
+	const gchar *key = mud_profile_gconf_get_key(profile, "background_color");
 	
 	RETURN_IF_NOTIFYING(profile);
 
@@ -594,7 +593,7 @@
 	GdkColor color[C_MAX];
 	gchar *s;
 	gint i;
-	const gchar *key = mud_profile_gconf_get_key(profile, "ui/palette");
+	const gchar *key = mud_profile_gconf_get_key(profile, "palette");
 
 	RETURN_IF_NOTIFYING(profile);
 
@@ -621,7 +620,7 @@
 void
 mud_profile_set_history(MudProfile *profile, const gint value)
 {
-	const gchar *key = mud_profile_gconf_get_key(profile, "functionality/history_count");
+	const gchar *key = mud_profile_gconf_get_key(profile, "history_count");
 	RETURN_IF_NOTIFYING(profile);
 
 	gconf_client_set_int(profile->priv->gconf_client, key, value, NULL);
@@ -630,7 +629,7 @@
 void
 mud_profile_set_scrollback(MudProfile *profile, const gint value)
 {
-	const gchar *key = mud_profile_gconf_get_key(profile, "ui/scrollback_lines");
+	const gchar *key = mud_profile_gconf_get_key(profile, "scrollback_lines");
 	RETURN_IF_NOTIFYING(profile);
 
 	gconf_client_set_int(profile->priv->gconf_client, key, value, NULL);
Index: src/mud-window.c
===================================================================
RCS file: /cvs/gnome/gnome-mud/src/mud-window.c,v
retrieving revision 1.15
diff -u -r1.15 mud-window.c
--- src/mud-window.c	4 Feb 2006 15:57:14 -0000	1.15
+++ src/mud-window.c	23 Feb 2006 11:16:52 -0000
@@ -236,8 +236,9 @@
 			tmp = g_strdup(" ");
 	if (window->priv->current_view)
 		mud_connection_view_send(MUD_CONNECTION_VIEW(window->priv->current_view), tmp);
+	// FIXME: Load from profile
 		if (gconf_client_get_bool(window->priv->gconf_client,
-		   "/apps/gnome-mud/functionality/keeptext", NULL) == FALSE)
+					  "/apps/gnome-mud/profiles/Default/keeptext", NULL) == FALSE)
 			gtk_entry_set_text(GTK_ENTRY(widget), g_strdup(""));
 		free (tmp);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]