summaryrefslogtreecommitdiffstats
path: root/display-gtk.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-10 09:20:57 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-10 10:26:06 -0800
commit92c0d8c5160232642571b52b66176594c796f21d (patch)
treed3b78a6deba3af0119b493dbfd0a8ec8c4a13304 /display-gtk.h
parent54919c1c4ec94cd21150c5320fa0956d13df5904 (diff)
downloadsubsurface-92c0d8c5160232642571b52b66176594c796f21d.tar.gz
Move global variables covered by Preferences into one structure
Now we can simply remember the state of all the preferences at the beginning of preferences_dialog() and restore them if the user presses 'Cancel'. Fixes #21 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'display-gtk.h')
-rw-r--r--display-gtk.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/display-gtk.h b/display-gtk.h
index 3e12d8051..36895b7c8 100644
--- a/display-gtk.h
+++ b/display-gtk.h
@@ -30,11 +30,16 @@ typedef struct {
double phe_threshold;
} partial_pressure_graphs_t;
-extern visible_cols_t visible_cols;
-extern partial_pressure_graphs_t partial_pressure_graphs;
-extern gboolean profile_red_ceiling;
+struct preferences {
+ struct units output_units;
+ visible_cols_t visible_cols;
+ partial_pressure_graphs_t pp_graphs;
+ gboolean profile_red_ceiling;
+};
-#define GRAPHS_ENABLED (partial_pressure_graphs.po2 || partial_pressure_graphs.pn2 || partial_pressure_graphs.phe)
+extern struct preferences prefs;
+
+#define PP_GRAPHS_ENABLED (prefs.pp_graphs.po2 || prefs.pp_graphs.pn2 || prefs.pp_graphs.phe)
typedef enum {
PREF_BOOL,