From 1e4c788150ed45dfb9a63448d7edb3b8113aaa5b Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Fri, 19 Dec 2008 19:59:11 +0000 Subject: fix groups in Edit --- (limited to 'common/Util') diff --git a/common/Util/Instruments.py b/common/Util/Instruments.py index f616811..970d15c 100644 --- a/common/Util/Instruments.py +++ b/common/Util/Instruments.py @@ -143,7 +143,7 @@ _addInstrument( "guidice6", INST_SIMP, MID, 'concret', 0, 0, 0, 1, kitStage = Tr _addInstrument( "guidice7", INST_SIMP, MID, 'concret', 0, 0, 0, 1, kitStage = True ) _addInstrument( "guidice8", INST_SIMP, MID, 'concret', 0, 0, 0, 1, kitStage = True ) _addInstrument( "guidice9", INST_SIMP, MID, 'concret', 0, 0, 0, 1, kitStage = True ) -_addInstrument( "guidice10", INST_SIMP, MID, 'concret', 0, 0, 0, 1 ) +_addInstrument( "guidice10", INST_SIMP, MID, 'concret', 0, 0, 0, 1, kitStage = True ) _addInstrument( "drum4afrofeet", INST_SIMP, LOW, 'percussions', 0, 0 ,0, 1, kitStage = True ) _addInstrument( "drum4fingersn", INST_SIMP, HIGH, 'percussions', 0, 0, 0, 1, kitStage = True ) _addInstrument( "drum4mutecuic", INST_SIMP, PUNCH, 'percussions', 0, 0, 0, 1, kitStage = True ) diff --git a/common/Util/ThemeWidgets.py b/common/Util/ThemeWidgets.py index 0acc498..6512655 100644 --- a/common/Util/ThemeWidgets.py +++ b/common/Util/ThemeWidgets.py @@ -1,6 +1,8 @@ import pygtk pygtk.require( '2.0' ) import gtk +import logging +import common.Config as Config from sugar.graphics.combobox import ComboBox from sugar.graphics.palette import Palette, WidgetInvoker @@ -1244,8 +1246,10 @@ class BigComboBox(ComboBox): def __init__(self): ComboBox.__init__(self) - def append_item(self, action_id, text, icon_name=None, size = None): - if not self._icon_renderer and icon_name: + def append_item(self, action_id, text, icon_name=None, size = None, + pixbuf = None): + + if not self._icon_renderer and (icon_name or pixbuf): self._icon_renderer = gtk.CellRendererPixbuf() settings = self.get_settings() @@ -1260,17 +1264,17 @@ class BigComboBox(ComboBox): self.pack_end(self._text_renderer, True) self.add_attribute(self._text_renderer, 'text', 1) - if icon_name: - if not size: - size = gtk.ICON_SIZE_LARGE_TOOLBAR - width, height = gtk.icon_size_lookup(size) + if not pixbuf: + if icon_name: + if not size: + size = gtk.ICON_SIZE_LARGE_TOOLBAR + width, height = gtk.icon_size_lookup(size) + else: + width, height = size + if icon_name[0:6] == "theme:": + icon_name = self._get_real_name_from_theme(icon_name[6:], size) + pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(icon_name, width, height) else: - width, height = size - if icon_name[0:6] == "theme:": - icon_name = self._get_real_name_from_theme(icon_name[6:], size) - pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(icon_name, width, height) - else: - pixbuf = None + pixbuf = None self._model.append([action_id, text, pixbuf, False]) - -- cgit v0.9.1