summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-11-30 16:51:28 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-11-30 16:51:28 +0200
commit156815f041da70d6b748abb4ddcaeab40f2a8912 (patch)
treea48e585d4ea4c4dad32876db9a30e762ca57226b
parent35f1f716a5a63aa344513a7b3db20dc3eab8ec9b (diff)
downloadsubsurface-156815f041da70d6b748abb4ddcaeab40f2a8912.tar.gz
Print: update printing for gas, CNS, SAC and weights
Following the new layout for the profile print, we separate the used gas like so: AL80 / EAN33 / ... Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r--qt-ui/models.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 971c6727a..b8b9e2014 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1638,6 +1638,33 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
if (col == 4)
return tr("Rating:");
}
+ // values for gas, sac, etc...
+ if (row == 3) {
+ if (col == 0) {
+ int added = 0;
+ const char *desc;
+ QString gases;
+ for (int i = 0; i < MAX_CYLINDERS; i++) {
+ desc = dive->cylinder[i].type.description;
+ // if has a description and if such gas is not already present
+ if (desc && gases.indexOf(QString(desc)) == -1) {
+ if (added > 0)
+ gases += QString(" / ");
+ gases += QString(desc);
+ added++;
+ }
+ }
+ return gases;
+ }
+ if (col == 2)
+ return QString::number(dive->maxcns);
+ if (col == 3)
+ return di.displaySac();
+ if (col == 4) {
+ weight_t tw = { total_weight(dive) };
+ return get_weight_string(tw, true);
+ }
+ }
/*
// cylinder data
if (row > 2 && row < 10 && row - 3 < MAX_CYLINDERS) {