summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gaetan Bisson <bisson@archlinux.org>2014-09-12 11:58:33 -1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-09-18 06:16:44 -0700
commitae6b0468b16200dcc01f8e1cfd43260b63e830dc (patch)
tree55fb299b1d63727c720506661482cd793864e718
parent434e7a6a7173dcf6abe846e9972a01edce6a571b (diff)
downloadsubsurface-ae6b0468b16200dcc01f8e1cfd43260b63e830dc.tar.gz
Report CNS in dive info tab
This adds a maxcnsText widget under infoTab and populates it. Note that I manually edited maintab.ui to display CNS and OTU next to each other and right after gas data. Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/maintab.cpp2
-rw-r--r--qt-ui/maintab.ui49
2 files changed, 36 insertions, 15 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 920aaeafc..95ac0563d 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -319,6 +319,7 @@ void MainTab::clearInfo()
{
ui.sacText->clear();
ui.otuText->clear();
+ ui.maxcnsText->clear();
ui.oxygenHeliumText->clear();
ui.gasUsedText->clear();
ui.dateText->clear();
@@ -475,6 +476,7 @@ void MainTab::updateDiveInfo(bool clear)
}
ui.maximumDepthText->setText(get_depth_string(displayed_dive.maxdepth, true));
ui.averageDepthText->setText(get_depth_string(displayed_dive.meandepth, true));
+ ui.maxcnsText->setText(QString("%1\%").arg(displayed_dive.maxcns));
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));
diff --git a/qt-ui/maintab.ui b/qt-ui/maintab.ui
index ca58ab034..c6d3e4268 100644
--- a/qt-ui/maintab.ui
+++ b/qt-ui/maintab.ui
@@ -532,13 +532,13 @@
</widget>
</item>
<item row="2" column="0">
- <widget class="QGroupBox" name="groupBox_6">
+ <widget class="QGroupBox" name="groupBox_15">
<property name="title">
- <string>Max. depth</string>
+ <string>CNS</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
- <widget class="QLabel" name="maximumDepthText">
+ <widget class="QLabel" name="maxcnsText">
<property name="text">
<string/>
</property>
@@ -551,13 +551,13 @@
</widget>
</item>
<item row="2" column="1">
- <widget class="QGroupBox" name="groupBox_7">
+ <widget class="QGroupBox" name="groupBox_2">
<property name="title">
- <string>Avg. depth</string>
+ <string>OTU</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
- <widget class="QLabel" name="averageDepthText">
+ <widget class="QLabel" name="otuText">
<property name="text">
<string/>
</property>
@@ -570,13 +570,13 @@
</widget>
</item>
<item row="2" column="2">
- <widget class="QGroupBox" name="groupBox_2">
+ <widget class="QGroupBox" name="groupBox_6">
<property name="title">
- <string>OTU</string>
+ <string>Max. depth</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
- <widget class="QLabel" name="otuText">
+ <widget class="QLabel" name="maximumDepthText">
<property name="text">
<string/>
</property>
@@ -589,6 +589,25 @@
</widget>
</item>
<item row="3" column="0">
+ <widget class="QGroupBox" name="groupBox_7">
+ <property name="title">
+ <string>Avg. depth</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <widget class="QLabel" name="averageDepthText">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="1">
<widget class="QGroupBox" name="groupBox_10">
<property name="title">
<string>Air pressure</string>
@@ -607,7 +626,7 @@
</layout>
</widget>
</item>
- <item row="3" column="1">
+ <item row="3" column="2">
<widget class="QGroupBox" name="groupBox_9">
<property name="title">
<string>Air temp.</string>
@@ -626,7 +645,7 @@
</layout>
</widget>
</item>
- <item row="3" column="2">
+ <item row="4" column="0">
<widget class="QGroupBox" name="groupBox_8">
<property name="title">
<string>Water temp.</string>
@@ -664,7 +683,7 @@
</layout>
</widget>
</item>
- <item row="4" column="0">
+ <item row="4" column="1">
<widget class="QGroupBox" name="groupBox_1">
<property name="title">
<string>Salinity</string>