[qet] [4620] TitleBlockProperties add new variable %version |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4620
Author: scorpio810
Date: 2016-08-10 14:25:47 +0200 (Wed, 10 Aug 2016)
Log Message:
-----------
TitleBlockProperties add new variable %version
Modified Paths:
--------------
trunk/sources/bordertitleblock.cpp
trunk/sources/bordertitleblock.h
trunk/sources/titleblock/templatecellwidget.cpp
trunk/sources/titleblockproperties.cpp
trunk/sources/titleblockproperties.h
Modified: trunk/sources/bordertitleblock.cpp
===================================================================
--- trunk/sources/bordertitleblock.cpp 2016-08-10 08:46:41 UTC (rev 4619)
+++ trunk/sources/bordertitleblock.cpp 2016-08-10 12:25:47 UTC (rev 4620)
@@ -240,10 +240,11 @@
ip.date = date();
ip.title = title();
ip.filename = fileName();
+ ip.version = version();
ip.folio = folio();
ip.template_name = titleBlockTemplateName();
ip.display_at = m_edge;
- ip.auto_page_num = autoPageNum();
+ ip.auto_page_num = autoPageNum();
ip.context = additional_fields_;
ip.collection = QET::QetCollection::Embedded;
@@ -259,6 +260,7 @@
setDate(ip.date);
setTitle(ip.title);
setFileName(ip.filename);
+ setVersion(QET::displayedVersion);
setFolio(ip.folio);
setAutoPageNum(ip.auto_page_num);
if (m_edge != ip.display_at)
@@ -693,6 +695,7 @@
context.addValue("date", btb_date_.toString(Qt::SystemLocaleShortDate));
context.addValue("title", btb_title_);
context.addValue("filename", btb_filename_);
+ context.addValue("version", btb_version_);
context.addValue("folio", btb_final_folio_);
context.addValue("folio-id", folio_index_);
context.addValue("folio-total", folio_total_);
Modified: trunk/sources/bordertitleblock.h
===================================================================
--- trunk/sources/bordertitleblock.h 2016-08-10 08:46:41 UTC (rev 4619)
+++ trunk/sources/bordertitleblock.h 2016-08-10 12:25:47 UTC (rev 4620)
@@ -98,6 +98,8 @@
/// @return the value of the title block "File" field
QString fileName() const { return(btb_filename_); }
/// @return the value of the title block Additional Fields
+ QString version() const { return(btb_version_); }
+ /// @return the value of the title block Additional Fields
DiagramContext additionalFields() const { return (additional_fields_); }
/// @return the value of the title block
QString autoPageNum() const { return(btb_auto_page_num_); }
@@ -145,7 +147,9 @@
void setFolioData(int, int, QString = NULL, const DiagramContext & = DiagramContext());
/// @param author the new value of the "File" field
void setFileName(const QString &filename) { btb_filename_ = filename; }
- /// @param author the new value of the "Auto Page Num" field
+ /// @param author the new value of the "Version" field
+ void setVersion(const QString &version) { btb_version_ = version; }
+ /// @param author the new value of the "Auto Page Num" field
void setAutoPageNum(const QString &auto_page_num) { btb_auto_page_num_ = auto_page_num;}
void titleBlockToXml(QDomElement &);
@@ -226,6 +230,7 @@
int folio_index_;
int folio_total_;
QString btb_filename_;
+ QString btb_version_;
DiagramContext additional_fields_;
Qt::Edge m_edge;
Modified: trunk/sources/titleblock/templatecellwidget.cpp
===================================================================
--- trunk/sources/titleblock/templatecellwidget.cpp 2016-08-10 08:46:41 UTC (rev 4619)
+++ trunk/sources/titleblock/templatecellwidget.cpp 2016-08-10 12:25:47 UTC (rev 4620)
@@ -437,6 +437,7 @@
"<li>%{date} : date du folio</li>"
"<li>%{title} : titre du folio</li>"
"<li>%{filename} : nom de fichier du projet</li>"
+ "<li>%{version} : version du projet</li>"
"<li>%{folio} : indications relatives au folio</li>"
"<li>%{folio-id} : position du folio dans le projet</li>"
"<li>%{folio-total} : nombre total de folios dans le projet</li>"
Modified: trunk/sources/titleblockproperties.cpp
===================================================================
--- trunk/sources/titleblockproperties.cpp 2016-08-10 08:46:41 UTC (rev 4619)
+++ trunk/sources/titleblockproperties.cpp 2016-08-10 12:25:47 UTC (rev 4620)
@@ -47,6 +47,7 @@
ip.author == author &&\
ip.date == date &&\
ip.filename == filename &&\
+ ip.version == version &&\
ip.folio == folio &&\
ip.auto_page_num == auto_page_num &&\
ip.template_name == template_name &&\
@@ -73,6 +74,7 @@
e.setAttribute("author", author);
e.setAttribute("title", title);
e.setAttribute("filename", filename);
+ e.setAttribute("version", version);
e.setAttribute("folio", folio);
e.setAttribute("auto_page_num", auto_page_num);
e.setAttribute("date", exportDate());
@@ -99,6 +101,7 @@
if (e.hasAttribute("author")) author = e.attribute("author");
if (e.hasAttribute("title")) title = e.attribute("title");
if (e.hasAttribute("filename")) filename = e.attribute("filename");
+ if (e.hasAttribute("version")) version = e.attribute("version");
if (e.hasAttribute("folio")) folio = e.attribute("folio");
if (e.hasAttribute("auto_page_num")) auto_page_num = e.attribute("auto_page_num");
if (e.hasAttribute("date")) setDateFromString(e.attribute("date"));
@@ -128,6 +131,7 @@
settings.setValue(prefix + "title", title);
settings.setValue(prefix + "author", author);
settings.setValue(prefix + "filename", filename);
+ settings.setValue(prefix + "version", version);
settings.setValue(prefix + "folio", folio);
settings.setValue(prefix + "auto_page_num", auto_page_num);
settings.setValue(prefix + "date", exportDate());
@@ -146,6 +150,7 @@
title = settings.value(prefix + "title").toString();
author = settings.value(prefix + "author").toString();
filename = settings.value(prefix + "filename").toString();
+ version = settings.value(prefix + "version").toString();
folio = settings.value(prefix + "folio", "%id/%total").toString();
auto_page_num = settings.value(prefix + "auto_page_num").toString();
setDateFromString(settings.value(prefix + "date").toString());
Modified: trunk/sources/titleblockproperties.h
===================================================================
--- trunk/sources/titleblockproperties.h 2016-08-10 08:46:41 UTC (rev 4619)
+++ trunk/sources/titleblockproperties.h 2016-08-10 12:25:47 UTC (rev 4620)
@@ -54,6 +54,7 @@
QString author; ///< Author of the diagram/folio (displayed by the default template)
QDate date; ///< Date (displayed by the default template)
QString filename; ///< Filename (displayed by the default template)
+ QString version; ///< Version (displayed by the default template)
QString folio; ///< Folio information (displayed by the default template)
QString auto_page_num;
QString location;