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

Ajay Garg ajay at activitycentral.com
Fri Nov 30 16:52:42 EST 2012


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 <dsd at 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 <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
> >
>



Regards,

Ajay Garg
Dextrose Developer
Activity Central: http://activitycentral.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20121201/55708802/attachment-0001.html>


More information about the Sugar-devel mailing list