[Rhythmbox-devel] XOSD color pref patch



Here's a patch to make the xosd display color in nrb a gconf pref
(people with red backgrounds don't like red displays)

-alex
Index: data/net-rhythmbox.schemas
===================================================================
RCS file: /cvs/gnome/net-rhythmbox/data/net-rhythmbox.schemas,v
retrieving revision 1.3
diff -u -r1.3 net-rhythmbox.schemas
--- data/net-rhythmbox.schemas	11 Apr 2003 20:08:27 -0000	1.3
+++ data/net-rhythmbox.schemas	22 Apr 2003 22:57:59 -0000
@@ -267,5 +267,18 @@
         </long>
         </locale>
       </schema>
+      <schema>
+        <key>/schemas/apps/net-rhythmbox/ui/xosd_color</key>
+        <applyto>/apps/net-rhythmbox/ui/xosd_color</applyto>
+        <owner>rhythmbox</owner>
+        <type>string</type>
+        <default>red</default>
+        <locale name="C">
+	<short>The color to use for XOSD display</short>
+	<long>
+	  The color name to use for the X OnScreen Display.
+        </long>
+        </locale>
+      </schema>
     </schemalist>
 </gconfschemafile>
Index: shell/rb-shell-preferences.h
===================================================================
RCS file: /cvs/gnome/net-rhythmbox/shell/rb-shell-preferences.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 rb-shell-preferences.h
--- shell/rb-shell-preferences.h	9 Feb 2003 08:11:20 -0000	1.1.1.1
+++ shell/rb-shell-preferences.h	22 Apr 2003 22:58:01 -0000
@@ -33,6 +33,7 @@
 #define CONF_UI_SIDEBAR_HIDDEN    CONF_PREFIX "/ui/sidebar_hidden"
 #define CONF_UI_USE_XOSD          CONF_PREFIX "/ui/use_xosd"
 #define CONF_UI_XOSD_FONT         CONF_PREFIX "/ui/xosd_font"
+#define CONF_UI_XOSD_COLOR        CONF_PREFIX "/ui/xosd_color"
 
 #define RB_TYPE_SHELL_PREFERENCES         (rb_shell_preferences_get_type ())
 #define RB_SHELL_PREFERENCES(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_SHELL_PREFERENCES, RBShellPreferences))
Index: shell/rb-shell.c
===================================================================
RCS file: /cvs/gnome/net-rhythmbox/shell/rb-shell.c,v
retrieving revision 1.6
diff -u -r1.6 rb-shell.c
--- shell/rb-shell.c	16 Apr 2003 03:18:34 -0000	1.6
+++ shell/rb-shell.c	22 Apr 2003 22:58:03 -0000
@@ -316,6 +316,7 @@
 
 #ifdef HAVE_XOSD
 	char *xosd_font;
+	char *xosd_color;
 	xosd *xosd_obj;
 	gboolean xosd_b0rked;
 #endif	
@@ -457,9 +458,12 @@
 
 #ifdef HAVE_XOSD
 	shell->priv->xosd_font = eel_gconf_get_string (CONF_UI_XOSD_FONT);
+        shell->priv->xosd_color = eel_gconf_get_string (CONF_UI_XOSD_COLOR);
 	if (!shell->priv->xosd_font)
 		shell->priv->xosd_font = g_strdup ("-*-fixed-*-*-*-*-64");
-	shell->priv->xosd_obj = xosd_init(shell->priv->xosd_font, "red", 3,
+	if (!shell->priv->xosd_color)
+		shell->priv->xosd_color = g_strdup ("red");
+	shell->priv->xosd_obj = xosd_init(shell->priv->xosd_font, shell->priv->xosd_color, 3,
 					  XOSD_bottom, 0, 0, 1);
 	shell->priv->xosd_b0rked = FALSE;
 #endif
@@ -520,6 +524,7 @@
 	if (shell->priv->xosd_obj)
 		xosd_destroy (shell->priv->xosd_obj);
 	g_free (shell->priv->xosd_font);
+	g_free (shell->priv->xosd_color);
 #endif
 
 	if (shell->priv->remote != NULL)


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