mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
127cd21137
commit
a4982c93cd
1 changed files with 12 additions and 11 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include "printlayout.h"
|
#include "printlayout.h"
|
||||||
#include "../dive.h"
|
#include "../dive.h"
|
||||||
#include "../display.h"
|
#include "../display.h"
|
||||||
|
#include "models.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
struct options {
|
struct options {
|
||||||
|
@ -170,19 +171,19 @@ QString PrintLayout::insertTableHeadingCol(int col)
|
||||||
|
|
||||||
QString PrintLayout::insertTableDataRow(struct dive *dive)
|
QString PrintLayout::insertTableDataRow(struct dive *dive)
|
||||||
{
|
{
|
||||||
/*
|
// use the DiveItem class
|
||||||
// TODO date format
|
struct DiveItem di;
|
||||||
// struct tm tm;
|
di.dive = dive;
|
||||||
len = snprintf(buffer, sizeof(buffer),
|
|
||||||
_("%1$s, %2$s %3$d, %4$d %5$dh%6$02d"),
|
// fill row
|
||||||
weekday(tm.tm_wday),
|
|
||||||
monthname(tm.tm_mon),
|
|
||||||
tm.tm_mday, tm.tm_year + 1900,
|
|
||||||
tm.tm_hour, tm.tm_min
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
QString ret("<tr>");
|
QString ret("<tr>");
|
||||||
ret += insertTableDataCol(QString::number(dive->number));
|
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>";
|
ret += "</tr>";
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue