mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add the ability to export print template as html
This way we can view the html generated from a print template, for debugging, validation or printing via your favorite browser. Signed-off-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
parent
18644c89f6
commit
fcf5333bf2
4 changed files with 41 additions and 0 deletions
|
@ -195,6 +195,21 @@ void Printer::templateProgessUpdated(int value)
|
|||
emit progessUpdated(done);
|
||||
}
|
||||
|
||||
QString Printer::exportHtml() {
|
||||
TemplateLayout t(printOptions, templateOptions);
|
||||
connect(&t, SIGNAL(progressUpdated(int)), this, SLOT(templateProgessUpdated(int)));
|
||||
QString html;
|
||||
|
||||
if (printOptions->type == print_options::DIVELIST) {
|
||||
html = t.generate();
|
||||
} else if (printOptions->type == print_options::STATISTICS ) {
|
||||
html = t.generateStatistics();
|
||||
}
|
||||
|
||||
// TODO: write html to file
|
||||
return html;
|
||||
}
|
||||
|
||||
void Printer::print()
|
||||
{
|
||||
// we can only print if "PRINT" mode is selected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue