[Sugar-devel] [sugar-update-control PATCH 1/2] Now, the selecting/unselecting particular activities works.
Daniel Drake
dsd at laptop.org
Fri Nov 30 12:17:04 EST 2012
Thanks for the patch. If you'd like to speed up the process and save
me some time, please add a commit message explaining what was wrong
and how/why this fixes it. It does not jump out at me from the patch.
It also doesn't feel like the right place to be doing a spring
cleaning of the activities model.
On Tue, Nov 27, 2012 at 10:31 AM, Ajay Garg <ajay at activitycentral.com> wrote:
> 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