diff options
Diffstat (limited to 'planner-gtk.c')
-rw-r--r-- | planner-gtk.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/planner-gtk.c b/planner-gtk.c index 1b99fb391..d5fddec46 100644 --- a/planner-gtk.c +++ b/planner-gtk.c @@ -253,6 +253,16 @@ static gboolean gf_focus_out_cb(GtkWidget *entry, GdkEvent * event, gpointer dat return FALSE; } +static gboolean last_stop_toggled_cb(GtkWidget *entry, GdkEvent * event, gpointer data) +{ + char *error_string = NULL; + set_last_stop(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entry))); + show_planned_dive(&error_string); + if (error_string) + show_error(error_string); + return FALSE; +} + static GtkWidget *add_gas_combobox_to_box(GtkWidget *box, const char *label, int idx) { GtkWidget *frame, *combo; @@ -382,6 +392,17 @@ void input_plan() add_entry_with_callback(hbox, 12, _("Dive starts when?"), "+60:00", starttime_focus_out_cb, NULL); add_entry_with_callback(hbox, 12, _("Surface Pressure (mbar)"), SURFACE_PRESSURE_STRING, surfpres_focus_out_cb, NULL); + if (get_units()->length == METERS) + labeltext = _("Last stop at 6 Meters"); + else + labeltext = _("Last stop at 20 Feet"); + + set_last_stop(FALSE); + content = gtk_check_button_new_with_label(labeltext); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(content), 0); + gtk_box_pack_start(GTK_BOX(hbox), content, FALSE, FALSE, 6); + g_signal_connect(G_OBJECT(content), "toggled", G_CALLBACK(last_stop_toggled_cb), NULL); + hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); if (get_units()->volume == CUFT) { |