diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-07-11 12:45:41 +0300 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-07-11 12:45:41 +0300 |
commit | a4982c93cd4481dd3d587f1d927121f026f61c50 (patch) | |
tree | 35ed82ec7f794fda361e0dd9a75e5e79ac0c5f28 /qt-ui/printlayout.cpp | |
parent | 127cd211375ff68c45d18eaab8954627ac8932fe (diff) | |
download | subsurface-a4982c93cd4481dd3d587f1d927121f026f61c50.tar.gz |
Print: complete columns for the table print
We use the DiveItem struct from models.h so to ease the
display of date, depth and duration. All columns present
in the GTK build are now displayed.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui/printlayout.cpp')
-rw-r--r-- | qt-ui/printlayout.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 6321caff2..f33b372e1 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -7,6 +7,7 @@ #include "printlayout.h" #include "../dive.h" #include "../display.h" +#include "models.h" /* struct options { @@ -170,19 +171,19 @@ QString PrintLayout::insertTableHeadingCol(int col) QString PrintLayout::insertTableDataRow(struct dive *dive) { - /* - // TODO date format - // struct tm tm; - len = snprintf(buffer, sizeof(buffer), - _("%1$s, %2$s %3$d, %4$d %5$dh%6$02d"), - weekday(tm.tm_wday), - monthname(tm.tm_mon), - tm.tm_mday, tm.tm_year + 1900, - tm.tm_hour, tm.tm_min - ); - */ + // use the DiveItem class + struct DiveItem di; + di.dive = dive; + + // fill row QString ret("<tr>"); ret += insertTableDataCol(QString::number(dive->number)); + ret += insertTableDataCol(di.displayDate()); + ret += insertTableDataCol(di.displayDepth()); + ret += insertTableDataCol(di.displayDuration()); + ret += insertTableDataCol(dive->divemaster); + ret += insertTableDataCol(dive->buddy); + ret += insertTableDataCol(dive->location); ret += "</tr>"; return ret; } |