diff options
author | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-09-19 08:22:26 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-09-19 08:22:26 (GMT) |
commit | 2ddb8169de4621ffdf40ff3b26166a0d3d1c047b (patch) | |
tree | b54dd91d3b1a4d14d9a7a84b33eaac725cce2bcf /src | |
parent | ace3bf7a527284c875ded6cb01491a6c817187ba (diff) |
Make LAYOUT_MAP public since it's used externally now.
Diffstat (limited to 'src')
-rw-r--r-- | src/view/home/HomeBox.py | 6 | ||||
-rw-r--r-- | src/view/home/favoritesview.py | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/view/home/HomeBox.py b/src/view/home/HomeBox.py index 0655253..81c328d 100644 --- a/src/view/home/HomeBox.py +++ b/src/view/home/HomeBox.py @@ -40,7 +40,7 @@ _LIST_VIEW = 1 _AUTOSEARCH_TIMEOUT = 1000 def _convert_layout_constant(profile_constant): - for layoutid, layoutclass in favoritesview._LAYOUT_MAP.items(): + for layoutid, layoutclass in favoritesview.LAYOUT_MAP.items(): if profile_constant == layoutclass.profile_key: return layoutid logging.warning('Incorrect favorites_layout value: %r' % \ @@ -329,7 +329,7 @@ class FavoritesButton(RadioToolButton): # someday, this will be a gtk.Table() layouts_grid = gtk.HBox() layout_item = None - for layoutid, layoutclass in sorted(favoritesview._LAYOUT_MAP.items()): + for layoutid, layoutclass in sorted(favoritesview.LAYOUT_MAP.items()): layout_item = RadioToolButton(icon_name=layoutclass.icon_name, group=layout_item, active=False) if layoutid == self._layout: @@ -356,7 +356,7 @@ class FavoritesButton(RadioToolButton): self.emit('toggled') def _update_icon(self): - self.props.named_icon = favoritesview._LAYOUT_MAP[self._layout]\ + self.props.named_icon = favoritesview.LAYOUT_MAP[self._layout]\ .icon_name def _get_layout(self): diff --git a/src/view/home/favoritesview.py b/src/view/home/favoritesview.py index c94f20b..ce4e075 100644 --- a/src/view/home/favoritesview.py +++ b/src/view/home/favoritesview.py @@ -46,16 +46,16 @@ _logger = logging.getLogger('FavoritesView') _ICON_DND_TARGET = ('activity-icon', gtk.TARGET_SAME_WIDGET, 0) # enumerate the various layout types we will display in the dropdown palette. -# add a constant for your layout here, and add it to the _LAYOUT_MAP to get +# add a constant for your layout here, and add it to the LAYOUT_MAP to get # it to appear in the palette. RING_LAYOUT, BOX_LAYOUT, TRIANGLE_LAYOUT, SUNFLOWER_LAYOUT, RANDOM_LAYOUT = \ xrange(5) -_LAYOUT_MAP = {RING_LAYOUT: favoriteslayout.RingLayout, - BOX_LAYOUT: favoriteslayout.BoxLayout, - TRIANGLE_LAYOUT: favoriteslayout.TriangleLayout, - SUNFLOWER_LAYOUT: favoriteslayout.SunflowerLayout, - RANDOM_LAYOUT: favoriteslayout.RandomLayout} +LAYOUT_MAP = {RING_LAYOUT: favoriteslayout.RingLayout, + BOX_LAYOUT: favoriteslayout.BoxLayout, + TRIANGLE_LAYOUT: favoriteslayout.TriangleLayout, + SUNFLOWER_LAYOUT: favoriteslayout.SunflowerLayout, + RANDOM_LAYOUT: favoriteslayout.RandomLayout} """Map numeric layout identifiers to uninstantiated subclasses of `FavoritesLayout` which implement the layouts. Additional information about the layout can be accessed with fields of the class.""" @@ -251,11 +251,11 @@ class FavoritesView(hippo.Canvas): context.drop_finish(success=True, time=time) def _set_layout(self, layout): - if layout not in _LAYOUT_MAP: + if layout not in LAYOUT_MAP: raise ValueError('Unknown favorites layout: %r' % layout) - if type(self._layout) != _LAYOUT_MAP[layout]: + if type(self._layout) != LAYOUT_MAP[layout]: self._box.clear() - self._layout = _LAYOUT_MAP[layout]() + self._layout = LAYOUT_MAP[layout]() self._box.set_layout(self._layout) self._my_icon = _MyIcon(style.XLARGE_ICON_SIZE) |