From e219bc70f863eaaa9b81ba5abc240975a128c904 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sun, 11 Jan 2015 00:01:15 +0100 Subject: Refactor dctype -> divemode ... and repair a failed rebase (sorry). Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 8 +- qt-ui/maintab.cpp | 12 +-- qt-ui/maintab.ui | 177 +++++++++++++++++++++----------------- qt-ui/preferences.ui | 34 ++++---- qt-ui/profile/diveprofileitem.cpp | 6 +- qt-ui/profile/profilewidget2.cpp | 4 +- 6 files changed, 130 insertions(+), 111 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 57349007c..1b389afdf 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -785,13 +785,13 @@ void DivePlannerPointsModel::setGFLow(const int ghflow) void DivePlannerPointsModel::setRebreatherMode(QString mode) { - qDebug() << mode << "selected, was" << displayed_dive.dc.dctype; + qDebug() << mode << "selected, was" << displayed_dive.dc.divemode; if (mode == "OC") - displayed_dive.dc.dctype = OC; + displayed_dive.dc.divemode = OC; else if (mode == "pSCR") - displayed_dive.dc.dctype = PSCR; + displayed_dive.dc.divemode = PSCR; else if (mode == "CCR") - displayed_dive.dc.dctype = CCR; + displayed_dive.dc.divemode = CCR; plannerModel->emitDataChanged(); } diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 3e49086fd..d930cbff9 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -430,7 +430,7 @@ void MainTab::updateDiveInfo(bool clear) UPDATE_TEXT(displayed_dive, buddy); UPDATE_TEMP(displayed_dive, airtemp); UPDATE_TEMP(displayed_dive, watertemp); - ui.DiveType->setCurrentIndex(displayed_dive.dc.dctype); + ui.DiveType->setCurrentIndex(displayed_dive.dc.divemode); if (!clear) { updateGpsCoordinates(&displayed_dive); @@ -514,7 +514,7 @@ void MainTab::updateDiveInfo(bool clear) ui.otuText->setText(QString("%1").arg(displayed_dive.otu)); ui.waterTemperatureText->setText(get_temperature_string(displayed_dive.watertemp, true)); ui.airTemperatureText->setText(get_temperature_string(displayed_dive.airtemp, true)); - ui.DiveType->setCurrentIndex(current_dc->dctype); + ui.DiveType->setCurrentIndex(current_dc->divemode); volume_t gases[MAX_CYLINDERS] = {}; get_gas_used(&displayed_dive, gases); QString volumes; @@ -650,7 +650,7 @@ void MainTab::updateDiveInfo(bool clear) } editMode = NONE; ui.cylinders->view()->hideColumn(CylindersModel::DEPTH); - if (get_dive_dc(&displayed_dive, dc_number)->dctype == CCR) + if (get_dive_dc(&displayed_dive, dc_number)->divemode == CCR) ui.cylinders->view()->showColumn(CylindersModel::USE); else ui.cylinders->view()->hideColumn(CylindersModel::USE); @@ -772,8 +772,8 @@ void MainTab::acceptChanges() MODIFY_SELECTED_DIVES(EDIT_VALUE(visibility)); if (displayed_dive.airtemp.mkelvin != cd->airtemp.mkelvin) MODIFY_SELECTED_DIVES(EDIT_VALUE(airtemp.mkelvin)); - if (displayed_dive.dc.dctype != cd->dc.dctype) { - MODIFY_SELECTED_DIVES(EDIT_VALUE(dc.dctype)); + if (displayed_dive.dc.divemode != cd->dc.divemode) { + MODIFY_SELECTED_DIVES(EDIT_VALUE(dc.divemode)); MODIFY_SELECTED_DIVES(update_setpoint_events(&mydive->dc)); do_replot = true; } @@ -1019,7 +1019,7 @@ void MainTab::divetype_Changed(int index) { if (editMode == IGNORE) return; - displayed_dive.dc.dctype = (enum dive_comp_type) index; + displayed_dive.dc.divemode = (enum dive_comp_type) index; update_setpoint_events(&displayed_dive.dc); markChangedWidget(ui.DiveType); } diff --git a/qt-ui/maintab.ui b/qt-ui/maintab.ui index 226442f70..937dec454 100644 --- a/qt-ui/maintab.ui +++ b/qt-ui/maintab.ui @@ -22,7 +22,9 @@ 0 - + + scrollArea + @@ -40,14 +42,41 @@ 0 0 - 435 - 770 + 397 + 744 0 + + + + QLayout::SetNoConstraint + + + + + + 0 + 0 + + + + Coordinates + + + + + + + Dive mode + + + + + @@ -83,16 +112,6 @@ - - - - true - - - Qt::UTC - - - @@ -106,6 +125,16 @@ + + + + true + + + Qt::UTC + + + @@ -134,136 +163,129 @@ - - - - Coordinates - - - - + Divemaster - + Buddy - + false - + false - + 0 - + 0 0 - - Qt::StrongFocus + + Rating - + 0 0 - - Qt::StrongFocus + + Visibility - + Suit - + false - - - - Tags - - - - - - - Notes - - - - + 0 - + 0 0 - - Rating + + Qt::StrongFocus - + 0 0 - - Visibility + + Qt::StrongFocus - + + + + Tags + + + + + + + Notes + + + + @@ -295,24 +317,7 @@ - - - - false - - - - - - - 0 - 0 - - - - - - + 0 @@ -368,6 +373,20 @@ + + + + + + false + + + + + + + + @@ -398,8 +417,8 @@ 0 0 - 423 - 752 + 397 + 734 @@ -454,8 +473,8 @@ 0 0 - 423 - 752 + 397 + 734 @@ -771,8 +790,8 @@ 0 0 - 423 - 752 + 397 + 734 diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui index 65075b062..2572990fa 100644 --- a/qt-ui/preferences.ui +++ b/qt-ui/preferences.ui @@ -6,8 +6,8 @@ 0 0 - 924 - 742 + 940 + 756 @@ -748,14 +748,14 @@ Misc - + GFLow - + 1 @@ -765,14 +765,14 @@ - + GFHigh - + 1 @@ -782,28 +782,21 @@ - + GFLow at max depth - - - - CCR: Show setpoints when viewing pO₂ - - - - + Default CCR set-point - + bar @@ -819,6 +812,13 @@ + + + + CCR: Show setpoints when viewing pO₂ + + + @@ -1413,11 +1413,11 @@ + - diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index c049d9178..60a030bb0 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -624,14 +624,14 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo int o2mbar; QPolygonF boundingPoly, o2Poly; // This is the "Whole Item", but a pressure can be divided in N Polygons. polygons.clear(); - if (displayed_dive.dc.dctype == CCR) + if (displayed_dive.dc.divemode == CCR) polygons.append(o2Poly); for (int i = 0, count = dataModel->rowCount(); i < count; i++) { o2mbar = 0; plot_data *entry = dataModel->data().entry + i; int mbar = GET_PRESSURE(entry); - if (displayed_dive.dc.dctype == CCR) + if (displayed_dive.dc.divemode == CCR) o2mbar = GET_O2CYLINDER_PRESSURE(entry); if (entry->cylinderindex != last_index) { @@ -665,7 +665,7 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo for (int i = 0, count = dataModel->rowCount(); i < count; i++) { entry = dataModel->data().entry + i; mbar = GET_PRESSURE(entry); - if (displayed_dive.dc.dctype == CCR && displayed_dive.oxygen_cylinder_index >= 0) + if (displayed_dive.dc.divemode == CCR && displayed_dive.oxygen_cylinder_index >= 0) o2mbar = GET_O2CYLINDER_PRESSURE(entry); if (o2mbar) { diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 7ccc7cfad..f24e17d6f 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -531,7 +531,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) currentdc = fake_dc(currentdc); } - o2SetpointGasItem->setVisible(current_dive && (currentdc->dctype == CCR) && prefs.show_ccr_setpoint && prefs.pp_graphs.po2); + o2SetpointGasItem->setVisible(current_dive && (currentdc->divemode == CCR) && prefs.show_ccr_setpoint && prefs.pp_graphs.po2); /* This struct holds all the data that's about to be plotted. * I'm not sure this is the best approach ( but since we are @@ -988,7 +988,7 @@ void ProfileWidget2::setProfileState() } pn2GasItem->setVisible(prefs.pp_graphs.pn2); po2GasItem->setVisible(prefs.pp_graphs.po2); - o2SetpointGasItem->setVisible(current_dive && prefs.pp_graphs.po2 && (current_dc->dctype == CCR) && (prefs.show_ccr_setpoint)); + o2SetpointGasItem->setVisible(current_dive && prefs.pp_graphs.po2 && (current_dc->divemode == CCR) && (prefs.show_ccr_setpoint)); pheGasItem->setVisible(prefs.pp_graphs.phe); timeAxis->setPos(itemPos.time.pos.on); -- cgit v1.2.3-70-g09d2