diff options
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 97511c785..17af08bd4 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -13,8 +13,8 @@ #include "planner.h" #include "device.h" #include "ruleritem.h" -#include "../../dive.h" -#include "../../pref.h" +#include "dive.h" +#include "pref.h" #include <libdivecomputer/parser.h> #include <QSignalTransition> #include <QPropertyAnimation> @@ -477,7 +477,7 @@ void ProfileWidget2::settingsChanged() { QSettings s; s.beginGroup("TecDetails"); - if (s.value("phegraph").toBool() || s.value("po2graph").toBool() || s.value("pn2graph").toBool()) { + if (prefs.pp_graphs.phe || prefs.pp_graphs.po2 || prefs.pp_graphs.pn2) { profileYAxis->animateChangeLine(itemPos.depth.shrinked); temperatureAxis->animateChangeLine(itemPos.temperature.shrinked); cylinderPressureAxis->animateChangeLine(itemPos.cylinder.shrinked); @@ -486,8 +486,8 @@ void ProfileWidget2::settingsChanged() temperatureAxis->animateChangeLine(itemPos.temperature.expanded); cylinderPressureAxis->animateChangeLine(itemPos.cylinder.expanded); } - if (s.value("zoomed_plot").toBool() != isPlotZoomed) { - isPlotZoomed = s.value("zoomed_plot").toBool(); + if (prefs.zoomed_plot != isPlotZoomed) { + isPlotZoomed = prefs.zoomed_plot; replot(); } @@ -635,9 +635,7 @@ void ProfileWidget2::setProfileState() cylinderPressureAxis->setVisible(true); profileYAxis->setPos(itemPos.depth.pos.on); - QSettings s; - s.beginGroup("TecDetails"); - if (s.value("phegraph").toBool() || s.value("po2graph").toBool() || s.value("pn2graph").toBool()) { + if (prefs.pp_graphs.phe || prefs.pp_graphs.po2 || prefs.pp_graphs.pn2) { profileYAxis->setLine(itemPos.depth.shrinked); temperatureAxis->setLine(itemPos.temperature.shrinked); cylinderPressureAxis->setLine(itemPos.cylinder.shrinked); @@ -646,9 +644,9 @@ void ProfileWidget2::setProfileState() temperatureAxis->setLine(itemPos.temperature.expanded); cylinderPressureAxis->setLine(itemPos.cylinder.expanded); } - pn2GasItem->setVisible(s.value("pn2graph").toBool()); - po2GasItem->setVisible(s.value("po2graph").toBool()); - pheGasItem->setVisible(s.value("phegraph").toBool()); + pn2GasItem->setVisible(prefs.pp_graphs.pn2); + po2GasItem->setVisible(prefs.pp_graphs.po2); + pheGasItem->setVisible(prefs.pp_graphs.phe); gasYAxis->setPos(itemPos.partialPressure.pos.on); gasYAxis->setLine(itemPos.partialPressure.expanded); @@ -660,21 +658,22 @@ void ProfileWidget2::setProfileState() temperatureAxis->setPos(itemPos.temperature.pos.on); heartBeatAxis->setPos(itemPos.heartBeat.pos.on); heartBeatAxis->setLine(itemPos.heartBeat.expanded); - heartBeatItem->setVisible(s.value("hrgraph").toBool()); + heartBeatItem->setVisible(prefs.hrgraph); meanDepth->setVisible(true); diveComputerText->setVisible(true); diveComputerText->setPos(itemPos.dcLabel.on); - diveCeiling->setVisible(s.value("calcceiling").toBool()); - reportedCeiling->setVisible(s.value("dcceiling").toBool()); + diveCeiling->setVisible(prefs.calcceiling); + reportedCeiling->setVisible(prefs.dcceiling); - if (s.value("calcalltissues").toBool()) { + if (prefs.calcalltissues) { Q_FOREACH(DiveCalculatedTissue * tissue, allTissues) { tissue->setVisible(true); } } - + QSettings s; + s.beginGroup("TecDetails"); bool rulerVisible = s.value("rulergraph", false).toBool(); rulerItem->setVisible(rulerVisible); rulerItem->destNode()->setVisible(rulerVisible); |