Daniel,

I agree that the reason of applying this particular fix is not very well
explained, but this was the best that worked, without breaking  anything
else.

To put it logically, once the list is rendered, we do not need  any
"not-updatable activity entries" anyway; also the only next step after the
rendering, is "Refresh", wherein the entire process is followed again.

Anyhow, as long as all the use-cases work as expected, we should be ok :)

It would be good if it is known whether the "Select/Deselect" feature
worked at all previously (I doubt it ever did). In the unlikely scenario
that it worked before, I will be happy to delve in more into this.


On Fri, Nov 30, 2012 at 10:47 PM, Daniel Drake <d...@laptop.org> wrote:

> 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 <a...@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
> >
>



Regards,

Ajay Garg
Dextrose Developer
Activity Central: http://activitycentral.com
_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to