[Sugar-devel] [PATCH] ActivityListPalette: fix displaying of Palette

Simon Schampijer simon at schampijer.de
Wed Sep 12 05:11:37 EDT 2012


From: Simon Schampijer <simon at laptop.org>

- uncommented some code that was commented by mistake
- listen to the destroy signal of the menu for doing the
  cleanup: the structure of Palettes has changed. The
  Palette is either a Gtk.Menu or a Gtk.Window which is
  encapsulated in the Palette class, in this case the
  Palette contains a Gtk.Menu and we can listen on it
  for the destroy signal.

To display the Palette this patch depends on the CellrendererInvoker
fixup patch for the toolkit.

Signed-off-by: Simon Schampijer <simon at laptop.org>
---
 src/jarabe/desktop/activitieslist.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
index 8958d60..ab62b58 100644
--- a/src/jarabe/desktop/activitieslist.py
+++ b/src/jarabe/desktop/activitieslist.py
@@ -283,8 +283,6 @@ class CellRendererActivityIcon(CellRendererIcon):
         self._tree_view = tree_view
 
     def create_palette(self):
-        pass
-        '''
         model = self._tree_view.get_model()
         row = model[self.props.palette_invoker.path]
         bundle_id = row[ListModel.COLUMN_BUNDLE_ID]
@@ -293,7 +291,7 @@ class CellRendererActivityIcon(CellRendererIcon):
         palette = ActivityListPalette(registry.get_bundle(bundle_id))
         palette.connect('erase-activated', self.__erase_activated_cb)
         return palette
-        '''
+
     def __erase_activated_cb(self, palette, bundle_id):
         self.emit('erase-activated', bundle_id)
 
@@ -417,7 +415,7 @@ class ActivityListPalette(ActivityPalette):
                 self.__activity_changed_cb)
         self._update_favorite_item()
 
-        #self.connect('destroy', self.__destroy_cb)
+        self.menu.connect('destroy', self.__destroy_cb)
 
     def _add_erase_option(self, registry, activity_info):
         menu_item = MenuItem(_('Erase'), 'list-remove')
-- 
1.7.11.4



More information about the Sugar-devel mailing list