diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-13 15:41:05 -0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-13 15:41:05 -0200 |
commit | ede70c03b0cff83f1d740204127fe594b8c378ec (patch) | |
tree | 7738fcbafd66a252e84a717da04af8881ab83bd7 /equipment.c | |
parent | f967d6fb26321d07bd61769ae3c793f97b203b94 (diff) | |
parent | 97a1dd68306de17aa73be092d2bcf174e8158f62 (diff) | |
download | subsurface-ede70c03b0cff83f1d740204127fe594b8c378ec.tar.gz |
Merge branch 'forlinus' of git://github.com/dirkhh/subsurface
* 'forlinus' of git://github.com/dirkhh/subsurface:
Make sure SAC and OTU get recalculated after cylinder info was changed
Diffstat (limited to 'equipment.c')
-rw-r--r-- | equipment.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/equipment.c b/equipment.c index 19abbe672..dbe1f0f13 100644 --- a/equipment.c +++ b/equipment.c @@ -416,12 +416,14 @@ static void record_cylinder_changes(cylinder_t *cyl, struct cylinder_widget *cyl desc = gtk_combo_box_get_active_text(box); volume = gtk_spin_button_get_value(cylinder->size); pressure = gtk_spin_button_get_value(cylinder->pressure); - start = gtk_spin_button_get_value(GTK_SPIN_BUTTON(cylinder->start)); - end = gtk_spin_button_get_value(GTK_SPIN_BUTTON(cylinder->end)); - if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cylinder->pressure_button))) + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cylinder->pressure_button))) { + start = gtk_spin_button_get_value(GTK_SPIN_BUTTON(cylinder->start)); + end = gtk_spin_button_get_value(GTK_SPIN_BUTTON(cylinder->end)); + } else start = end = 0; - o2 = gtk_spin_button_get_value(GTK_SPIN_BUTTON(cylinder->o2))*10 + 0.5; - if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cylinder->gasmix_button))) + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cylinder->gasmix_button))) + o2 = gtk_spin_button_get_value(GTK_SPIN_BUTTON(cylinder->o2))*10 + 0.5; + else o2 = 0; fill_cylinder_info(cylinder, cyl, desc, volume, pressure, start, end, o2); } @@ -643,6 +645,7 @@ static int edit_cylinder_dialog(int index, cylinder_t *cyl) record_cylinder_changes(cyl, &cylinder); dive->cylinder[index] = *cyl; mark_divelist_changed(TRUE); + update_cylinder_related_info(dive); flush_divelist(dive); } |