Clear statistics and equipment when no dive is selected

This all seems very strange forward.

The reason for the check whether the stats_w widget has been populated is
that at the very beginning, when the UI is still being assembled, a first
call to switch_page() happens as the notebook pages are assembled. At that
point the stats_w widget is still empty which tells us that we aren't
ready to display anything.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-02-18 16:56:28 -08:00
parent ef55ddccb5
commit 6ce4d29f49
3 changed files with 8 additions and 7 deletions

6
main.c
View file

@ -247,10 +247,8 @@ void update_dive(struct dive *new_dive)
flush_divelist(old_dive);
}
show_dive_info(new_dive);
if (new_dive) {
show_dive_equipment(new_dive, W_IDX_PRIMARY);
show_dive_stats(new_dive);
}
show_dive_equipment(new_dive, W_IDX_PRIMARY);
show_dive_stats(new_dive);
buffered_dive = new_dive;
}