mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
df7d7d4981
commit
7696fbf9cd
5 changed files with 21 additions and 1 deletions
1
pref.h
1
pref.h
|
@ -39,6 +39,7 @@ struct preferences {
|
||||||
struct units units;
|
struct units units;
|
||||||
short show_sac;
|
short show_sac;
|
||||||
bool display_unused_tanks;
|
bool display_unused_tanks;
|
||||||
|
bool show_average_depth;
|
||||||
bool zoomed_plot;
|
bool zoomed_plot;
|
||||||
bool text_label_with_units;
|
bool text_label_with_units;
|
||||||
};
|
};
|
||||||
|
|
|
@ -88,6 +88,7 @@ void PreferencesDialog::setUiFromPrefs()
|
||||||
}
|
}
|
||||||
ui.displayinvalid->setChecked(prefs.display_invalid_dives);
|
ui.displayinvalid->setChecked(prefs.display_invalid_dives);
|
||||||
ui.display_unused_tanks->setChecked(prefs.display_unused_tanks);
|
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_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES);
|
||||||
ui.vertical_speed_seconds->setChecked(prefs.units.vertical_speed_time == units::SECONDS);
|
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());
|
s.setValue("gfhigh", ui.gfhigh->value());
|
||||||
SB("gf_low_at_maxdepth", ui.gf_low_at_maxdepth);
|
SB("gf_low_at_maxdepth", ui.gf_low_at_maxdepth);
|
||||||
SB("display_unused_tanks", ui.display_unused_tanks);
|
SB("display_unused_tanks", ui.display_unused_tanks);
|
||||||
|
SB("show_average_depth", ui.show_average_depth);
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
// Units
|
// Units
|
||||||
|
@ -278,6 +280,7 @@ void PreferencesDialog::loadSettings()
|
||||||
set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth);
|
set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth);
|
||||||
GET_BOOL("show_sac", show_sac);
|
GET_BOOL("show_sac", show_sac);
|
||||||
GET_BOOL("display_unused_tanks", display_unused_tanks);
|
GET_BOOL("display_unused_tanks", display_unused_tanks);
|
||||||
|
GET_BOOL("show_average_depth", show_average_depth);
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("GeneralSettings");
|
s.beginGroup("GeneralSettings");
|
||||||
|
|
|
@ -657,7 +657,18 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -429,6 +429,10 @@ void ProfileWidget2::plotDives(QList<dive *> dives)
|
||||||
cylinderPressureAxis->setMaximum(pInfo.maxpressure);
|
cylinderPressureAxis->setMaximum(pInfo.maxpressure);
|
||||||
|
|
||||||
rulerItem->setPlotInfo(pInfo);
|
rulerItem->setPlotInfo(pInfo);
|
||||||
|
if (prefs.show_average_depth)
|
||||||
|
meanDepth->setVisible(true);
|
||||||
|
else
|
||||||
|
meanDepth->setVisible(false);
|
||||||
meanDepth->setMeanDepth(pInfo.meandepth);
|
meanDepth->setMeanDepth(pInfo.meandepth);
|
||||||
meanDepth->setLine(0, 0, timeAxis->posAtValue(d->duration.seconds), 0);
|
meanDepth->setLine(0, 0, timeAxis->posAtValue(d->duration.seconds), 0);
|
||||||
meanDepth->animateMoveTo(3, profileYAxis->posAtValue(pInfo.meandepth));
|
meanDepth->animateMoveTo(3, profileYAxis->posAtValue(pInfo.meandepth));
|
||||||
|
|
|
@ -30,6 +30,7 @@ struct preferences default_prefs = {
|
||||||
.display_invalid_dives = false,
|
.display_invalid_dives = false,
|
||||||
.show_sac = false,
|
.show_sac = false,
|
||||||
.display_unused_tanks = false,
|
.display_unused_tanks = false,
|
||||||
|
.show_average_depth = true,
|
||||||
.text_label_with_units = false
|
.text_label_with_units = false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue