From a4982c93cd4481dd3d587f1d927121f026f61c50 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 11 Jul 2013 12:45:41 +0300 Subject: 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 --- qt-ui/printlayout.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'qt-ui') 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(""); 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 += ""; return ret; } -- cgit v1.2.3-70-g09d2