From 963e09ad7b01d99537b59037e2cd1fbedf480261 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Fri, 26 Jun 2015 04:21:03 +0200 Subject: [PATCH] Printing: add TemplateEdit form to source tree The TemplateEdit class works to customize the tempalate before printing, User can select the font-size, font-type, color-palette, linespacing and editing the template HTML code. Signed-off-by: Gehad elrobey Signed-off-by: Lubomir I. Ivanov --- CMakeLists.txt | 1 + qt-ui/templateedit.cpp | 15 +++ qt-ui/templateedit.h | 22 ++++ qt-ui/templateedit.ui | 262 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 300 insertions(+) create mode 100644 qt-ui/templateedit.cpp create mode 100644 qt-ui/templateedit.h create mode 100644 qt-ui/templateedit.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index 534e8e2b6..f4f49f805 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,7 @@ else() set(SUBSURFACE_PRINTING_SRCS printer.cpp templatelayout.cpp + qt-ui/templateedit.cpp ) set(PRINTING_PKG PrintSupport) set(PRINTING_LIB Qt5::PrintSupport) diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp new file mode 100644 index 000000000..1db62b619 --- /dev/null +++ b/qt-ui/templateedit.cpp @@ -0,0 +1,15 @@ +#include "templateedit.h" +#include "ui_templateedit.h" + +TemplateEdit::TemplateEdit(QWidget *parent) : + QDialog(parent), + ui(new Ui::TemplateEdit) +{ + ui->setupUi(this); + this->templateOptions = templateOptions; +} + +TemplateEdit::~TemplateEdit() +{ + delete ui; +} diff --git a/qt-ui/templateedit.h b/qt-ui/templateedit.h new file mode 100644 index 000000000..f1003e461 --- /dev/null +++ b/qt-ui/templateedit.h @@ -0,0 +1,22 @@ +#ifndef TEMPLATEEDIT_H +#define TEMPLATEEDIT_H + +#include + +namespace Ui { +class TemplateEdit; +} + +class TemplateEdit : public QDialog +{ + Q_OBJECT + +public: + explicit TemplateEdit(QWidget *parent = 0); + ~TemplateEdit(); + +private: + Ui::TemplateEdit *ui; +}; + +#endif // TEMPLATEEDIT_H diff --git a/qt-ui/templateedit.ui b/qt-ui/templateedit.ui new file mode 100644 index 000000000..26fe15926 --- /dev/null +++ b/qt-ui/templateedit.ui @@ -0,0 +1,262 @@ + + + TemplateEdit + + + + 0 + 0 + 774 + 433 + + + + Edit Template + + + + + 400 + 380 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 300 + 30 + 441 + 331 + + + + 0 + + + + Style + + + + + 10 + 20 + 401 + 171 + + + + + + + + + Font + + + + + + + + Arial + + + + + Impact + + + + + Georgia + + + + + Courier + + + + + Verdana + + + + + + + + + + + + Font size + + + + + + + 9 + + + 18 + + + + + + + + + + + Color pallet + + + + + + + + Almond + + + + + + + + + + + + Line spacing + + + + + + + 1.000000000000000 + + + 3.000000000000000 + + + 0.250000000000000 + + + 1.250000000000000 + + + + + + + + + + + Template + + + + + 0 + 0 + 441 + 301 + + + + Qt::ScrollBarAsNeeded + + + QPlainTextEdit::NoWrap + + + + + + + + 20 + 60 + 251 + 311 + + + + + about:blank + + + + + + + 30 + 30 + 59 + 14 + + + + Preview + + + + + + QWebView + QWidget +
QtWebKitWidgets/QWebView
+
+
+ + + + buttonBox + accepted() + TemplateEdit + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + TemplateEdit + reject() + + + 316 + 260 + + + 286 + 274 + + + + +