diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-12-10 09:20:57 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-12-10 10:26:06 -0800 |
commit | 92c0d8c5160232642571b52b66176594c796f21d (patch) | |
tree | d3b78a6deba3af0119b493dbfd0a8ec8c4a13304 /info.c | |
parent | 54919c1c4ec94cd21150c5320fa0956d13df5904 (diff) | |
download | subsurface-92c0d8c5160232642571b52b66176594c796f21d.tar.gz |
Move global variables covered by Preferences into one structure
Now we can simply remember the state of all the preferences at the
beginning of preferences_dialog() and restore them if the user presses
'Cancel'.
Fixes #21
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r-- | info.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -455,7 +455,7 @@ static void save_dive_info_changes(struct dive *dive, struct dive *master, struc new_text = (char *)gtk_entry_get_text(info->airtemp); if(sscanf(new_text, "%lf", &newtemp) == 1) { unsigned long mkelvin; - switch (output_units.temperature) { + switch (prefs.output_units.temperature) { case CELSIUS: mkelvin = C_to_mkelvin(newtemp); break; @@ -890,8 +890,8 @@ static timestamp_t dive_time_widget(struct dive *dive) gtk_box_pack_end(GTK_BOX(box), duration, FALSE, FALSE, 0); /* Depth box */ - box = frame_box(hbox, _("Depth (%s):"), output_units.length == FEET ? _("ft") : _("m")); - if (output_units.length == FEET) { + box = frame_box(hbox, _("Depth (%s):"), prefs.output_units.length == FEET ? _("ft") : _("m")); + if (prefs.output_units.length == FEET) { depthinterval = 1.0; } else { depthinterval = 0.1; @@ -917,7 +917,7 @@ static timestamp_t dive_time_widget(struct dive *dive) tm.tm_min = gtk_spin_button_get_value(GTK_SPIN_BUTTON(m)); val = gtk_spin_button_get_value(GTK_SPIN_BUTTON(depth)); - if (output_units.length == FEET) { + if (prefs.output_units.length == FEET) { dive->maxdepth.mm = feet_to_mm(val); } else { dive->maxdepth.mm = val * 1000 + 0.5; |