summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-27 11:05:39 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-27 11:05:39 -0700
commit30ee87be92f0a0fffc98106852d9623a65dfe4ed (patch)
tree8a2f2f8ee4ce9c6db1167269bad04ff369a38a5d /divelist.c
parent1bf28b68c9dc9b929b1372b79920311a9c10e4cc (diff)
parentf3134cbb8995267e6a18b9564f3022e7fe7314a9 (diff)
downloadsubsurface-30ee87be92f0a0fffc98106852d9623a65dfe4ed.tar.gz
Merge branch 'otu-tracking-v2' of git://github.com/dirkhh/subsurface
* 'otu-tracking-v2' of git://github.com/dirkhh/subsurface: Store options in gconf Add preference option to chose if SAC and/or OTU should be in divelist Fix up trivial conflicts in gtk-gui.c (cleanup in gtk dialog wrt gtk_dialog_get_content_area() having introduced a new 'vbox' widget)
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/divelist.c b/divelist.c
index bb2a3e3a1..b43adfd0c 100644
--- a/divelist.c
+++ b/divelist.c
@@ -26,7 +26,7 @@ struct DiveList {
GtkWidget *container_widget;
GtkListStore *model;
GtkTreeViewColumn *date, *depth, *duration, *location;
- GtkTreeViewColumn *temperature, *cylinder, *nitrox, *sac;
+ GtkTreeViewColumn *temperature, *cylinder, *nitrox, *sac, *otu;
int changed;
};
@@ -422,6 +422,13 @@ void update_dive_list_units(void)
gtk_tree_model_foreach(model, set_one_dive, NULL);
}
+void update_dive_list_col_visibility(void)
+{
+ gtk_tree_view_column_set_visible(dive_list.sac, visible_cols.sac);
+ gtk_tree_view_column_set_visible(dive_list.otu, visible_cols.otu);
+ return;
+}
+
static void fill_dive_list(void)
{
int i;
@@ -543,8 +550,8 @@ GtkWidget *dive_list_create(void)
dive_list.temperature = divelist_column(&dive_list, DIVE_TEMPERATURE, UTF8_DEGREE "F", temperature_data_func, PANGO_ALIGN_RIGHT, TRUE);
dive_list.cylinder = divelist_column(&dive_list, DIVE_CYLINDER, "Cyl", NULL, PANGO_ALIGN_CENTER, TRUE);
dive_list.nitrox = divelist_column(&dive_list, DIVE_NITROX, "O" UTF8_SUBSCRIPT_2 "%", nitrox_data_func, PANGO_ALIGN_CENTER, TRUE);
- dive_list.sac = divelist_column(&dive_list, DIVE_SAC, "SAC", sac_data_func, PANGO_ALIGN_CENTER, TRUE);
- dive_list.sac = divelist_column(&dive_list, DIVE_OTU, "OTU", otu_data_func, PANGO_ALIGN_CENTER, FALSE);
+ dive_list.sac = divelist_column(&dive_list, DIVE_SAC, "SAC", sac_data_func, PANGO_ALIGN_CENTER, visible_cols.sac);
+ dive_list.otu = divelist_column(&dive_list, DIVE_OTU, "OTU", otu_data_func, PANGO_ALIGN_CENTER, visible_cols.otu);
dive_list.location = divelist_column(&dive_list, DIVE_LOCATION, "Location", NULL, PANGO_ALIGN_LEFT, TRUE);
fill_dive_list();