diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2015-07-11 01:37:27 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2015-07-20 15:28:10 +0300 |
commit | f1615e725c7a5562b5fcaac2cd0701dae61b89ca (patch) | |
tree | 702127928db4d91b777f9339b184f25085ad968f /qt-ui/templateedit.cpp | |
parent | 7ca311ae859199f1e07279bf78e1c36efc97768c (diff) | |
download | subsurface-f1615e725c7a5562b5fcaac2cd0701dae61b89ca.tar.gz |
Printing: add apply button to TemplateEdit class
Add apply button to the dialog, Update the preview after applying
the new settings.
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.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp index 0354131ef..2d09cb947 100644 --- a/qt-ui/templateedit.cpp +++ b/qt-ui/templateedit.cpp @@ -64,7 +64,7 @@ void TemplateEdit::on_colorpalette_currentIndexChanged(int index) newTemplateOptions.color_palette_index = index; } -void TemplateEdit::on_TemplateEdit_finished(int result) +void TemplateEdit::saveSettings() { if ((*templateOptions) != newTemplateOptions || grantlee_template.compare(ui->plainTextEdit->toPlainText())) { QMessageBox msgBox; @@ -78,3 +78,18 @@ void TemplateEdit::on_TemplateEdit_finished(int result) } } } + +void TemplateEdit::on_buttonBox_clicked(QAbstractButton *button) +{ + QDialogButtonBox::StandardButton standardButton = ui->buttonBox->standardButton(button); + switch (standardButton) { + case QDialogButtonBox::Ok: + saveSettings(); + break; + case QDialogButtonBox::Cancel: + break; + case QDialogButtonBox::Apply: + saveSettings(); + break; + } +} |