summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-01-11 00:01:15 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-10 17:27:25 -0800
commite219bc70f863eaaa9b81ba5abc240975a128c904 (patch)
tree682d6d981929420bbabd0021e02db3006c72d96f /qt-ui
parentbfe05b43407c419a32548af20f40e2b9e3bca045 (diff)
downloadsubsurface-e219bc70f863eaaa9b81ba5abc240975a128c904.tar.gz
Refactor dctype -> divemode
... and repair a failed rebase (sorry). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/diveplanner.cpp8
-rw-r--r--qt-ui/maintab.cpp12
-rw-r--r--qt-ui/maintab.ui177
-rw-r--r--qt-ui/preferences.ui34
-rw-r--r--qt-ui/profile/diveprofileitem.cpp6
-rw-r--r--qt-ui/profile/profilewidget2.cpp4
6 files changed, 130 insertions, 111 deletions
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 @@
<number>0</number>
</property>
<item row="2" column="1">
- <widget class="KMessageWidget" name="diveNotesMessage" native="true"/>
+ <widget class="KMessageWidget" name="diveNotesMessage" native="true">
+ <zorder>scrollArea</zorder>
+ </widget>
</item>
<item row="3" column="1">
<widget class="QScrollArea" name="scrollArea">
@@ -40,14 +42,41 @@
<rect>
<x>0</x>
<y>0</y>
- <width>435</width>
- <height>770</height>
+ <width>397</width>
+ <height>744</height>
</rect>
</property>
<layout class="QGridLayout" name="diveNotesScrollAreaLayout">
<property name="spacing">
<number>0</number>
</property>
+ <item row="4" column="0" colspan="3">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetNoConstraint</enum>
+ </property>
+ <item>
+ <widget class="QLabel" name="CoordinatedLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Coordinates</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="TypeLabel">
+ <property name="text">
+ <string>Dive mode</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
@@ -83,16 +112,6 @@
</item>
</layout>
</item>
- <item row="1" column="0">
- <widget class="QDateEdit" name="dateEdit">
- <property name="calendarPopup">
- <bool>true</bool>
- </property>
- <property name="timeSpec">
- <enum>Qt::UTC</enum>
- </property>
- </widget>
- </item>
<item row="1" column="1">
<widget class="QTimeEdit" name="timeEdit">
<property name="sizePolicy">
@@ -106,6 +125,16 @@
</property>
</widget>
</item>
+ <item row="1" column="0">
+ <widget class="QDateEdit" name="dateEdit">
+ <property name="calendarPopup">
+ <bool>true</bool>
+ </property>
+ <property name="timeSpec">
+ <enum>Qt::UTC</enum>
+ </property>
+ </widget>
+ </item>
<item row="1" column="2">
<layout class="QHBoxLayout" name="airWaterTempLayout">
<property name="spacing">
@@ -134,136 +163,129 @@
</property>
</widget>
</item>
- <item row="4" column="0">
- <widget class="QLabel" name="CoordinatedLabel">
- <property name="text">
- <string>Coordinates</string>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
+ <item row="10" column="0">
<widget class="QLabel" name="DivemasterLabel">
<property name="text">
<string>Divemaster</string>
</property>
</widget>
</item>
- <item row="6" column="2">
+ <item row="10" column="2">
<widget class="QLabel" name="BuddyLabel">
<property name="text">
<string>Buddy</string>
</property>
</widget>
</item>
- <item row="7" column="0" colspan="2">
+ <item row="11" column="0" colspan="2">
<widget class="TagWidget" name="divemaster">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="7" column="2">
+ <item row="11" column="2">
<widget class="TagWidget" name="buddy">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="8" column="0" colspan="2">
+ <item row="12" column="0" colspan="2">
<layout class="QHBoxLayout" name="ratingVisibilityLabels">
<property name="spacing">
<number>0</number>
</property>
<item>
- <widget class="StarWidget" name="rating" native="true">
+ <widget class="QLabel" name="RatingLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="focusPolicy">
- <enum>Qt::StrongFocus</enum>
+ <property name="text">
+ <string>Rating</string>
</property>
</widget>
</item>
<item>
- <widget class="StarWidget" name="visibility" native="true">
+ <widget class="QLabel" name="visibilityLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="focusPolicy">
- <enum>Qt::StrongFocus</enum>
+ <property name="text">
+ <string>Visibility</string>
</property>
</widget>
</item>
</layout>
</item>
- <item row="8" column="2">
+ <item row="12" column="2">
<widget class="QLabel" name="SuitLabel">
<property name="text">
<string>Suit</string>
</property>
</widget>
</item>
- <item row="9" column="2">
+ <item row="13" column="2">
<widget class="QLineEdit" name="suit">
<property name="readOnly">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="10" column="0">
- <widget class="QLabel" name="TagLabel">
- <property name="text">
- <string>Tags</string>
- </property>
- </widget>
- </item>
- <item row="12" column="0">
- <widget class="QLabel" name="NotesLabel">
- <property name="text">
- <string>Notes</string>
- </property>
- </widget>
- </item>
- <item row="9" column="0" colspan="2">
+ <item row="13" column="0" colspan="2">
<layout class="QHBoxLayout" name="ratingVisibilityWidgets">
<property name="spacing">
<number>0</number>
</property>
<item>
- <widget class="QLabel" name="RatingLabel">
+ <widget class="StarWidget" name="rating" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string>Rating</string>
+ <property name="focusPolicy">
+ <enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="visibilityLabel">
+ <widget class="StarWidget" name="visibility" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string>Visibility</string>
+ <property name="focusPolicy">
+ <enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
</layout>
</item>
- <item row="11" column="0" colspan="3">
+ <item row="14" column="0">
+ <widget class="QLabel" name="TagLabel">
+ <property name="text">
+ <string>Tags</string>
+ </property>
+ </widget>
+ </item>
+ <item row="16" column="0">
+ <widget class="QLabel" name="NotesLabel">
+ <property name="text">
+ <string>Notes</string>
+ </property>
+ </widget>
+ </item>
+ <item row="15" column="0" colspan="3">
<widget class="TagWidget" name="tagWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -295,24 +317,7 @@
</property>
</widget>
</item>
- <item row="5" column="0" colspan="3">
- <widget class="QLineEdit" name="coordinates">
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- <item>
- <widget class="QComboBox" name="DiveType">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </item>
- <item row="13" column="0" colspan="3">
+ <item row="17" column="0" colspan="3">
<layout class="QHBoxLayout" name="notesAndSocialNetworksLayout">
<property name="spacing">
<number>0</number>
@@ -368,6 +373,20 @@
</item>
</layout>
</item>
+ <item row="7" column="0" colspan="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLineEdit" name="coordinates">
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="DiveType"/>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
</widget>
@@ -398,8 +417,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>423</width>
- <height>752</height>
+ <width>397</width>
+ <height>734</height>
</rect>
</property>
<layout class="QGridLayout" name="equipmentTabScrollAreaLayout">
@@ -454,8 +473,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>423</width>
- <height>752</height>
+ <width>397</width>
+ <height>734</height>
</rect>
</property>
<layout class="QGridLayout" name="diveInfoScrollAreaLayout">
@@ -771,8 +790,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>423</width>
- <height>752</height>
+ <width>397</width>
+ <height>734</height>
</rect>
</property>
<layout class="QGridLayout" name="statsScrollAreaLayout">
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 @@
<rect>
<x>0</x>
<y>0</y>
- <width>924</width>
- <height>742</height>
+ <width>940</width>
+ <height>756</height>
</rect>
</property>
<property name="windowTitle">
@@ -748,14 +748,14 @@
<string>Misc</string>
</property>
<layout class="QFormLayout" name="formLayout_3">
- <item row="0" column="0">
+ <item row="1" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>GFLow</string>
</property>
</widget>
</item>
- <item row="0" column="1">
+ <item row="1" column="1">
<widget class="QSpinBox" name="gflow">
<property name="minimum">
<number>1</number>
@@ -765,14 +765,14 @@
</property>
</widget>
</item>
- <item row="1" column="0">
+ <item row="2" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>GFHigh</string>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QSpinBox" name="gfhigh">
<property name="minimum">
<number>1</number>
@@ -782,28 +782,21 @@
</property>
</widget>
</item>
- <item row="3" column="0" colspan="2">
+ <item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="gf_low_at_maxdepth">
<property name="text">
<string>GFLow at max depth</string>
</property>
</widget>
</item>
- <item row="3" column="0" colspan="2">
- <widget class="QCheckBox" name="show_ccr_setpoint">
- <property name="text">
- <string>CCR: Show setpoints when viewing pO₂</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
+ <item row="6" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Default CCR set-point</string>
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="6" column="1">
<widget class="QDoubleSpinBox" name="defaultSetpoint">
<property name="suffix">
<string>bar</string>
@@ -819,6 +812,13 @@
</property>
</widget>
</item>
+ <item row="5" column="0">
+ <widget class="QCheckBox" name="show_ccr_setpoint">
+ <property name="text">
+ <string>CCR: Show setpoints when viewing pO₂</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
@@ -1413,11 +1413,11 @@
</connections>
<buttongroups>
<buttongroup name="verticalSpeed"/>
+ <buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup_3"/>
<buttongroup name="buttonGroup_4"/>
<buttongroup name="buttonGroup_5"/>
- <buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_6"/>
</buttongroups>
</ui>
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);