summaryrefslogtreecommitdiffstats
path: root/qt-ui/templateedit.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-07-24 09:53:07 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-07-28 11:37:30 +0300
commit2b2c506cb7e5e1659ad68818eca46d14d7840ecd (patch)
tree1085b0d8faa43c12818b89a4cfc7666a481457d0 /qt-ui/templateedit.cpp
parentc95358c4b9c39016d08c234fb7e5db4958ff381e (diff)
downloadsubsurface-2b2c506cb7e5e1659ad68818eca46d14d7840ecd.tar.gz
Printing: use grantlee templates from the current existing template list
We use templates from the grantlee templates list created and dynamically. So we don't need static templates anymore. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui/templateedit.cpp')
-rw-r--r--qt-ui/templateedit.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp
index 6a6328f64..de280f7a8 100644
--- a/qt-ui/templateedit.cpp
+++ b/qt-ui/templateedit.cpp
@@ -21,13 +21,7 @@ TemplateEdit::TemplateEdit(QWidget *parent, struct print_options *printOptions,
ui->colorpalette->setCurrentIndex(templateOptions->color_palette_index);
ui->linespacing->setValue(templateOptions->line_spacing);
- if (printOptions->p_template == print_options::ONE_DIVE) {
- grantlee_template = TemplateLayout::readTemplate("one_dive.html");
- } else if (printOptions->p_template == print_options::TWO_DIVE) {
- grantlee_template = TemplateLayout::readTemplate("two_dives.html");
- } else if (printOptions->p_template == print_options::CUSTOM) {
- grantlee_template = TemplateLayout::readTemplate("custom.html");
- }
+ grantlee_template = TemplateLayout::readTemplate(printOptions->p_template);
// gui
btnGroup = new QButtonGroup;
@@ -118,7 +112,7 @@ void TemplateEdit::saveSettings()
if (msgBox.exec() == QMessageBox::Save) {
memcpy(templateOptions, &newTemplateOptions, sizeof(struct template_options));
if (grantlee_template.compare(ui->plainTextEdit->toPlainText())) {
- printOptions->p_template = print_options::CUSTOM;
+ printOptions->p_template = "custom.html";
TemplateLayout::writeTemplate("custom.html", ui->plainTextEdit->toPlainText());
}
if (templateOptions->color_palette_index == 1) {