From 32d8051404498cdba8b43c49d1b2aba5fb97818c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 31 May 2013 05:28:24 +0900 Subject: 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 --- qt-ui/preferences.cpp | 2 +- qt-ui/preferences.ui | 112 ++++++++++++++++++++++++++-------------------- qt-ui/profilegraphics.cpp | 36 +++++++-------- 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 @@ 0 0 - 604 - 490 + 698 + 521 @@ -731,8 +731,8 @@ accept() - 226 - 522 + 235 + 511 157 @@ -747,8 +747,8 @@ reject() - 294 - 522 + 303 + 511 286 @@ -767,8 +767,8 @@ 97 - 186 - 8 + 282 + 18 @@ -779,12 +779,12 @@ setEnabled(bool) - 288 - 179 + 187 + 77 - 681 - 194 + 581 + 80 @@ -795,12 +795,12 @@ setEnabled(bool) - 301 - 179 + 187 + 77 - 742 - 184 + 668 + 80 @@ -811,12 +811,12 @@ setEnabled(bool) - 295 - 208 + 186 + 121 - 673 - 216 + 581 + 124 @@ -827,12 +827,12 @@ setEnabled(bool) - 301 - 206 + 186 + 121 - 740 - 216 + 668 + 124 @@ -843,12 +843,12 @@ setEnabled(bool) - 296 - 240 + 184 + 165 - 683 - 242 + 581 + 168 @@ -859,12 +859,12 @@ setEnabled(bool) - 304 - 232 + 184 + 165 - 760 - 236 + 668 + 168 @@ -875,12 +875,12 @@ setEnabled(bool) - 294 - 267 + 195 + 209 - 692 - 271 + 591 + 212 @@ -891,12 +891,12 @@ setEnabled(bool) - 286 - 261 + 195 + 209 - 760 - 269 + 668 + 212 @@ -907,12 +907,12 @@ setEnabled(bool) - 288 - 344 + 298 + 327 - 555 - 351 + 512 + 327 @@ -923,12 +923,28 @@ setEnabled(bool) - 198 - 286 + 298 + 327 + + + 668 + 327 + + + + + dc_reported_ceiling + clicked(bool) + red_ceiling + setEnabled(bool) + + + 362 + 275 - 503 - 286 + 586 + 270 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 */ -- cgit v1.2.3-70-g09d2