[Sugar-devel] [sugar-update-control PATCH 1/2] Now, the selecting/unselecting particular activities works.

Ajay Garg ajay at activitycentral.com
Tue Nov 27 11:31:12 EST 2012


diff --git a/src/model.py b/src/model.py
index 35896e2..533183b 100755
--- a/src/model.py
+++ b/src/model.py
@@ -229,7 +229,13 @@ class UpdateList(Gtk.ListStore):
 
     def toggle_select(self, path):
         """Toggle whether the given update will be installed."""
-        row = self[path]
+        # We first need to remove all the spurious activities existing
+        # in the model, for whom "UPDATE_EXISTS" is False.
+        for act in self:
+            if act[UPDATE_EXISTS] is False:
+                self.remove(act.iter)
+
+        row = self[self.get_iter_from_string(path)]
         row[UPDATE_SELECTED] = not row[UPDATE_SELECTED]
 
     # don't touch the UI in refresh, it needs to be thread-safe.
diff --git a/src/view.py b/src/view.py
index 32cb580..9c8efdb 100755
--- a/src/view.py
+++ b/src/view.py
@@ -84,7 +84,6 @@ class ActivityListView(Gtk.ScrolledWindow):
         if self.activity_updater._in_sugar:
             crbool.set_property('indicator_size', style.zoom(26))
         def toggled_cb(crbool, path, self):
-            path = self.ftreestore.convert_path_to_child_path(path)
             self.activity_updater.activity_list.toggle_select(path)
             self.activity_pane._refresh_update_size()
         crbool.connect('toggled', toggled_cb, self)
-- 
1.7.11.7



More information about the Sugar-devel mailing list