X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=gtk-gui.c;h=1e053e52b22837b3ed9df9554b337e25bf9da749;hb=8add7917ce9da2faa7751798c3fb15a24715ae1e;hp=6f48c734f06d990e0f70e005a6af37068ce519fd;hpb=725e4582d9c7174b70fe197bb27345960457549e;p=ext%2Fsubsurface.git
diff --git a/gtk-gui.c b/gtk-gui.c
index 6f48c73..1e053e5 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -31,6 +31,39 @@ static GtkWidget *dive_profile;
visible_cols_t visible_cols = {TRUE, FALSE};
+static const char *default_dive_computer;
+static const char *default_dive_computer_device;
+
+static int is_default_dive_computer(const char *name)
+{
+ return default_dive_computer && !strcmp(name, default_dive_computer);
+}
+
+static int is_default_dive_computer_device(const char *name)
+{
+ return default_dive_computer_device && !strcmp(name, default_dive_computer_device);
+}
+
+static void set_default_dive_computer(const char *name)
+{
+ if (!name || !*name)
+ return;
+ if (is_default_dive_computer(name))
+ return;
+ default_dive_computer = name;
+ subsurface_set_conf("dive_computer", PREF_STRING, name);
+}
+
+static void set_default_dive_computer_device(const char *name)
+{
+ if (!name || !*name)
+ return;
+ if (is_default_dive_computer_device(name))
+ return;
+ default_dive_computer_device = name;
+ subsurface_set_conf("dive_computer_device", PREF_STRING, name);
+}
+
void repaint_dive(void)
{
update_dive(current_dive);
@@ -607,13 +640,13 @@ static const gchar* ui_string = " \
\
\
\
- \
- \
\
- \
+ \
\
\