desc = gtk_combo_box_get_active_text(box);
volume = gtk_spin_button_get_value(cylinder->size);
pressure = gtk_spin_button_get_value(cylinder->pressure);
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 {
- 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);
}
o2 = 0;
fill_cylinder_info(cylinder, cyl, desc, volume, pressure, start, end, o2);
}
/*
* We hardcode the most common standard cylinders,
* we should pick up any other names from the dive
/*
* We hardcode the most common standard cylinders,
* we should pick up any other names from the dive
record_cylinder_changes(cyl, &cylinder);
dive->cylinder[index] = *cyl;
mark_divelist_changed(TRUE);
record_cylinder_changes(cyl, &cylinder);
dive->cylinder[index] = *cyl;
mark_divelist_changed(TRUE);
g_signal_connect(tree_view, "row-activated", G_CALLBACK(row_activated_cb), model);
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
g_signal_connect(tree_view, "row-activated", G_CALLBACK(row_activated_cb), model);
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));