[epiphany-extensions] tab-states: port to gsettings



commit 518b8e70ac7730af0e2661f7de7c7e481afa6c56
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Mon Dec 6 19:21:11 2010 +0100

    tab-states: port to gsettings

 data/org.gnome.epiphanyextensions.gschema.xml.in  |   12 ++++++++++++
 extensions/tab-states/ephy-tab-states-extension.c |   13 +++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/data/org.gnome.epiphanyextensions.gschema.xml.in b/data/org.gnome.epiphanyextensions.gschema.xml.in
index 075d974..7bc407a 100644
--- a/data/org.gnome.epiphanyextensions.gschema.xml.in
+++ b/data/org.gnome.epiphanyextensions.gschema.xml.in
@@ -2,11 +2,23 @@
 <schemalist>
 	<schema path="/apps/epiphany-extensions/" id="org.gnome.EpiphanyExtensions">
 		<child schema="org.gnome.EpiphanyExtensions.smart-bookmarks" name="smart-bookmarks"/>
+		<child schema="org.gnome.EpiphanyExtensions.tab-states" name="tab-states"/>
 	</schema>
+
 	<schema path="/apps/epiphany-extensions/smart-bookmarks/" id="org.gnome.EpiphanyExtensions.smart-bookmarks">
 		<key type="b" name="open-in-tab">
 			<default>true</default>
 			<summary>Open search results in a new tab</summary>
 		</key>
 	</schema>
+	<schema path="/apps/epiphany-extensions/tab-states/" id="org.gnome.EpiphanyExtensions.tab-states">
+		<key type="s" name="loading-color">
+			<default>""</default>
+			<summary>Color for loading tabs, understandable to gdk_color_parse</summary>
+		</key>
+		<key type="s" name="unread-color">
+			<default>""</default>
+			<summary>Color for unread tabs, understandable to gdk_color_parse</summary>
+		</key>
+	</schema>
 </schemalist>
diff --git a/extensions/tab-states/ephy-tab-states-extension.c b/extensions/tab-states/ephy-tab-states-extension.c
index c4b4481..b624e0d 100644
--- a/extensions/tab-states/ephy-tab-states-extension.c
+++ b/extensions/tab-states/ephy-tab-states-extension.c
@@ -25,7 +25,6 @@
 
 #include <epiphany/epiphany.h>
 
-#include "eel-gconf-extensions.h"
 #include "ephy-debug.h"
 
 #include <gmodule.h>
@@ -46,9 +45,6 @@ struct _EphyTabStatesExtensionPrivate
 	PangoFontDescription *bold_font_desc;
 };
 
-#define CONF_TABS_LOADING_COLOUR	"/apps/galeon/UI/Tabs/tabbed_loading_color"
-#define CONF_TABS_UNREAD_COLOUR		"/apps/galeon/UI/Tabs/tabbed_new_color"
-
 static void ephy_tab_states_extension_class_init	(EphyTabStatesExtensionClass *klass);
 static void ephy_tab_states_extension_iface_init	(EphyExtensionIface *iface);
 static void ephy_tab_states_extension_init		(EphyTabStatesExtension *extension);
@@ -105,6 +101,7 @@ ephy_tab_states_extension_init (EphyTabStatesExtension *extension)
 	EphyTabStatesExtensionPrivate *priv;
 #ifdef ENABLE_COLOURS
 	char *colour;
+	GSettings *settings;
 #endif
 
 	priv = extension->priv = EPHY_TAB_STATES_EXTENSION_GET_PRIVATE (extension);
@@ -112,14 +109,18 @@ ephy_tab_states_extension_init (EphyTabStatesExtension *extension)
 	LOG ("EphyTabStatesExtension initialising");
 
 #ifdef ENABLE_COLOURS
+	settings = g_settings_new ("org.gnome.EpiphanyExtensions.tab-states");
+
 	/* FIXME handle NULL and "" */
-	colour = eel_gconf_get_string (CONF_TABS_LOADING_COLOUR);
+	colour = g_settings_get_string ("loading-color");
 	gdk_color_parse (colour, &priv->tab_loading_colour);
 	g_free (colour);
 
-	colour = eel_gconf_get_string (CONF_TABS_UNREAD_COLOUR);
+	colour = g_settings_get_string ("unread-color");
 	gdk_color_parse (colour, &priv->tab_unread_colour);
 	g_free (colour);
+
+	g_object_unref (settings);
 #endif
 
 	priv->bold_font_desc = pango_font_description_new ();



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