summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-12-23 19:41:16 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-03-24 11:44:27 +0900
commit854bd0269c05adc56caf9667fd68f676520a2941 (patch)
treedce09bb7d37cd43f14d4924f28101bb1bde21e04 /gtk-gui.c
parentb5139aeb22c8a28cac89b7f9a561bd9d4e2bb358 (diff)
downloadsubsurface-854bd0269c05adc56caf9667fd68f676520a2941.tar.gz
Add weight system tracking
- supports multiple weight systems per dive - supports multiple weight system types - supports import of weight as tracked by DivingLog Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 41e862eb9..371a0308f 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -296,6 +296,8 @@ UNITCALLBACK(set_liter, volume, LITER)
UNITCALLBACK(set_cuft, volume, CUFT)
UNITCALLBACK(set_celsius, temperature, CELSIUS)
UNITCALLBACK(set_fahrenheit, temperature, FAHRENHEIT)
+UNITCALLBACK(set_kg, weight, KG)
+UNITCALLBACK(set_lbs, weight, LBS)
#define OPTIONCALLBACK(name, option) \
static void name(GtkWidget *w, gpointer data) \
@@ -357,6 +359,11 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
"Fahrenheit", set_fahrenheit, (output_units.temperature == FAHRENHEIT),
NULL);
+ create_radio(box, "Weight:",
+ "kg", set_kg, (output_units.weight == KG),
+ "lbs", set_lbs, (output_units.weight == LBS),
+ NULL);
+
frame = gtk_frame_new("Columns");
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), frame, FALSE, FALSE, 5);
@@ -409,6 +416,7 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
subsurface_set_conf("psi", PREF_BOOL, BOOL_TO_PTR(output_units.pressure == PSI));
subsurface_set_conf("cuft", PREF_BOOL, BOOL_TO_PTR(output_units.volume == CUFT));
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("CYLINDER", PREF_BOOL, BOOL_TO_PTR(visible_cols.cylinder));
subsurface_set_conf("NITROX", PREF_BOOL, BOOL_TO_PTR(visible_cols.nitrox));
@@ -676,6 +684,8 @@ void init_ui(int *argcp, char ***argvp)
output_units.volume = CUFT;
if (subsurface_get_conf("fahrenheit", PREF_BOOL))
output_units.temperature = FAHRENHEIT;
+ if (subsurface_get_conf("lbs", PREF_BOOL))
+ output_units.weight = LBS;
/* 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));