diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-05-06 13:44:22 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-05-06 13:49:36 -0700 |
commit | 876b479d695acda652e7b6c81c6b899946d42a85 (patch) | |
tree | cc01ab6c306c94e0d542fd43000d11f62e056cd8 /core/prefs-macros.h | |
parent | 38b9185974e4f5199ee8f65bac97dab76b058e41 (diff) | |
download | subsurface-876b479d695acda652e7b6c81c6b899946d42a85.tar.gz |
Wire up duration units preference UI
Now we track the preference, but we don't act on it, yet.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/prefs-macros.h')
-rw-r--r-- | core/prefs-macros.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/prefs-macros.h b/core/prefs-macros.h index bd1fc9a33..9208fb82e 100644 --- a/core/prefs-macros.h +++ b/core/prefs-macros.h @@ -11,6 +11,13 @@ else \ prefs.units.field = default_prefs.units.field +#define GET_UNIT3(name, field, f, l, type) \ + v = s.value(QString(name)); \ + if (v.isValid() && v.toInt() >= (f) && v.toInt() <= (l)) \ + prefs.units.field = (type)v.toInt(); \ + else \ + prefs.units.field = default_prefs.units.field + #define GET_BOOL(name, field) \ v = s.value(QString(name)); \ if (v.isValid()) \ |