- cylinder_t *cyl = &dive->cylinder[0];
- const char *desc = cyl->type.description;
- GtkTreeModel *model = gtk_combo_box_get_model(cylinder_description);
+ GtkTreeModel *model;
+
+ found_match = 0;
+ model = gtk_combo_box_get_model(cylinder->description);
+ cylinder->name = desc;
+ gtk_tree_model_foreach(model, match_cylinder, cylinder);
+
+ if (!found_match) {
+ GtkListStore *store = GTK_LIST_STORE(model);
+ GtkTreeIter iter;
+
+ gtk_list_store_append(store, &iter);
+ gtk_list_store_set(store, &iter,
+ 0, desc,
+ 1, ml,
+ 2, mbar,
+ -1);
+ gtk_combo_box_set_active_iter(cylinder->description, &iter);
+ }
+}
+
+static void show_cylinder(cylinder_t *cyl, struct cylinder_widget *cylinder)
+{
+ const char *desc;
+ int ml, mbar;