diff options
Diffstat (limited to 'statistics-gtk.c')
-rw-r--r-- | statistics-gtk.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/statistics-gtk.c b/statistics-gtk.c index 775a3bf3b..b35516d3d 100644 --- a/statistics-gtk.c +++ b/statistics-gtk.c @@ -29,7 +29,8 @@ typedef struct { *sac, *otu, *o2he, - *gas_used; + *gas_used, + *dive_type; } single_stat_widget_t; static single_stat_widget_t single_w; @@ -334,6 +335,7 @@ static void show_single_dive_stats(struct dive *dive) struct dive *prev_dive; struct tm tm; struct divecomputer *dc; + int more = 0; process_all_dives(dive, &prev_dive); if (yearly_tree) @@ -428,6 +430,26 @@ static void show_single_dive_stats(struct dive *dive) } else { set_label(single_w.gas_used, ""); } + + /* Dive type */ + *buf = '\0'; + if (dive->dive_tags) { + int i; + + for (i = 0; i < DTAG_NR; i++) + if(dive->dive_tags & (1 << i)) { + if (more) + strcat(buf, ", "); + strcat(buf, _(dtag_names[i])); + more = 1; + } + } + if (!(dive->dive_tags & DTAG_FRESH) && dc->salinity == 10000) { + if (more) + strcat(buf, ", "); + strcat(buf, _(dtag_names[DTAG_FRESH_NR])); + } + set_label(single_w.dive_type, buf); } static void show_total_dive_stats(void) @@ -594,6 +616,12 @@ GtkWidget *single_stats_widget(void) single_w.o2he = new_info_label_in_frame(hbox, "O" UTF8_SUBSCRIPT_2 " / He"); single_w.gas_used = new_info_label_in_frame(hbox, C_("Amount","Gas Used")); + /* fifth row */ + hbox = gtk_hbox_new(FALSE, 3); + gtk_box_pack_start(GTK_BOX(framebox), hbox, TRUE, FALSE, 3); + + single_w.dive_type = new_info_label_in_frame(hbox, _("Dive Tags")); + return vbox; } @@ -613,6 +641,7 @@ void clear_stats_widgets(void) set_label(single_w.otu, ""); set_label(single_w.o2he, ""); set_label(single_w.gas_used, ""); + set_label(single_w.dive_type, ""); set_label(stats_w.total_time,""); set_label(stats_w.avg_time,""); set_label(stats_w.shortest_time,""); |