]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Merge branch 'tree2' of git://git.hohndel.org/subsurface
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Aug 2012 17:46:30 +0000 (10:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Aug 2012 17:46:30 +0000 (10:46 -0700)
Pull dive-trip grouping from Dirk Hohndel:
 "This turned into an updated pull request for the tree2 branch where I
  implemented the date based grouping - but is actually a very different
  topic: this adds the ability to edit multiple dives (and fixes some
  issues with the dive editing overall).  The reason for that is that it
  reuses some of the infrastructure that I implemented in the tree2
  branch for tracking the selected dives.  More details in the commit
  messages."

* 'tree2' of git://git.hohndel.org/subsurface:
  Switch from date based to dive trip based grouping
  Redo dive editing
  Fix selecting and unselecting summary items
  Apply sort functions to the correct model, don't select summary entries
  Maintain selected rows when switching between list model and tree model
  Create duplicate list model so sorting by columns works again
  Improve tree model implementation
  Allow date based grouping

display-gtk.h
dive.c
dive.h
divelist.c
equipment.c
gtk-gui.c
info.c
parse-xml.c
save-xml.c

index 1cf150bb622d18c5e649f30d20d28f3eab3290cb..059c6aa23be39d104a2bb50d36781fb753822736 100644 (file)
@@ -14,6 +14,8 @@ typedef struct {
 typedef struct {
        gboolean cylinder;
        gboolean temperature;
+       gboolean totalweight;
+       gboolean suit;
        gboolean nitrox;
        gboolean sac;
        gboolean otu;
diff --git a/dive.c b/dive.c
index 9f57aed58146554969901198ac761fc888904e18..f5d0828015e2b64990a390d877839e43335ffd48 100644 (file)
--- a/dive.c
+++ b/dive.c
@@ -120,6 +120,28 @@ double get_depth_units(unsigned int mm, int *frac, const char **units)
        return d;
 }
 
+double get_weight_units(unsigned int grams, int *frac, const char **units)
+{
+       int decimals;
+       double value;
+       const char* unit;
+
+       if (output_units.weight == LBS) {
+               value = grams_to_lbs(grams);
+               unit = "lbs";
+               decimals = 0;
+       } else {
+               value = grams / 1000.0;
+               unit = "kg";
+               decimals = 1;
+       }
+       if (frac)
+               *frac = decimals;
+       if (units)
+               *units = unit;
+       return value;
+}
+
 struct dive *alloc_dive(void)
 {
        const int initial_samples = 5;
@@ -464,6 +486,7 @@ struct dive *fixup_dive(struct dive *dive)
        add_people(dive->buddy);
        add_people(dive->divemaster);
        add_location(dive->location);
+       add_suit(dive->suit);
        for (i = 0; i < MAX_CYLINDERS; i++) {
                cylinder_t *cyl = dive->cylinder + i;
                add_cylinder_description(&cyl->type);
@@ -472,6 +495,10 @@ struct dive *fixup_dive(struct dive *dive)
                if (same_rounded_pressure(cyl->sample_end, cyl->end))
                        cyl->end.mbar = 0;
        }
+       for (i = 0; i < MAX_WEIGHTSYSTEMS; i++) {
+               weightsystem_t *ws = dive->weightsystem + i;
+               add_weightsystem_description(ws);
+       }
 
        return dive;
 }
@@ -677,6 +704,7 @@ struct dive *try_to_merge(struct dive *a, struct dive *b)
        MERGE_TXT(res, a, b, buddy);
        MERGE_TXT(res, a, b, divemaster);
        MERGE_MAX(res, a, b, rating);
+       MERGE_TXT(res, a, b, suit);
        MERGE_MAX(res, a, b, number);
        MERGE_MAX(res, a, b, maxdepth.mm);
        res->meandepth.mm = 0;
diff --git a/dive.h b/dive.h
index de95d5e6614c0d0b05ef77700454b6474de29dce..eb9accb6fd4b8e10d79b18bb07e2467e2d0eb3db 100644 (file)
--- a/dive.h
+++ b/dive.h
@@ -97,8 +97,9 @@ extern int weightsystem_none(void *_data);
 
 extern int get_pressure_units(unsigned int mb, const char **units);
 extern double get_depth_units(unsigned int mm, int *frac, const char **units);
-extern double get_volume_units(unsigned int mm, int *frac, const char **units);
-extern double get_temp_units(unsigned int mm, const char **units);
+extern double get_volume_units(unsigned int ml, int *frac, const char **units);
+extern double get_temp_units(unsigned int mk, const char **units);
+extern double get_weight_units(unsigned int grams, int *frac, const char **units);
 
 static inline double grams_to_lbs(int grams)
 {
@@ -244,6 +245,7 @@ struct dive {
        temperature_t airtemp, watertemp;
        cylinder_t cylinder[MAX_CYLINDERS];
        weightsystem_t weightsystem[MAX_WEIGHTSYSTEMS];
+       char *suit;
        int sac, otu;
        struct event *events;
        int samples, alloc_samples;
@@ -340,8 +342,10 @@ extern void exit_ui(void);
 extern void report_error(GError* error);
 
 extern void add_cylinder_description(cylinder_type_t *);
+extern void add_weightsystem_description(weightsystem_t *);
 extern void add_people(const char *string);
 extern void add_location(const char *string);
+extern void add_suit(const char *string);
 extern void remember_event(const char *eventname);
 extern void evn_foreach(void (*callback)(const char *, int *, void *), void *data);
 
index 5b4ef0a1099678ce8d8bcae3b88125a2290c111e..a85ac7c5ef3ac05eeb0e7bbe2277ff70c82acdf7 100644 (file)
@@ -26,7 +26,7 @@ struct DiveList {
        GtkWidget    *container_widget;
        GtkTreeStore *model, *listmodel, *treemodel;
        GtkTreeViewColumn *nr, *date, *stars, *depth, *duration, *location;
-       GtkTreeViewColumn *temperature, *cylinder, *nitrox, *sac, *otu;
+       GtkTreeViewColumn *temperature, *cylinder, *totalweight, *suit, *nitrox, *sac, *otu;
        int changed;
 };
 
@@ -44,6 +44,8 @@ enum {
        DIVE_DEPTH,             /* int: dive->maxdepth in mm */
        DIVE_DURATION,          /* int: in seconds */
        DIVE_TEMPERATURE,       /* int: in mkelvin */
+       DIVE_TOTALWEIGHT,       /* int: in grams */
+       DIVE_SUIT,              /* "wet, 3mm" */
        DIVE_CYLINDER,
        DIVE_NITROX,            /* int: dummy */
        DIVE_SAC,               /* int: in ml/min */
@@ -404,6 +406,38 @@ newmax:
        *o2low_p = mino2;
 }
 
+static int total_weight(struct dive *dive)
+{
+       int i, total_grams = 0;
+
+       if (dive)
+               for (i=0; i< MAX_WEIGHTSYSTEMS; i++)
+                       total_grams += dive->weightsystem[i].weight.grams;
+       return total_grams;
+}
+
+static void weight_data_func(GtkTreeViewColumn *col,
+                            GtkCellRenderer *renderer,
+                            GtkTreeModel *model,
+                            GtkTreeIter *iter,
+                            gpointer data)
+{
+       int indx, decimals;
+       double value;
+       char buffer[80];
+       struct dive *dive;
+
+       gtk_tree_model_get(model, iter, DIVE_INDEX, &indx, -1);
+       dive = get_dive(indx);
+       value = get_weight_units(total_weight(dive), &decimals, NULL);
+       if (value == 0.0)
+               *buffer = '\0';
+       else
+               snprintf(buffer, sizeof(buffer), "%.*f", decimals, value);
+
+       g_object_set(renderer, "text", buffer, NULL);
+}
+
 static gint nitrox_sort_func(GtkTreeModel *model,
        GtkTreeIter *iter_a,
        GtkTreeIter *iter_b,
@@ -638,6 +672,11 @@ static void get_cylinder(struct dive *dive, char **str)
        get_string(str, dive->cylinder[0].type.description);
 }
 
+static void get_suit(struct dive *dive, char **str)
+{
+       get_string(str, dive->suit);
+}
+
 /*
  * Set up anything that could have changed due to editing
  * of dive information; we need to do this for both models,
@@ -653,11 +692,12 @@ static void fill_one_dive(struct dive *dive,
                          GtkTreeModel *model,
                          GtkTreeIter *iter)
 {
-       char *location, *cylinder;
+       char *location, *cylinder, *suit;
        GtkTreeStore *othermodel;
 
        get_cylinder(dive, &cylinder);
        get_location(dive, &location);
+       get_suit(dive, &suit);
 
        gtk_tree_store_set(GTK_TREE_STORE(model), iter,
                DIVE_NR, dive->number,
@@ -666,7 +706,14 @@ static void fill_one_dive(struct dive *dive,
                DIVE_RATING, dive->rating,
                DIVE_SAC, dive->sac,
                DIVE_OTU, dive->otu,
+               DIVE_TOTALWEIGHT, total_weight(dive),
+               DIVE_SUIT, suit,
                -1);
+
+       free(location);
+       free(cylinder);
+       free(suit);
+
        if (model == GTK_TREE_MODEL(dive_list.treemodel))
                othermodel = dive_list.listmodel;
        else
@@ -723,6 +770,9 @@ void update_dive_list_units(void)
        (void) get_temp_units(0, &unit);
        gtk_tree_view_column_set_title(dive_list.temperature, unit);
 
+       (void) get_weight_units(0, NULL, &unit);
+       gtk_tree_view_column_set_title(dive_list.totalweight, unit);
+
        gtk_tree_model_foreach(model, set_one_dive, NULL);
 }
 
@@ -730,6 +780,8 @@ void update_dive_list_col_visibility(void)
 {
        gtk_tree_view_column_set_visible(dive_list.cylinder, visible_cols.cylinder);
        gtk_tree_view_column_set_visible(dive_list.temperature, visible_cols.temperature);
+       gtk_tree_view_column_set_visible(dive_list.totalweight, visible_cols.totalweight);
+       gtk_tree_view_column_set_visible(dive_list.suit, visible_cols.suit);
        gtk_tree_view_column_set_visible(dive_list.nitrox, visible_cols.nitrox);
        gtk_tree_view_column_set_visible(dive_list.sac, visible_cols.sac);
        gtk_tree_view_column_set_visible(dive_list.otu, visible_cols.otu);
@@ -821,6 +873,8 @@ static void fill_dive_list(void)
                        DIVE_LOCATION, dive->location,
                        DIVE_RATING, dive->rating,
                        DIVE_TEMPERATURE, dive->watertemp.mkelvin,
+                       DIVE_TOTALWEIGHT, 0,
+                       DIVE_SUIT, dive->suit,
                        DIVE_SAC, 0,
                        -1);
        }
@@ -860,6 +914,8 @@ static struct divelist_column {
        [DIVE_DEPTH] = { "ft", depth_data_func, NULL, ALIGN_RIGHT },
        [DIVE_DURATION] = { "min", duration_data_func, NULL, ALIGN_RIGHT },
        [DIVE_TEMPERATURE] = { UTF8_DEGREE "F", temperature_data_func, NULL, ALIGN_RIGHT, &visible_cols.temperature },
+       [DIVE_TOTALWEIGHT] = { "lbs", weight_data_func, NULL, ALIGN_RIGHT, &visible_cols.totalweight },
+       [DIVE_SUIT] = { "Suit", NULL, NULL, ALIGN_LEFT, &visible_cols.suit },
        [DIVE_CYLINDER] = { "Cyl", NULL, NULL, 0, &visible_cols.cylinder },
        [DIVE_NITROX] = { "O" UTF8_SUBSCRIPT_2 "%", nitrox_data_func, nitrox_sort_func, 0, &visible_cols.nitrox },
        [DIVE_SAC] = { "SAC", sac_data_func, NULL, 0, &visible_cols.sac },
@@ -1087,6 +1143,8 @@ GtkWidget *dive_list_create(void)
                                G_TYPE_INT,                     /* Depth */
                                G_TYPE_INT,                     /* Duration */
                                G_TYPE_INT,                     /* Temperature */
+                               G_TYPE_INT,                     /* Total weight */
+                               G_TYPE_STRING,                  /* Suit */
                                G_TYPE_STRING,                  /* Cylinder */
                                G_TYPE_INT,                     /* Nitrox */
                                G_TYPE_INT,                     /* SAC */
@@ -1101,6 +1159,8 @@ GtkWidget *dive_list_create(void)
                                G_TYPE_INT,                     /* Depth */
                                G_TYPE_INT,                     /* Duration */
                                G_TYPE_INT,                     /* Temperature */
+                               G_TYPE_INT,                     /* Total weight */
+                               G_TYPE_STRING,                  /* Suit */
                                G_TYPE_STRING,                  /* Cylinder */
                                G_TYPE_INT,                     /* Nitrox */
                                G_TYPE_INT,                     /* SAC */
@@ -1122,6 +1182,8 @@ GtkWidget *dive_list_create(void)
        dive_list.depth = divelist_column(&dive_list, dl_column + DIVE_DEPTH);
        dive_list.duration = divelist_column(&dive_list, dl_column + DIVE_DURATION);
        dive_list.temperature = divelist_column(&dive_list, dl_column + DIVE_TEMPERATURE);
+       dive_list.totalweight = divelist_column(&dive_list, dl_column + DIVE_TOTALWEIGHT);
+       dive_list.suit = divelist_column(&dive_list, dl_column + DIVE_SUIT);
        dive_list.cylinder = divelist_column(&dive_list, dl_column + DIVE_CYLINDER);
        dive_list.nitrox = divelist_column(&dive_list, dl_column + DIVE_NITROX);
        dive_list.sac = divelist_column(&dive_list, dl_column + DIVE_SAC);
index ccfeb1270c7bb42883acca8e13558ea3f65024c4..71639c9d14b3c0cc7bb4fe1c05183ccbbd62852d 100644 (file)
@@ -309,13 +309,15 @@ static GtkTreeIter *add_weightsystem_type(const char *desc, int weight, GtkTreeI
        model = GTK_TREE_MODEL(weightsystem_model);
        gtk_tree_model_foreach(model, match_desc, (void *)desc);
 
-       if (!found_match) {
-               GtkListStore *store = GTK_LIST_STORE(model);
-
-               gtk_list_store_append(store, iter);
-               gtk_list_store_set(store, iter,
-                       0, desc,
-                       1, weight,
+       if (found_match) {
+               gtk_list_store_set(GTK_LIST_STORE(model), found_match,
+                               WS_WEIGHT, weight,
+                               -1);
+       } else if (desc && desc[0]) {
+               gtk_list_store_append(GTK_LIST_STORE(model), iter);
+               gtk_list_store_set(GTK_LIST_STORE(model), iter,
+                       WS_DESC, desc,
+                       WS_WEIGHT, weight,
                        -1);
                return iter;
        }
@@ -624,6 +626,7 @@ static void record_weightsystem_changes(weightsystem_t *ws, struct ws_widget *we
        GtkComboBox *box;
        int grams;
        double value;
+       GtkTreeIter iter;
 
        /* Ignore uninitialized cylinder widgets */
        box = weightsystem_widget->description;
@@ -639,6 +642,7 @@ static void record_weightsystem_changes(weightsystem_t *ws, struct ws_widget *we
                grams = value * 1000;
        ws->weight.grams = grams;
        ws->description = desc;
+       add_weightsystem_type(desc, grams, &iter);
 }
 
 /*
@@ -745,8 +749,6 @@ static struct ws_info {
        const char *name;
        int grams;
 } ws_info[100] = {
-       /* Need an empty entry for the no weight system case */
-       { "", },
        { "integrated", 0 },
        { "belt", 0 },
        { "ankle", 0 },
index f7d3c500886ad69406efa336547af48daf9c4026..619af2f08ab2aa59125466ce20e3ef8ebaf335f1 100644 (file)
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -348,6 +348,8 @@ OPTIONCALLBACK(otu_toggle, visible_cols.otu)
 OPTIONCALLBACK(sac_toggle, visible_cols.sac)
 OPTIONCALLBACK(nitrox_toggle, visible_cols.nitrox)
 OPTIONCALLBACK(temperature_toggle, visible_cols.temperature)
+OPTIONCALLBACK(totalweight_toggle, visible_cols.totalweight)
+OPTIONCALLBACK(suit_toggle, visible_cols.suit)
 OPTIONCALLBACK(cylinder_toggle, visible_cols.cylinder)
 
 static void event_toggle(GtkWidget *w, gpointer _data)
@@ -434,6 +436,16 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
        gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 6);
        g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(otu_toggle), NULL);
 
+       button = gtk_check_button_new_with_label("Show Weight");
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), visible_cols.totalweight);
+       gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 6);
+       g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(totalweight_toggle), NULL);
+
+       button = gtk_check_button_new_with_label("Show Suit");
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), visible_cols.suit);
+       gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 6);
+       g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(suit_toggle), NULL);
+
        font = gtk_font_button_new_with_font(divelist_font);
        gtk_box_pack_start(GTK_BOX(vbox), font, FALSE, FALSE, 5);
 
@@ -457,6 +469,8 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
                subsurface_set_conf("fahrenheit", PREF_BOOL, BOOL_TO_PTR(output_units.temperature == FAHRENHEIT));
                subsurface_set_conf("lbs", PREF_BOOL, BOOL_TO_PTR(output_units.weight == LBS));
                subsurface_set_conf("TEMPERATURE", PREF_BOOL, BOOL_TO_PTR(visible_cols.temperature));
+               subsurface_set_conf("TOTALWEIGHT", PREF_BOOL, BOOL_TO_PTR(visible_cols.totalweight));
+               subsurface_set_conf("SUIT", PREF_BOOL, BOOL_TO_PTR(visible_cols.suit));
                subsurface_set_conf("CYLINDER", PREF_BOOL, BOOL_TO_PTR(visible_cols.cylinder));
                subsurface_set_conf("NITROX", PREF_BOOL, BOOL_TO_PTR(visible_cols.nitrox));
                subsurface_set_conf("SAC", PREF_BOOL, BOOL_TO_PTR(visible_cols.sac));
@@ -726,6 +740,8 @@ void init_ui(int *argcp, char ***argvp)
        /* an unset key is FALSE - all these are hidden by default */
        visible_cols.cylinder = PTR_TO_BOOL(subsurface_get_conf("CYLINDER", PREF_BOOL));
        visible_cols.temperature = PTR_TO_BOOL(subsurface_get_conf("TEMPERATURE", PREF_BOOL));
+       visible_cols.totalweight = PTR_TO_BOOL(subsurface_get_conf("TOTALWEIGHT", PREF_BOOL));
+       visible_cols.suit = PTR_TO_BOOL(subsurface_get_conf("SUIT", PREF_BOOL));
        visible_cols.nitrox = PTR_TO_BOOL(subsurface_get_conf("NITROX", PREF_BOOL));
        visible_cols.otu = PTR_TO_BOOL(subsurface_get_conf("OTU", PREF_BOOL));
        visible_cols.sac = PTR_TO_BOOL(subsurface_get_conf("SAC", PREF_BOOL));
diff --git a/info.c b/info.c
index 842a150014505b1c31e00164efacac964908874f..1c7b6a9ac7d57bf7f8fd73e134e91eb27eeee1b1 100644 (file)
--- a/info.c
+++ b/info.c
@@ -19,9 +19,9 @@
 #include "display-gtk.h"
 #include "divelist.h"
 
-static GtkEntry *location, *buddy, *divemaster, *rating;
+static GtkEntry *location, *buddy, *divemaster, *rating, *suit;
 static GtkTextView *notes;
-static GtkListStore *location_list, *people_list, *star_list;
+static GtkListStore *location_list, *people_list, *star_list, *suit_list;
 
 static char *get_text(GtkTextView *view)
 {
@@ -96,6 +96,7 @@ void show_dive_info(struct dive *dive)
        SET_TEXT_VALUE(divemaster);
        SET_TEXT_VALUE(buddy);
        SET_TEXT_VALUE(location);
+       SET_TEXT_VALUE(suit);
        gtk_entry_set_text(rating, star_strings[dive->rating]);
        gtk_text_buffer_set_text(gtk_text_view_get_buffer(notes),
                dive && dive->notes ? dive->notes : "", -1);
@@ -242,6 +243,8 @@ static gboolean match_string_entry(GtkTreeModel *model, GtkTreePath *path, GtkTr
 
        gtk_tree_model_get(model, iter, 0, &entry, -1);
        cmp = strcmp(entry, string);
+       if (entry)
+               free(entry);
 
        /* Stop. The entry is bigger than the new one */
        if (cmp > 0)
@@ -296,6 +299,11 @@ void add_location(const char *string)
        add_string_list_entry(string, location_list);
 }
 
+void add_suit(const char *string)
+{
+       add_string_list_entry(string, suit_list);
+}
+
 static int get_rating(const char *string)
 {
        int rating_val = 0;
@@ -308,7 +316,7 @@ static int get_rating(const char *string)
 }
 
 struct dive_info {
-       GtkComboBoxEntry *location, *divemaster, *buddy, *rating;
+       GtkComboBoxEntry *location, *divemaster, *buddy, *rating, *suit;
        GtkTextView *notes;
 };
 
@@ -336,6 +344,12 @@ static void save_dive_info_changes(struct dive *dive, struct dive_info *info)
                changed = 1;
        }
 
+       new_text = get_combo_box_entry_text(info->suit, &dive->suit);
+       if (new_text) {
+               add_suit(new_text);
+               changed = 1;
+       }
+
        rating_string = strdup(star_strings[dive->rating]);
        new_text = get_combo_box_entry_text(info->rating, &rating_string);
        if (new_text) {
@@ -380,6 +394,7 @@ static void dive_info_widget(GtkWidget *box, struct dive *dive, struct dive_info
        gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, TRUE, 0);
 
        info->rating = text_entry(hbox, "Rating", star_list, star_strings[dive->rating]);
+       info->suit = text_entry(hbox, "Suit", suit_list, dive->suit);
 
        /* only show notes if editing a single dive */
        if (multi) {
@@ -619,6 +634,7 @@ GtkWidget *extended_dive_info_widget(void)
        add_string_list_entry(THREE_STARS, star_list);
        add_string_list_entry(FOUR_STARS, star_list);
        add_string_list_entry(FIVE_STARS, star_list);
+       suit_list = gtk_list_store_new(1, G_TYPE_STRING);
 
        gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
        location = text_value(vbox, "Location");
@@ -633,6 +649,7 @@ GtkWidget *extended_dive_info_widget(void)
        gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
 
        rating = text_value(hbox, "Rating");
+       suit = text_value(hbox, "Suit");
 
        notes = text_view(vbox, "Notes", READ_ONLY);
        return vbox;
index d6fc953a7cbc075bd2317ee24ce8c61314b03aea..a36758ca0e72da72e85904cce1fee4001ff0c025 100644 (file)
@@ -1100,6 +1100,8 @@ static void try_to_fill_dive(struct dive **divep, const char *name, char *buf)
                return;
        if (MATCH(".location", utf8_string, &dive->location))
                return;
+       if (MATCH(".suit", utf8_string, &dive->suit))
+               return;
        if (MATCH(".notes", utf8_string, &dive->notes))
                return;
        if (MATCH(".divemaster", utf8_string, &dive->divemaster))
index ed55c022d4bf971e1d10802cf38c5399830ea98d..37d6d062eabf836f188b8cfc2bcd0b6feae0c6a4 100644 (file)
@@ -183,6 +183,7 @@ static void save_overview(FILE *f, struct dive *dive)
        show_utf8(f, dive->divemaster, "  <divemaster>","</divemaster>\n");
        show_utf8(f, dive->buddy, "  <buddy>","</buddy>\n");
        show_utf8(f, dive->notes, "  <notes>","</notes>\n");
+       show_utf8(f, dive->suit, "  <suit>","</suit>\n");
 }
 
 static void save_cylinder_info(FILE *f, struct dive *dive)