summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/preferences.cpp1
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp14
-rw-r--r--qt-ui/profile/divecartesianaxis.h2
-rw-r--r--qt-ui/profile/diveprofileitem.cpp3
-rw-r--r--qt-ui/profile/diveprofileitem.h2
5 files changed, 18 insertions, 4 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index fdee356e5..34a165cea 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -157,6 +157,7 @@ void PreferencesDialog::syncSettings()
SB("redceiling", ui.red_ceiling);
SB("calcceiling", ui.calculated_ceiling);
SB("calcceiling3m", ui.increment_3m);
+ prefs.calc_ceiling_3m_incr = ui.increment_3m->isChecked() ? 1 : 0;
SB("calcndltts", ui.calc_ndl_tts);
SB("calcalltissues", ui.all_tissues);
s.setValue("gflow", ui.gflow->value());
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index 7c91281b4..c6567d413 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -21,12 +21,16 @@ static QPen gridPen(){
}
void DiveCartesianAxis::setMaximum(double maximum)
{
+ if (max == maximum)
+ return;
max = maximum;
emit maxChanged();
}
void DiveCartesianAxis::setMinimum(double minimum)
{
+ if (min == minimum)
+ return;
min = minimum;
}
@@ -255,7 +259,7 @@ QColor DepthAxis::colorForValue(double value)
return QColor(Qt::red);
}
-DepthAxis::DepthAxis()
+DepthAxis::DepthAxis() : showWithPPGraph(false)
{
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
settingsChanged(); // force the correct size of the line.
@@ -267,11 +271,16 @@ void DepthAxis::settingsChanged()
s.beginGroup("TecDetails");
bool ppGraph = s.value("phegraph").toBool() || s.value("po2graph").toBool() || s.value("pn2graph").toBool();
+ if ( ppGraph == showWithPPGraph){
+ return;
+ }
+
if (ppGraph) {
animateChangeLine(QLineF(0,2,0,60));
} else {
animateChangeLine(QLineF(0,2,0,98));
}
+ showWithPPGraph = ppGraph;
}
QColor TimeAxis::colorForValue(double value)
@@ -419,6 +428,9 @@ void PartialGasPressureAxis::preferencesChanged()
max = model->po2Max();
qreal pp = floor(max * 10.0) / 10.0 + 0.2;
+ if (maximum() == pp)
+ return;
+
setMaximum(pp);
setTickInterval( pp > 4 ? 0.5 : 0.25 );
updateTicks();
diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h
index 3f18fe8ff..f321983ab 100644
--- a/qt-ui/profile/divecartesianaxis.h
+++ b/qt-ui/profile/divecartesianaxis.h
@@ -63,6 +63,8 @@ protected:
QColor colorForValue(double value);
private slots:
void settingsChanged();
+private:
+ bool showWithPPGraph;
};
class TimeAxis : public DiveCartesianAxis {
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index 05791eed5..11d80e96b 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -471,9 +471,8 @@ void DiveCalculatedCeiling::preferencesChanged()
if ( dataModel && is3mIncrement != shouldShow3mIncrement){
// recalculate that part.
dataModel->calculateDecompression();
- is3mIncrement = shouldShow3mIncrement;
}
-
+ is3mIncrement = shouldShow3mIncrement;
setVisible(s.value("calcceiling").toBool());
}
diff --git a/qt-ui/profile/diveprofileitem.h b/qt-ui/profile/diveprofileitem.h
index 4dd32b9fa..1f9fa26e3 100644
--- a/qt-ui/profile/diveprofileitem.h
+++ b/qt-ui/profile/diveprofileitem.h
@@ -123,7 +123,7 @@ class DiveCalculatedTissue : public DiveCalculatedCeiling {
Q_OBJECT
public:
DiveCalculatedTissue();
- void preferencesChanged();
+ virtual void preferencesChanged();
};
class MeanDepthLine : public DiveLineItem {