summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-27 15:36:27 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-27 15:36:27 -0700
commitc89f88378a0a19d6b7e0771b6fd8dc31acfaf2f7 (patch)
tree643795a8127b7fea2813f999148c1467cc5b4537 /gtk-gui.c
parenta44d0049f6370d022067b8aee5e847f9fe550cf1 (diff)
parent9cf961249e197d6d8a3656968ce15dfd19e3ef3b (diff)
downloadsubsurface-c89f88378a0a19d6b7e0771b6fd8dc31acfaf2f7.tar.gz
Merge branch 'trips' of git://git.hohndel.org/subsurface
Merge the initial 'track trips explicitly' code from Dirk Hohndel. Fix up trivial conflicts in save-xml.c due to the new 'is_attribute' flag. * 'trips' of git://git.hohndel.org/subsurface: Fix an issue with trips that have dives from multiple input files Some simple test dives for the trips code First cut of explicit trip tracking
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 895ef4493..bc8e6e000 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -428,6 +428,7 @@ OPTIONCALLBACK(temperature_toggle, visible_cols.temperature)
OPTIONCALLBACK(totalweight_toggle, visible_cols.totalweight)
OPTIONCALLBACK(suit_toggle, visible_cols.suit)
OPTIONCALLBACK(cylinder_toggle, visible_cols.cylinder)
+OPTIONCALLBACK(autogroup_toggle, autogroup)
static void event_toggle(GtkWidget *w, gpointer _data)
{
@@ -523,8 +524,22 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 6);
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(suit_toggle), NULL);
+ frame = gtk_frame_new("Divelist Font");
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), frame, FALSE, FALSE, 5);
+
font = gtk_font_button_new_with_font(divelist_font);
- gtk_box_pack_start(GTK_BOX(vbox), font, FALSE, FALSE, 5);
+ gtk_container_add(GTK_CONTAINER(frame),font);
+
+ frame = gtk_frame_new("Misc. Options");
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), frame, FALSE, FALSE, 5);
+
+ box = gtk_hbox_new(FALSE, 6);
+ gtk_container_add(GTK_CONTAINER(frame), box);
+
+ button = gtk_check_button_new_with_label("Automatically group dives in trips");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), autogroup);
+ gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 6);
+ g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(autogroup_toggle), NULL);
gtk_widget_show_all(dialog);
result = gtk_dialog_run(GTK_DIALOG(dialog));
@@ -553,6 +568,7 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
subsurface_set_conf("SAC", PREF_BOOL, BOOL_TO_PTR(visible_cols.sac));
subsurface_set_conf("OTU", PREF_BOOL, BOOL_TO_PTR(visible_cols.otu));
subsurface_set_conf("divelist_font", PREF_STRING, divelist_font);
+ subsurface_set_conf("autogroup", PREF_BOOL, BOOL_TO_PTR(autogroup));
/* Flush the changes out to the system */
subsurface_flush_conf();
@@ -833,6 +849,8 @@ void init_ui(int *argcp, char ***argvp)
divelist_font = subsurface_get_conf("divelist_font", PREF_STRING);
+ autogroup = PTR_TO_BOOL(subsurface_get_conf("autogroup", PREF_BOOL));
+
default_dive_computer_vendor = subsurface_get_conf("dive_computer_vendor", PREF_STRING);
default_dive_computer_product = subsurface_get_conf("dive_computer_product", PREF_STRING);
default_dive_computer_device = subsurface_get_conf("dive_computer_device", PREF_STRING);