diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-01-30 07:05:30 +1100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-30 07:05:30 +1100 |
commit | 468d3f28f9f1f2795960b8e8b79b9d02024e34ed (patch) | |
tree | be0a5e70292f59d5013b566db11c539da04b76fb /equipment.c | |
parent | 4b5b732f2cf8a63445a610642285304526850c91 (diff) | |
download | subsurface-468d3f28f9f1f2795960b8e8b79b9d02024e34ed.tar.gz |
Make the selection logic more robust
In commit 304526850c91 ("Don't deselect all dives on all selection
"change" events") the handling of "selected_dive" is incorrect. We ended
up with non-sensical values for the selected dive, including dives that
Gtk didn't think were selected.
This commit tries to be smart about what to do when the dive that we
currently consider selected is unselected (we have this weird notion of
many dives being selected, but one of them is shown in the profile and
that is the "selected_dive"). As long as there are others selected, we
pick one of them (first walking to earlier dives and if there are none
that are selected, looking for a later dive) as the new selected dive.
This appears to give us a rather intuitive behavior when playing with
multiple selected dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'equipment.c')
0 files changed, 0 insertions, 0 deletions