diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-11-30 16:51:28 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-11-30 16:51:28 +0200 |
commit | 156815f041da70d6b748abb4ddcaeab40f2a8912 (patch) | |
tree | a48e585d4ea4c4dad32876db9a30e762ca57226b /qt-ui/models.cpp | |
parent | 35f1f716a5a63aa344513a7b3db20dc3eab8ec9b (diff) | |
download | subsurface-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>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 27 |
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) { |