mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
TitleBlockProperties add new variable %version
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4620 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -240,10 +240,11 @@ TitleBlockProperties BorderTitleBlock::exportTitleBlock() {
|
||||
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 @@ void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) {
|
||||
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 @@ void BorderTitleBlock::updateDiagramContextForTitleBlock(const DiagramContext &i
|
||||
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_);
|
||||
|
||||
@@ -98,6 +98,8 @@ class BorderTitleBlock : public QObject
|
||||
/// @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,6 +147,8 @@ class BorderTitleBlock : public QObject
|
||||
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 "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;}
|
||||
|
||||
@@ -226,6 +230,7 @@ class BorderTitleBlock : public QObject
|
||||
int folio_index_;
|
||||
int folio_total_;
|
||||
QString btb_filename_;
|
||||
QString btb_version_;
|
||||
DiagramContext additional_fields_;
|
||||
Qt::Edge m_edge;
|
||||
|
||||
|
||||
@@ -437,6 +437,7 @@ QString TitleBlockTemplateCellWidget::defaultVariablesString() const {
|
||||
"<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>"
|
||||
|
||||
@@ -47,6 +47,7 @@ bool TitleBlockProperties::operator==(const TitleBlockProperties &ip) {
|
||||
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 @@ void TitleBlockProperties::toXml(QDomElement &e) const {
|
||||
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 @@ void TitleBlockProperties::fromXml(const QDomElement &e) {
|
||||
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 @@ void TitleBlockProperties::toSettings(QSettings &settings, const QString &prefix
|
||||
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 @@ void TitleBlockProperties::fromSettings(QSettings &settings, const QString &pref
|
||||
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());
|
||||
|
||||
@@ -54,6 +54,7 @@ class TitleBlockProperties {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user