diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-07-11 21:39:44 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-11 21:39:44 -0700 |
commit | 6699dab9522420991b961d1006fa75bb6dbbfcaf (patch) | |
tree | d70c3c70a2709b5fae2ae77a17750db6814b564f | |
parent | 2552b027aea21a222b4087d5616c452a4bca1dde (diff) | |
download | subsurface-6699dab9522420991b961d1006fa75bb6dbbfcaf.tar.gz |
Printing: print tags instead of max CNS
And re-order / re-size the fields so more useful information is actually
shown.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/models.cpp | 23 | ||||
-rw-r--r-- | qt-ui/printlayout.cpp | 6 |
2 files changed, 16 insertions, 13 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 4df9c54f2..8e10452fd 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -1902,9 +1902,9 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const if (col == 0) return tr("Gas used:"); if (col == 2) - return tr("SAC:"); + return tr("Tags:"); if (col == 3) - return tr("Max. CNS:"); + return tr("SAC:"); if (col == 4) return tr("Weights:"); } @@ -1932,24 +1932,27 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const if (row == 3) { if (col == 0) { int added = 0; - const char *desc; - QString gases; + QString gas, gases; for (int i = 0; i < MAX_CYLINDERS; i++) { - desc = dive->cylinder[i].type.description; + gas = dive->cylinder[i].type.description; + gas += QString(!gas.isEmpty() ? " " : "") + gasname(&dive->cylinder[i].gasmix); // if has a description and if such gas is not already present - if (desc && gases.indexOf(QString(desc)) == -1) { + if (!gas.isEmpty() && gases.indexOf(gas) == -1) { if (added > 0) gases += QString(" / "); - gases += QString(desc); + gases += gas; added++; } } return gases; } - if (col == 2) - return di.displaySac(); + if (col == 2) { + char buffer[256]; + taglist_get_tagstring(dive->tag_list, buffer, 256); + return QString(buffer); + } if (col == 3) - return QString::number(dive->maxcns); + return di.displaySac(); if (col == 4) { weight_t tw = { total_weight(dive) }; return get_weight_string(tw, true); diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 59b6d392a..bae468c44 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -42,9 +42,9 @@ PrintLayout::PrintLayout(PrintDialog *dialogPtr, QPrinter *printerPtr, struct op const int dw = 20; // base percentage profilePrintColumnWidths.append(dw); profilePrintColumnWidths.append(dw); - profilePrintColumnWidths.append(dw - 3); - profilePrintColumnWidths.append(dw - 3); - profilePrintColumnWidths.append(dw + 6); // fit to 100% + profilePrintColumnWidths.append(dw + 8); + profilePrintColumnWidths.append(dw - 4); + profilePrintColumnWidths.append(dw - 4); // fit to 100% const int sr = 12; // smallest row height in pixels profilePrintRowHeights.append(sr); profilePrintRowHeights.append(sr + 4); |