[gnome-mines/wip/theming-support] Added settings value for the theme



commit aeb43f1046990fa3487b4c490484e2d9a54084cc
Author: Robert Roth <robert roth off gmail com>
Date:   Mon Jan 5 12:30:17 2015 +0200

    Added settings value for the theme

 data/org.gnome.mines.gschema.xml |    5 +++++
 src/gnome-mines.vala             |    5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/data/org.gnome.mines.gschema.xml b/data/org.gnome.mines.gschema.xml
index 7fd39d3..e57ae12 100644
--- a/data/org.gnome.mines.gschema.xml
+++ b/data/org.gnome.mines.gschema.xml
@@ -1,5 +1,10 @@
 <schemalist>
   <schema id="org.gnome.mines" path="/org/gnome/mines/" gettext-domain="gnome-mines">
+    <key name="theme" type="s">
+      <default>'default'</default>
+      <summary>The theme to use</summary>
+      <description>The title of the tile theme to use.</description>
+    </key>
     <key name="use-question-marks" type="b">
       <default>true</default>
       <summary>Use the unknown flag</summary>
diff --git a/src/gnome-mines.vala b/src/gnome-mines.vala
index d1b52ee..628be73 100644
--- a/src/gnome-mines.vala
+++ b/src/gnome-mines.vala
@@ -24,10 +24,11 @@ public class Mines : Gtk.Application
     /* For command-line options */
     private static int game_mode = -1;
 
-    /* Keys shared with MinefieldView */
+    /* Shared Settings keys */
     public static const string KEY_USE_QUESTION_MARKS = "use-question-marks";
     public static const string KEY_USE_OVERMINE_WARNING = "use-overmine-warning";
     public static const string KEY_USE_AUTOFLAG = "use-autoflag";
+    public static const string KEY_THEME = "theme";
 
     private Gtk.Widget main_screen;
     private Gtk.Button play_pause_button;
@@ -174,7 +175,7 @@ public class Mines : Gtk.Application
             warning ("Could not load game UI: %s", e.message);
         }
 
-        set_game_theme ("default");
+        set_game_theme (settings.get_string (KEY_THEME));
 
         add_action_entries (action_entries, this);
         new_game_action = lookup_action ("new-game") as SimpleAction;


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