Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ported sphagetti.start entirely

  • Loading branch information...
commit 44ba26c34de99eee8b77a992315b5dab393eec5d 1 parent c4f9869
@phanimahesh phanimahesh authored
View
11 .gitignore
@@ -1,5 +1,14 @@
__pycache__
+
*~
*.bak
-build
*.orig
+
+build
+
+debian/files
+debian/unity-tweak-tool.debhelper.log
+debian/unity-tweak-tool.postinst.debhelper
+debian/unity-tweak-tool.prerm.debhelper
+debian/unity-tweak-tool.substvars
+debian/unity-tweak-tool
View
22 UnityTweakTool/elements/checkbox.py
@@ -49,11 +49,15 @@ def __init__(self,controlObj):
self.invmap = dict([ (v,k) for (k,v) in self.map.items() ])
self.dependants = controlObj['dependants']
self.active = False
- assert gsettings.is_valid(
- schema=self.schema,
- path=self.path,
- key=self.key
- )
+ self.disabled = False
+ try:
+ assert gsettings.is_valid(
+ schema=self.schema,
+ path=self.path,
+ key=self.key
+ )
+ except AssertionError as e:
+ self.disabled = True
logger.debug('Initialised a checkbox with id {self.id} to control key {self.key} of type {self.type} in schema {self.schema} with path {self.path}'.format(self=self))
def register(self,handler):
@@ -64,6 +68,9 @@ def register(self,handler):
def refresh(self):
''' Refresh UI reading from backend '''
logger.debug('Refreshing UI display for {self.id}'.format(self=self))
+ if self.disabled:
+ self.ui.set_sensitive(False)
+ return
self.active=self.map[
gsettings.get(
schema=self.schema,
@@ -90,9 +97,12 @@ def handler(self,*args,**kwargs):
def reset(self):
''' Reset the controlled key '''
+ if self.disabled:
+ return
gsettings.reset(schema=self.schema,path=self.path,key=self.key)
logger.debug('Key {self.key} in schema {self.schema} and path {self.path} reset.'.format(self=self))
def handledependants(self):
+ status=False if self.disabled else self.active
for element in self.dependants:
- self.builder.get_object(element).set_sensitive(self.active)
+ self.builder.get_object(element).set_sensitive(status)
View
33 UnityTweakTool/section/overview.py
@@ -29,7 +29,7 @@
# You should have received a copy of the GNU General Public License along with
# this program; if not, see <https://www.gnu.org/licenses/gpl-3.0.txt>
-from UnityTweakTool.section.skeletonpage import Section,Tab
+from UnityTweakTool.section.skeletonpage import Section,Tab,Gtk
from UnityTweakTool.elements.toolbutton import OverviewToolButton
class Overview(Tab,Section):
@@ -67,3 +67,34 @@ def __init__(self,notebook):
self.register_tab(self.handler)
self.register()
+
+ # Symbolic icons
+ self.icons = Gtk.IconTheme.get_default()
+ self.style_context = self.builder.get_object('startpage_window').get_style_context()
+ self.style_context.connect('changed', self.on_style_context_change)
+# XXX : Delete the next line and UTT crashes with attribute error. absolutely no idea why.
+ self.on_style_context_change()
+
+ def on_style_context_change(self, *args):
+ self.symbolic_color = self.style_context.get_color(Gtk.StateFlags.ACTIVE)
+
+ appearance_symbolic_icon = self.icons.lookup_icon('unity-tweak-tool-appearance-symbolic', 24, Gtk.IconLookupFlags.FORCE_SIZE)
+ if appearance_symbolic_icon:
+ appearance_symbolic_icon_pixbuf, was_sym = appearance_symbolic_icon.load_symbolic(self.symbolic_color, None, None, None)
+ self.builder.get_object('image_start_theme').set_from_pixbuf(appearance_symbolic_icon_pixbuf)
+
+ unity_symbolic_icon = self.icons.lookup_icon('unity-tweak-tool-unity-symbolic', 24, Gtk.IconLookupFlags.FORCE_SIZE)
+ if unity_symbolic_icon:
+ unity_symbolic_icon_pixbuf, was_sym = unity_symbolic_icon.load_symbolic(self.symbolic_color, None, None, None)
+ self.builder.get_object('image_box_start_unity').set_from_pixbuf(unity_symbolic_icon_pixbuf)
+
+ system_symbolic_icon = self.icons.lookup_icon('unity-tweak-tool-system-symbolic', 24, Gtk.IconLookupFlags.FORCE_SIZE)
+ if system_symbolic_icon:
+ system_symbolic_icon_pixbuf, was_sym = system_symbolic_icon.load_symbolic(self.symbolic_color, None, None, None)
+ self.builder.get_object('image_start_desktop').set_from_pixbuf(system_symbolic_icon_pixbuf)
+
+ wm_symbolic_icon = self.icons.lookup_icon('unity-tweak-tool-wm-symbolic', 24, Gtk.IconLookupFlags.FORCE_SIZE)
+ if wm_symbolic_icon:
+ wm_symbolic_icon_pixbuf, was_sym = wm_symbolic_icon.load_symbolic(self.symbolic_color, None, None, None)
+ self.builder.get_object('image_box_start_compiz').set_from_pixbuf(wm_symbolic_icon_pixbuf)
+
Please sign in to comment.
Something went wrong with that request. Please try again.