diff options
author | Lakshman <acrlakshman@gmail.com> | 2014-03-27 13:38:07 -0500 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-28 09:38:08 -0700 |
commit | 7696fbf9cdb6292f487815bffdbc879a178cc73f (patch) | |
tree | 9effff5194d0576daa81f35359d2d54f70892889 /qt-ui | |
parent | df7d7d498118c85b2bee40af5242852770c11e43 (diff) | |
download | subsurface-7696fbf9cdb6292f487815bffdbc879a178cc73f.tar.gz |
Toggle showing average depth
Add additional check box in "preferences->graph" section that allows
users to hide average depth on dive profile.
By default this option is checked to show average depth.
Fixes #475
Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/preferences.cpp | 3 | ||||
-rw-r--r-- | qt-ui/preferences.ui | 13 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 4 |
3 files changed, 19 insertions, 1 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index e2473d66b..7c74b15a6 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -88,6 +88,7 @@ void PreferencesDialog::setUiFromPrefs() } ui.displayinvalid->setChecked(prefs.display_invalid_dives); ui.display_unused_tanks->setChecked(prefs.display_unused_tanks); + ui.show_average_depth->setChecked(prefs.show_average_depth); ui.vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES); ui.vertical_speed_seconds->setChecked(prefs.units.vertical_speed_time == units::SECONDS); @@ -184,6 +185,7 @@ void PreferencesDialog::syncSettings() s.setValue("gfhigh", ui.gfhigh->value()); SB("gf_low_at_maxdepth", ui.gf_low_at_maxdepth); SB("display_unused_tanks", ui.display_unused_tanks); + SB("show_average_depth", ui.show_average_depth); s.endGroup(); // Units @@ -278,6 +280,7 @@ void PreferencesDialog::loadSettings() set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth); GET_BOOL("show_sac", show_sac); GET_BOOL("display_unused_tanks", display_unused_tanks); + GET_BOOL("show_average_depth", show_average_depth); s.endGroup(); s.beginGroup("GeneralSettings"); diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui index e0bd4c27d..06e000141 100644 --- a/qt-ui/preferences.ui +++ b/qt-ui/preferences.ui @@ -657,7 +657,18 @@ </widget> </item> </layout> - </item> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_11d"> + <item> + <widget class="QCheckBox" name="show_average_depth"> + <property name="text"> + <string>show average depth</string> + </property> + </widget> + </item> + </layout> + </item> </layout> </widget> </item> diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index ef52e2884..a58244689 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -429,6 +429,10 @@ void ProfileWidget2::plotDives(QList<dive *> dives) cylinderPressureAxis->setMaximum(pInfo.maxpressure); rulerItem->setPlotInfo(pInfo); + if (prefs.show_average_depth) + meanDepth->setVisible(true); + else + meanDepth->setVisible(false); meanDepth->setMeanDepth(pInfo.meandepth); meanDepth->setLine(0, 0, timeAxis->posAtValue(d->duration.seconds), 0); meanDepth->animateMoveTo(3, profileYAxis->posAtValue(pInfo.meandepth)); |