Clear the display widgets when deleting all dives in the list

After calling dive_list_update_dives() in delete_selected_dives_cb(),
if the selection length is zero, we can clear the display widgets
not to show information of a deleted dive.

[Dirk Hohndel: please watch your whitespace - you once again added a bunch
	       of empty lines that really didn't help the code...
	       I removed them]

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2012-09-29 14:27:06 +03:00 committed by Dirk Hohndel
parent 69aec317f0
commit 3e3e632e1f

View file

@ -1934,6 +1934,15 @@ static void delete_selected_dives_cb(GtkWidget *menuitem, GtkTreePath *path)
}
dive_list_update_dives();
restore_tree_state();
/* if no dives are selected at this point clear the display widgets */
if (!amount_selected) {
selected_dive = 0;
process_selected_dives();
clear_stats_widgets();
clear_equipment_widgets();
show_dive_info(NULL);
}
mark_divelist_changed(TRUE);
}