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>
This commit is contained in:
Dirk Hohndel 2013-05-31 05:28:24 +09:00
parent 344a429e48
commit 32d8051404
3 changed files with 81 additions and 67 deletions

View file

@ -41,7 +41,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags f) : QDial
ui->calculated_ceiling->setChecked(B(calcceiling, profile_calc_ceiling)); ui->calculated_ceiling->setChecked(B(calcceiling, profile_calc_ceiling));
ui->increment_3m->setEnabled(ui->calculated_ceiling->isChecked()); ui->increment_3m->setEnabled(ui->calculated_ceiling->isChecked());
ui->increment_3m->setChecked(B(calcceiling3m, calc_ceiling_3m_incr)); 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->all_tissues->setChecked(B(calcalltissues, calc_all_tissues));
ui->gflow->setValue((int)(I(gflow, gflow))); ui->gflow->setValue((int)(I(gflow, gflow)));

View file

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>604</width> <width>698</width>
<height>490</height> <height>521</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -731,8 +731,8 @@
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>226</x> <x>235</x>
<y>522</y> <y>511</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>157</x> <x>157</x>
@ -747,8 +747,8 @@
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>294</x> <x>303</x>
<y>522</y> <y>511</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>286</x> <x>286</x>
@ -767,8 +767,8 @@
<y>97</y> <y>97</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>186</x> <x>282</x>
<y>8</y> <y>18</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -779,12 +779,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>288</x> <x>187</x>
<y>179</y> <y>77</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>681</x> <x>581</x>
<y>194</y> <y>80</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -795,12 +795,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>301</x> <x>187</x>
<y>179</y> <y>77</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>742</x> <x>668</x>
<y>184</y> <y>80</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -811,12 +811,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>295</x> <x>186</x>
<y>208</y> <y>121</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>673</x> <x>581</x>
<y>216</y> <y>124</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -827,12 +827,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>301</x> <x>186</x>
<y>206</y> <y>121</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>740</x> <x>668</x>
<y>216</y> <y>124</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -843,12 +843,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>296</x> <x>184</x>
<y>240</y> <y>165</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>683</x> <x>581</x>
<y>242</y> <y>168</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -859,12 +859,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>304</x> <x>184</x>
<y>232</y> <y>165</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>760</x> <x>668</x>
<y>236</y> <y>168</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -875,12 +875,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>294</x> <x>195</x>
<y>267</y> <y>209</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>692</x> <x>591</x>
<y>271</y> <y>212</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -891,12 +891,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>286</x> <x>195</x>
<y>261</y> <y>209</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>760</x> <x>668</x>
<y>269</y> <y>212</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -907,12 +907,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>288</x> <x>298</x>
<y>344</y> <y>327</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>555</x> <x>512</x>
<y>351</y> <y>327</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -923,12 +923,28 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>198</x> <x>298</x>
<y>286</y> <y>327</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>503</x> <x>668</x>
<y>286</y> <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>586</x>
<y>270</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>

View file

@ -1074,28 +1074,26 @@ void ProfileGraphicsView::plot_depth_profile()
} }
/* plot the calculated ceiling for all tissues */ /* plot the calculated ceiling for all tissues */
if (prefs.calc_all_tissues){ if (prefs.profile_calc_ceiling && prefs.calc_all_tissues){
int k; int k;
for (k=0; k<16; k++){ for (k=0; k<16; k++){
if (prefs.profile_calc_ceiling) { pat.setColorAt(0, profile_color[CALC_CEILING_SHALLOW].first());
pat.setColorAt(0, profile_color[CALC_CEILING_SHALLOW].first()); pat.setColorAt(1, QColor(100, 100, 100, 50));
pat.setColorAt(1, QColor(100, 100, 100, 50));
entry = gc.pi.entry; entry = gc.pi.entry;
p.clear(); p.clear();
p.append(QPointF(SCALEGC(0, 0))); p.append(QPointF(SCALEGC(0, 0)));
for (i = 0; i < gc.pi.nr; i++, entry++) { for (i = 0; i < gc.pi.nr; i++, entry++) {
if ((entry->ceilings)[k]) if ((entry->ceilings)[k])
p.append(QPointF(SCALEGC(entry->sec, (entry->ceilings)[k]))); p.append(QPointF(SCALEGC(entry->sec, (entry->ceilings)[k])));
else else
p.append(QPointF(SCALEGC(entry->sec, 0))); 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);
} }
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 */ /* next show where we have been bad and crossed the dc's ceiling */