[gnome-tweak-tool] Display default shell theme more similar to other defaults



commit 3b551c8c860dfa4668e5b57686fe0b6ac684e9ac
Author: John Stowers <john stowers gmail com>
Date:   Mon Jun 20 09:48:30 2011 +1200

    Display default shell theme more similar to other defaults

 gtweak/tweaks/tweak_shell.py |    2 +-
 gtweak/utils.py              |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_shell.py b/gtweak/tweaks/tweak_shell.py
index 99c47e0..2088e41 100644
--- a/gtweak/tweaks/tweak_shell.py
+++ b/gtweak/tweaks/tweak_shell.py
@@ -98,7 +98,7 @@ class ShellThemeTweak(Tweak):
             #manually add Adwaita to represent the default
             cb = build_combo_box_text(
                     self._settings.get_string(ShellThemeTweak.THEME_GSETTINGS_NAME),
-                    ("", "default"),
+                    ("", "<i>Default</i>"),
                     *[(v,v) for v in valid])
             cb.connect('changed', self._on_combo_changed)
             self._combo = cb
diff --git a/gtweak/utils.py b/gtweak/utils.py
index ebbc22f..cdfd05d 100644
--- a/gtweak/utils.py
+++ b/gtweak/utils.py
@@ -27,9 +27,20 @@ from gtweak.gconf import GConfSetting
 from gi.repository import GLib
 
 def make_combo_list_with_default(opts, default, title=True):
+    """
+    Turns a list of values into a list of value,name (where name is the
+    display name a user will see in a combo box). If a value is opt is
+    equal to that supplied in default the display name for that value is
+    modified to "value <i>(default)</i>"
+
+    @opts: a list of value
+    @returns: a list of 2-tuples (value, name)
+    """
     themes = []
     for t in opts:
-        if t == "default":
+        if t == "default" and t != default:
+            #some themes etc are actually called default. Ick. Dont show them if they
+            #are not the actual default value
             continue
 
         if title:



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