From 3e3e632e1f73103703f3886de54e29c6be1d2828 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 29 Sep 2012 14:27:06 +0300 Subject: 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 Signed-off-by: Dirk Hohndel --- divelist.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/divelist.c b/divelist.c index 4dcf605bc..7f9095951 100644 --- a/divelist.c +++ b/divelist.c @@ -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); } -- cgit v1.2.3-70-g09d2