summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2019-01-29 14:27:27 +0100
committerGravatar Robert C. Helling <helling@atdotde.de>2019-02-05 14:18:14 +0100
commitc9d8b4f605d55b99ec41ec1eaa008118889261c3 (patch)
tree5b279ab8ef3a4cf280701a975033625ef95b1b0d /core
parent2eebbfa3a4ee692df3ba84ae01bf390a6b83e6de (diff)
downloadsubsurface-c9d8b4f605d55b99ec41ec1eaa008118889261c3.tar.gz
Add button to toggle deco info in info box
The info box can get longish. Offer the user to turn off display of deco information (surface GF and individual ceilings). Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core')
-rw-r--r--core/pref.h1
-rw-r--r--core/profile.c24
-rw-r--r--core/settings/qPrefTechnicalDetails.cpp2
-rw-r--r--core/settings/qPrefTechnicalDetails.h5
-rw-r--r--core/subsurfacestartup.c1
5 files changed, 22 insertions, 11 deletions
diff --git a/core/pref.h b/core/pref.h
index ee297780f..6acbc8f6a 100644
--- a/core/pref.h
+++ b/core/pref.h
@@ -176,6 +176,7 @@ struct preferences {
bool calcceiling;
bool calcceiling3m;
bool calcndltts;
+ bool decoinfo; // Show deco info in infobox
bool dcceiling;
enum deco_mode display_deco_mode;
bool display_unused_tanks;
diff --git a/core/profile.c b/core/profile.c
index e9a8b6fe9..b8c81e195 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -1504,17 +1504,19 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me
}
if (entry->rbt)
put_format_loc(b, translate("gettextFromC", "RBT: %umin\n"), DIV_UP(entry->rbt, 60));
- if (entry->surface_gf > 0)
- put_format(b, translate("gettextFromC", "Surface GF %.0f%%\n"), entry->surface_gf);
- if (entry->ceiling) {
- depthvalue = get_depth_units(entry->ceiling, NULL, &depth_unit);
- put_format_loc(b, translate("gettextFromC", "Calculated ceiling %.0f%s\n"), depthvalue, depth_unit);
- if (prefs.calcalltissues) {
- int k;
- for (k = 0; k < 16; k++) {
- if (entry->ceilings[k]) {
- depthvalue = get_depth_units(entry->ceilings[k], NULL, &depth_unit);
- put_format_loc(b, translate("gettextFromC", "Tissue %.0fmin: %.1f%s\n"), buehlmann_N2_t_halflife[k], depthvalue, depth_unit);
+ if (prefs.decoinfo) {
+ if (entry->surface_gf > 0)
+ put_format(b, translate("gettextFromC", "Surface GF %.0f%%\n"), entry->surface_gf);
+ if (entry->ceiling) {
+ depthvalue = get_depth_units(entry->ceiling, NULL, &depth_unit);
+ put_format_loc(b, translate("gettextFromC", "Calculated ceiling %.0f%s\n"), depthvalue, depth_unit);
+ if (prefs.calcalltissues) {
+ int k;
+ for (k = 0; k < 16; k++) {
+ if (entry->ceilings[k]) {
+ depthvalue = get_depth_units(entry->ceilings[k], NULL, &depth_unit);
+ put_format_loc(b, translate("gettextFromC", "Tissue %.0fmin: %.1f%s\n"), buehlmann_N2_t_halflife[k], depthvalue, depth_unit);
+ }
}
}
}
diff --git a/core/settings/qPrefTechnicalDetails.cpp b/core/settings/qPrefTechnicalDetails.cpp
index fcc77863a..78e2c13d0 100644
--- a/core/settings/qPrefTechnicalDetails.cpp
+++ b/core/settings/qPrefTechnicalDetails.cpp
@@ -56,6 +56,8 @@ HANDLE_PREFERENCE_BOOL(TechnicalDetails, "calcceiling3m", calcceiling3m);
HANDLE_PREFERENCE_BOOL(TechnicalDetails, "calcndltts", calcndltts);
+HANDLE_PREFERENCE_BOOL(TechnicalDetails, "decoinfo", decoinfo);
+
HANDLE_PREFERENCE_BOOL(TechnicalDetails, "dcceiling", dcceiling);
HANDLE_PREFERENCE_ENUM(TechnicalDetails, deco_mode, "display_deco_mode", display_deco_mode);
diff --git a/core/settings/qPrefTechnicalDetails.h b/core/settings/qPrefTechnicalDetails.h
index bf82f2099..de439815a 100644
--- a/core/settings/qPrefTechnicalDetails.h
+++ b/core/settings/qPrefTechnicalDetails.h
@@ -12,6 +12,7 @@ class qPrefTechnicalDetails : public QObject {
Q_PROPERTY(bool calcceiling READ calcceiling WRITE set_calcceiling NOTIFY calcceilingChanged);
Q_PROPERTY(bool calcceiling3m READ calcceiling3m WRITE set_calcceiling3m NOTIFY calcceiling3mChanged);
Q_PROPERTY(bool calcndltts READ calcndltts WRITE set_calcndltts NOTIFY calcndlttsChanged);
+ Q_PROPERTY(bool decoinfo READ decoinfo WRITE set_decoinfo NOTIFY decoinfoChanged);
Q_PROPERTY(bool dcceiling READ dcceiling WRITE set_dcceiling NOTIFY dcceilingChanged);
Q_PROPERTY(deco_mode display_deco_mode READ display_deco_mode WRITE set_display_deco_mode NOTIFY display_deco_modeChanged);
Q_PROPERTY(bool display_unused_tanks READ display_unused_tanks WRITE set_display_unused_tanks NOTIFY display_unused_tanksChanged);
@@ -50,6 +51,7 @@ public:
static bool calcceiling() { return prefs.calcceiling; }
static bool calcceiling3m() { return prefs.calcceiling3m; }
static bool calcndltts() { return prefs.calcndltts; }
+ static bool decoinfo() { return prefs.decoinfo; }
static bool dcceiling() { return prefs.dcceiling; }
static deco_mode display_deco_mode() { return prefs.display_deco_mode; }
static bool display_unused_tanks() { return prefs.display_unused_tanks; }
@@ -79,6 +81,7 @@ public slots:
static void set_calcceiling(bool value);
static void set_calcceiling3m(bool value);
static void set_calcndltts(bool value);
+ static void set_decoinfo(bool value);
static void set_dcceiling(bool value);
static void set_display_deco_mode(deco_mode value);
static void set_display_unused_tanks(bool value);
@@ -108,6 +111,7 @@ signals:
void calcceilingChanged(bool value);
void calcceiling3mChanged(bool value);
void calcndlttsChanged(bool value);
+ void decoinfoChanged(bool value);
void dcceilingChanged(bool value);
void display_deco_modeChanged(deco_mode value);
void display_unused_tanksChanged(bool value);
@@ -137,6 +141,7 @@ private:
static void disk_calcceiling(bool doSync);
static void disk_calcceiling3m(bool doSync);
static void disk_calcndltts(bool doSync);
+ static void disk_decoinfo(bool doSync);
static void disk_dcceiling(bool doSync);
static void disk_display_deco_mode(bool doSync);
static void disk_display_unused_tanks(bool doSync);
diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c
index 3669cc8ec..4acf86a17 100644
--- a/core/subsurfacestartup.c
+++ b/core/subsurfacestartup.c
@@ -34,6 +34,7 @@ struct preferences default_prefs = {
.calcceiling = false,
.calcceiling3m = false,
.calcndltts = false,
+ .decoinfo = true,
.gflow = 30,
.gfhigh = 75,
.animation_speed = 500,