summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2012-09-29 14:27:06 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-29 08:27:03 -0700
commit3e3e632e1f73103703f3886de54e29c6be1d2828 (patch)
tree12305e6ef575ee9582818f5e2247964d6fa27549 /divelist.c
parent69aec317f03b9270e77a58da3802f9251c70d67c (diff)
downloadsubsurface-3e3e632e1f73103703f3886de54e29c6be1d2828.tar.gz
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>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c9
1 files changed, 9 insertions, 0 deletions
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);
}