[gnome-games] [same-gnome-clutter] Use libgames-support conf code instead of gconf
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-games] [same-gnome-clutter] Use libgames-support conf code instead of gconf
- Date: Sat, 1 Aug 2009 02:44:52 +0000 (UTC)
commit 6a1beadf49c40a90f5b8333322b4cfdb69f546f6
Author: Tim Horton <hortont424 gmail com>
Date: Fri Jul 31 22:40:47 2009 -0400
[same-gnome-clutter] Use libgames-support conf code instead of gconf
same-gnome-clutter/src/Settings.js | 33 +++++++++++++++------------------
same-gnome-clutter/src/main.js | 8 ++------
2 files changed, 17 insertions(+), 24 deletions(-)
---
diff --git a/same-gnome-clutter/src/Settings.js b/same-gnome-clutter/src/Settings.js
index e46a8d1..a34a7e2 100644
--- a/same-gnome-clutter/src/Settings.js
+++ b/same-gnome-clutter/src/Settings.js
@@ -2,10 +2,9 @@ Gtk = imports.gi.Gtk;
Gio = imports.gi.Gio;
GtkBuilder = imports.gtkbuilder;
main = imports.main;
-GConf = imports.gi.GConf;
ThemeLoader = imports.ThemeLoader;
-
-GConf.init(Seed.argv);
+GnomeGamesSupport = imports.gi.GnomeGamesSupport;
+ggsconf = GnomeGamesSupport.Conf;
// Defaults
var theme, colors, zealous, size;
@@ -22,11 +21,10 @@ var sizes = [{name: "Small", columns: 6, rows: 5},
try
{
- gconf_client = GConf.Client.get_default();
- theme = themes[gconf_client.get_string("/apps/same-gnome-clutter/theme")];
- size = gconf_client.get_int("/apps/same-gnome-clutter/size");
- colors = gconf_client.get_int("/apps/same-gnome-clutter/colors");
- zealous = gconf_client.get_bool("/apps/same-gnome-clutter/zealous");
+ theme = themes[ggsconf.get_string(null, "theme")];
+ size = ggsconf.get_integer(null, "size");
+ colors = ggsconf.get_integer(null, "colors");
+ zealous = ggsconf.get_boolean(null, "zealous");
if(colors < 2 || colors > 4)
colors = default_colors;
@@ -36,12 +34,11 @@ try
}
catch(e)
{
- print("Couldn't load settings from GConf.");
+ print("Couldn't load settings from ggsconf.");
theme = themes[default_theme];
size = default_size;
colors = default_colors;
zealous = default_zealous;
- fly_score = default_fly_score;
}
// Settings Event Handler
@@ -73,11 +70,11 @@ handlers = {
try
{
- gconf_client.set_string("/apps/same-gnome-clutter/theme", selector.get_active_text());
+ ggsconf.set_string(null, "theme", selector.get_active_text());
}
catch(e)
{
- print("Couldn't save settings to GConf.");
+ print("Couldn't save settings to ggsconf.");
}
Watcher.signal.theme_changed.emit();
@@ -88,11 +85,11 @@ handlers = {
try
{
- gconf_client.set_bool("/apps/same-gnome-clutter/zealous", zealous);
+ ggsconf.set_boolean(null, "zealous", zealous);
}
catch(e)
{
- print("Couldn't save settings to GConf.");
+ print("Couldn't save settings to ggsconf.");
}
},
update_size: function(widget, ud)
@@ -106,11 +103,11 @@ handlers = {
try
{
- gconf_client.set_int("/apps/same-gnome-clutter/size", size);
+ ggsconf.set_integer(null, "size", size);
}
catch(e)
{
- print("Couldn't save settings to GConf.");
+ print("Couldn't save settings to ggsconf.");
}
Watcher.signal.size_changed.emit();
@@ -126,11 +123,11 @@ handlers = {
try
{
- gconf_client.set_int("/apps/same-gnome-clutter/colors", colors);
+ ggsconf.set_integer(null, "colors", colors);
}
catch(e)
{
- print("Couldn't save settings to GConf.");
+ print("Couldn't save settings to ggsconf.");
}
Watcher.signal.colors_changed.emit();
diff --git a/same-gnome-clutter/src/main.js b/same-gnome-clutter/src/main.js
index 62238ff..be09758 100755
--- a/same-gnome-clutter/src/main.js
+++ b/same-gnome-clutter/src/main.js
@@ -9,7 +9,6 @@ Gtk = imports.gi.Gtk;
GtkClutter = imports.gi.GtkClutter;
GtkBuilder = imports.gtkbuilder;
Clutter = imports.gi.Clutter;
-GConf = imports.gi.GConf;
GnomeGamesSupport = imports.gi.GnomeGamesSupport;
_ = imports.gettext.gettext;
@@ -19,11 +18,9 @@ if(GnomeGamesSupport.setgid_io_init)
GnomeGamesSupport.setgid_io_init();
GnomeGamesSupport.runtime_init("same-gnome");
-GnomeGamesSupport.Conf.initialise("same-gnome");
+GnomeGamesSupport.Conf.initialise("same-gnome-clutter");
GnomeGamesSupport.stock_init();
-GConf.init(Seed.argv);
-
Light = imports.Light;
Board = imports.Board;
Score = imports.Score;
@@ -113,7 +110,6 @@ board.new_game();
Gtk.main();
-// should use GGS conf stuff instead of gconf?
-//GnomeGamesSupport.Conf.get_default().shutdown();
+GnomeGamesSupport.Conf.shutdown();
GnomeGamesSupport.runtime_shutdown();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]