[PATCH] Select all dives in a trip when said trip is expanded and clicked

Linus Torvalds torvalds at linux-foundation.org
Tue Feb 19 07:38:01 PST 2013


On Mon, Feb 18, 2013 at 9:06 PM, Miika Turkia <miika.turkia at gmail.com> wrote:
>
> I did a quick test with the sample dives.
> - Expand the trip
> - Select one dive
> - Collapse the trip
> - Select a dive that is not on a trip
> - Expand the trip
>
> Oddities from my point of view:
> - There is no visual indication that one or more dives from a trip is
> selected when the trip is collapsed

Can you explain exactly how you did that? Because we very much on
purpose select the dive trip when we collapse it, that's what
"row_collapse_cb()" is all about.

And it works for me. When I collapse a divetrip with a selected dive,
the divetrip ends up selected too.

Maybe it's some gnome version thing. I have

    gtk2-devel-2.24.13-1.fc18.x86_64

on my machine.

> - When selecting a dive without modifiers one expects that other
> selections are cleared. This is not the case when dives are selected
> in a collapsed trip. This shows on the dive stats and when you expand
> the trip.

Right. This is the normal "out of sight, out of mind" behavior of gtk.
If the dive(trip) isn't selected, gtk doesn't care, and if you select
something else it won't unselect the dive that isn't visible.

Which is exactly why we select the divetrip when collapsing, so that
when something else is selected, we get the "unselect" update from gtk
and can then unselect the collapsed dives by hand)

So it doesn't happen for me - because I see the divetrip being
properly selected when a dive in it was selected and the trip was
collapsed.

> - Now if I select a trip none of the dives within are selected - no
> matter whether the trip is collapsed or expanded (not sure what was
> the intended behaviour on this but I thought all the dives would be
> selected)

Again, for me, if a trip is selected when expanded, I get all dives
selected (now, with my patch) and if it was collapsed it always did
that for me.

[ trying some more ]

.. uhhuh - I notice that Lubomir says he can recreate it with

    ./subsurface dives/*

and it turns out that I can recreate it with that too. But not with my
own dives.

Odd. I think I agree with Lubomir - there's something about the mixed
"in-trip" and "not in trip" dives that triggers this.

Will look.

              Linus


More information about the subsurface mailing list