[gnome-games] [lightsoff] Check if loaded theme exists; if not, set to default



commit 2285cce7f52683cb8f8f9ecd14b2c9d08f99353e
Author: Tim Horton <hortont svn gnome org>
Date:   Mon Jun 29 00:21:07 2009 -0400

    [lightsoff] Check if loaded theme exists; if not, set to default

 lightsoff/Settings.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/lightsoff/Settings.js b/lightsoff/Settings.js
index 7ffc9dc..defb7db 100644
--- a/lightsoff/Settings.js
+++ b/lightsoff/Settings.js
@@ -8,6 +8,7 @@ GConf.init(Seed.argv);
 
 // Defaults
 var theme, score;
+var default_theme = "Tango";
 
 // Map theme names to themes
 var themes = {};
@@ -19,11 +20,14 @@ try
 	gconf_client = GConf.Client.get_default();
 	score = gconf_client.get_int("/apps/lightsoff/score");
 	theme = themes[gconf_client.get_string("/apps/lightsoff/theme")];
+	
+	if(theme == null)
+		theme = themes[default_theme];
 }
 catch(e)
 {
 	print("Couldn't load settings from GConf.");
-	theme = themes["Tango"];
+	theme = themes[default_theme];
 	score = 1;
 }
 



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