aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-06-26 04:21:03 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-07-05 20:59:55 +0300
commit963e09ad7b01d99537b59037e2cd1fbedf480261 (patch)
treebec3d78a62243c51ac8e28b25614dcd205d50324
parentce3d2abd83717abb1b4b5c8a8eecc04ab1d45e66 (diff)
downloadsubsurface-963e09ad7b01d99537b59037e2cd1fbedf480261.tar.gz
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 <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r--CMakeLists.txt1
-rw-r--r--qt-ui/templateedit.cpp15
-rw-r--r--qt-ui/templateedit.h22
-rw-r--r--qt-ui/templateedit.ui262
4 files changed, 300 insertions, 0 deletions
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 <QDialog>
+
+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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>TemplateEdit</class>
+ <widget class="QDialog" name="TemplateEdit">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>774</width>
+ <height>433</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Edit Template</string>
+ </property>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="geometry">
+ <rect>
+ <x>400</x>
+ <y>380</y>
+ <width>341</width>
+ <height>32</height>
+ </rect>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="geometry">
+ <rect>
+ <x>300</x>
+ <y>30</y>
+ <width>441</width>
+ <height>331</height>
+ </rect>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="style">
+ <attribute name="title">
+ <string>Style</string>
+ </attribute>
+ <widget class="QWidget" name="verticalLayoutWidget">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>401</width>
+ <height>171</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QLabel" name="fontselection_label">
+ <property name="text">
+ <string>Font</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="fontSelection">
+ <item>
+ <property name="text">
+ <string>Arial</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Impact</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Georgia</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Courier</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Verdana</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="fontsize_label">
+ <property name="text">
+ <string>Font size</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="fontsize">
+ <property name="minimum">
+ <number>9</number>
+ </property>
+ <property name="maximum">
+ <number>18</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="colorpalette_label">
+ <property name="text">
+ <string>Color pallet</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="colorpalette">
+ <item>
+ <property name="text">
+ <string>Almond</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="linespacing_label">
+ <property name="text">
+ <string>Line spacing</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDoubleSpinBox" name="linespacing">
+ <property name="minimum">
+ <double>1.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>3.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>0.250000000000000</double>
+ </property>
+ <property name="value">
+ <double>1.250000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="template_2">
+ <attribute name="title">
+ <string>Template</string>
+ </attribute>
+ <widget class="QPlainTextEdit" name="plainTextEdit">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>441</width>
+ <height>301</height>
+ </rect>
+ </property>
+ <property name="horizontalScrollBarPolicy">
+ <enum>Qt::ScrollBarAsNeeded</enum>
+ </property>
+ <property name="lineWrapMode">
+ <enum>QPlainTextEdit::NoWrap</enum>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ <widget class="QWebView" name="webView">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>60</y>
+ <width>251</width>
+ <height>311</height>
+ </rect>
+ </property>
+ <property name="url">
+ <url>
+ <string>about:blank</string>
+ </url>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_5">
+ <property name="geometry">
+ <rect>
+ <x>30</x>
+ <y>30</y>
+ <width>59</width>
+ <height>14</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Preview</string>
+ </property>
+ </widget>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QWebView</class>
+ <extends>QWidget</extends>
+ <header>QtWebKitWidgets/QWebView</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>TemplateEdit</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>TemplateEdit</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>