aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-31 05:28:24 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-31 05:28:24 +0900
commit32d8051404498cdba8b43c49d1b2aba5fb97818c (patch)
tree12563a5ddc7e1854d4be1a2242821596fc0a5321
parent344a429e4811c60b9b12ef225c2b5b8d31d8534b (diff)
downloadsubsurface-32d8051404498cdba8b43c49d1b2aba5fb97818c.tar.gz
Cleanup minor issues with ceilings for individualy tissues
In commit b8d31d8534b ("Show ceilings for individual tissues") Robert inadvertently broke the connection from dc_ceilings to red_ceilings and also didn't correctly enable the checkbox for all_tissues when calc_ceilings was already set in the preferences before the dialog was created (and therefore the connection in the .ui file isn't run). There's also a simplification / cleanup to the code deciding whether to show all the tissues. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/preferences.cpp2
-rw-r--r--qt-ui/preferences.ui112
-rw-r--r--qt-ui/profilegraphics.cpp36
3 files changed, 82 insertions, 68 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 68dcbf2a0..dd484b6e8 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -41,7 +41,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags f) : QDial
ui->calculated_ceiling->setChecked(B(calcceiling, profile_calc_ceiling));
ui->increment_3m->setEnabled(ui->calculated_ceiling->isChecked());
ui->increment_3m->setChecked(B(calcceiling3m, calc_ceiling_3m_incr));
- ui->all_tissues->setEnabled(ui->all_tissues->isChecked());
+ ui->all_tissues->setEnabled(ui->calculated_ceiling->isChecked());
ui->all_tissues->setChecked(B(calcalltissues, calc_all_tissues));
ui->gflow->setValue((int)(I(gflow, gflow)));
diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui
index 1617c453b..3cef8785a 100644
--- a/qt-ui/preferences.ui
+++ b/qt-ui/preferences.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>604</width>
- <height>490</height>
+ <width>698</width>
+ <height>521</height>
</rect>
</property>
<property name="windowTitle">
@@ -731,8 +731,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
- <x>226</x>
- <y>522</y>
+ <x>235</x>
+ <y>511</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
@@ -747,8 +747,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
- <x>294</x>
- <y>522</y>
+ <x>303</x>
+ <y>511</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
@@ -767,8 +767,8 @@
<y>97</y>
</hint>
<hint type="destinationlabel">
- <x>186</x>
- <y>8</y>
+ <x>282</x>
+ <y>18</y>
</hint>
</hints>
</connection>
@@ -779,12 +779,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>288</x>
- <y>179</y>
+ <x>187</x>
+ <y>77</y>
</hint>
<hint type="destinationlabel">
- <x>681</x>
- <y>194</y>
+ <x>581</x>
+ <y>80</y>
</hint>
</hints>
</connection>
@@ -795,12 +795,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>301</x>
- <y>179</y>
+ <x>187</x>
+ <y>77</y>
</hint>
<hint type="destinationlabel">
- <x>742</x>
- <y>184</y>
+ <x>668</x>
+ <y>80</y>
</hint>
</hints>
</connection>
@@ -811,12 +811,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>295</x>
- <y>208</y>
+ <x>186</x>
+ <y>121</y>
</hint>
<hint type="destinationlabel">
- <x>673</x>
- <y>216</y>
+ <x>581</x>
+ <y>124</y>
</hint>
</hints>
</connection>
@@ -827,12 +827,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>301</x>
- <y>206</y>
+ <x>186</x>
+ <y>121</y>
</hint>
<hint type="destinationlabel">
- <x>740</x>
- <y>216</y>
+ <x>668</x>
+ <y>124</y>
</hint>
</hints>
</connection>
@@ -843,12 +843,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>296</x>
- <y>240</y>
+ <x>184</x>
+ <y>165</y>
</hint>
<hint type="destinationlabel">
- <x>683</x>
- <y>242</y>
+ <x>581</x>
+ <y>168</y>
</hint>
</hints>
</connection>
@@ -859,12 +859,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>304</x>
- <y>232</y>
+ <x>184</x>
+ <y>165</y>
</hint>
<hint type="destinationlabel">
- <x>760</x>
- <y>236</y>
+ <x>668</x>
+ <y>168</y>
</hint>
</hints>
</connection>
@@ -875,12 +875,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>294</x>
- <y>267</y>
+ <x>195</x>
+ <y>209</y>
</hint>
<hint type="destinationlabel">
- <x>692</x>
- <y>271</y>
+ <x>591</x>
+ <y>212</y>
</hint>
</hints>
</connection>
@@ -891,12 +891,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>286</x>
- <y>261</y>
+ <x>195</x>
+ <y>209</y>
</hint>
<hint type="destinationlabel">
- <x>760</x>
- <y>269</y>
+ <x>668</x>
+ <y>212</y>
</hint>
</hints>
</connection>
@@ -907,12 +907,12 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>288</x>
- <y>344</y>
+ <x>298</x>
+ <y>327</y>
</hint>
<hint type="destinationlabel">
- <x>555</x>
- <y>351</y>
+ <x>512</x>
+ <y>327</y>
</hint>
</hints>
</connection>
@@ -923,12 +923,28 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
- <x>198</x>
- <y>286</y>
+ <x>298</x>
+ <y>327</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>668</x>
+ <y>327</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>dc_reported_ceiling</sender>
+ <signal>clicked(bool)</signal>
+ <receiver>red_ceiling</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>362</x>
+ <y>275</y>
</hint>
<hint type="destinationlabel">
- <x>503</x>
- <y>286</y>
+ <x>586</x>
+ <y>270</y>
</hint>
</hints>
</connection>
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index d635e1956..fb336da72 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -1074,28 +1074,26 @@ void ProfileGraphicsView::plot_depth_profile()
}
/* plot the calculated ceiling for all tissues */
- if (prefs.calc_all_tissues){
+ if (prefs.profile_calc_ceiling && prefs.calc_all_tissues){
int k;
for (k=0; k<16; k++){
- if (prefs.profile_calc_ceiling) {
- pat.setColorAt(0, profile_color[CALC_CEILING_SHALLOW].first());
- pat.setColorAt(1, QColor(100, 100, 100, 50));
-
- entry = gc.pi.entry;
- p.clear();
- p.append(QPointF(SCALEGC(0, 0)));
- for (i = 0; i < gc.pi.nr; i++, entry++) {
- if ((entry->ceilings)[k])
- p.append(QPointF(SCALEGC(entry->sec, (entry->ceilings)[k])));
- else
- p.append(QPointF(SCALEGC(entry->sec, 0)));
- }
- p.append(QPointF(SCALEGC((entry-1)->sec, 0)));
- neatFill = new QGraphicsPolygonItem();
- neatFill->setPolygon(p);
- neatFill->setBrush(pat);
- scene()->addItem(neatFill);
+ pat.setColorAt(0, profile_color[CALC_CEILING_SHALLOW].first());
+ pat.setColorAt(1, QColor(100, 100, 100, 50));
+
+ entry = gc.pi.entry;
+ p.clear();
+ p.append(QPointF(SCALEGC(0, 0)));
+ for (i = 0; i < gc.pi.nr; i++, entry++) {
+ if ((entry->ceilings)[k])
+ p.append(QPointF(SCALEGC(entry->sec, (entry->ceilings)[k])));
+ else
+ p.append(QPointF(SCALEGC(entry->sec, 0)));
}
+ p.append(QPointF(SCALEGC((entry-1)->sec, 0)));
+ neatFill = new QGraphicsPolygonItem();
+ neatFill->setPolygon(p);
+ neatFill->setBrush(pat);
+ scene()->addItem(neatFill);
}
}
/* next show where we have been bad and crossed the dc's ceiling */