summaryrefslogtreecommitdiffstats
path: root/qt-ui/templateedit.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-06-29 03:24:29 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-07-05 21:00:28 +0300
commit71561e720dbfd85b3cb724dd1eb509b0d230d5db (patch)
treed7fedba86fd42877b766d8a4e719804a5e516676 /qt-ui/templateedit.cpp
parenta600ea5201f55a3182cb24a0553d02aefad2c51b (diff)
downloadsubsurface-71561e720dbfd85b3cb724dd1eb509b0d230d5db.tar.gz
Printing: add QSettings for TemplateEdit class
TemplateOptions struct must be saved to QSettings after the window is closed, also it must be recalled when initializing the window. 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.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp
index 40e14c221..a4236d036 100644
--- a/qt-ui/templateedit.cpp
+++ b/qt-ui/templateedit.cpp
@@ -7,9 +7,35 @@ TemplateEdit::TemplateEdit(QWidget *parent, struct template_options *templateOpt
{
ui->setupUi(this);
this->templateOptions = templateOptions;
+
+ // restore the settings and init the UI
+ ui->fontSelection->setCurrentIndex(templateOptions->font_index);
+ ui->fontsize->setValue(templateOptions->font_size);
+ ui->colorpalette->setCurrentIndex(templateOptions->color_palette_index);
+ ui->linespacing->setValue(templateOptions->line_spacing);
}
TemplateEdit::~TemplateEdit()
{
delete ui;
}
+
+void TemplateEdit::on_fontsize_valueChanged(int font_size)
+{
+ templateOptions->font_size = font_size;
+}
+
+void TemplateEdit::on_linespacing_valueChanged(double line_spacing)
+{
+ templateOptions->line_spacing = line_spacing;
+}
+
+void TemplateEdit::on_fontSelection_currentIndexChanged(int index)
+{
+ templateOptions->font_index = index;
+}
+
+void TemplateEdit::on_colorpalette_currentIndexChanged(int index)
+{
+ templateOptions->color_palette_index = index;
+}