mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Rework dive selection logic
This completely changes how we keep track of selected dives: instead of having an array listing the selection ("selectiontracker") or trusting the gtk selection information, just save the information about whether a dive is selected in the dive itself. That makes it trivial to keep track of the state of selection across group collapse/expand events, or when changing the tree view model. It also ends up simplifying the code and logic in other ways. HOWEVER, it does currently (re-)introduce an annoying oddity with gtk: if you collapse a dive trip that has individual selections, gtk will forget those selections ("out of sight, out of mind"), and when you do *new* selections, the old hidden ones remain. So there's some games required to make gtk do sane things. We may need to either explicitly drop selections when collapsing trips, or make sure the group entry gets selected when collapsing a group that has selections in it. Or something. There may be other issues introduced by this too. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
38f92f780a
commit
972669d636
6 changed files with 176 additions and 214 deletions
|
@ -77,7 +77,7 @@ extern GtkWidget *dive_list_create(void);
|
|||
|
||||
unsigned int amount_selected;
|
||||
|
||||
extern void process_selected_dives(GList *, int *, GtkTreeModel *);
|
||||
extern void process_selected_dives(void);
|
||||
|
||||
typedef void (*data_func_t)(GtkTreeViewColumn *col,
|
||||
GtkCellRenderer *renderer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue