[qet] qet/qet: [5471] Add '%savedfilename' and '%savedfilepath' title block variables |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5471
Author: scorpio810
Date: 2018-08-06 19:20:50 +0200 (Mon, 06 Aug 2018)
Log Message:
-----------
Add '%savedfilename' and '%savedfilepath' title block variables
They should be updated after file save or save as dialog is confirmed,
before file is saved.
Modified Paths:
--------------
trunk/sources/qetproject.cpp
trunk/sources/titleblock/templatecellwidget.cpp
Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp 2018-08-06 17:06:45 UTC (rev 5470)
+++ trunk/sources/qetproject.cpp 2018-08-06 17:20:50 UTC (rev 5471)
@@ -254,9 +254,11 @@
if (file_path_info.isWritable()) {
setReadOnly(false);
}
- //'%saveddate' and '%savedtime' title block variables should be updated after file save as dialog is confirmed, before file is saved.
+ //title block variables should be updated after file save as dialog is confirmed, before file is saved.
project_properties_.addValue("saveddate", QDate::currentDate().toString("yyyy-MM-dd"));
project_properties_.addValue("savedtime", QDateTime::currentDateTime().toString("HH:mm"));
+ project_properties_.addValue("savedfilename", QFileInfo(filePath()).baseName());
+ project_properties_.addValue("savedfilepath", filePath());
@@ -873,11 +875,14 @@
QString error_message;
if (!QET::writeXmlFile(xml_project, m_file_path, &error_message)) return(error_message);
- //'%saveddate' and '%savedtime' title block variables should be updated after file save dialog is confirmed, before file is saved.
+ //title block variables should be updated after file save dialog is confirmed, before file is saved.
project_properties_.addValue("saveddate", QDate::currentDate().toString("yyyy-MM-dd"));
project_properties_.addValue("savedtime", QDateTime::currentDateTime().toString("HH:mm"));
+ project_properties_.addValue("savedfilename", QFileInfo(filePath()).baseName());
+ project_properties_.addValue("savedfilepath", filePath());
+
emit(projectInformationsChanged(this));
updateDiagramsFolioData();
Modified: trunk/sources/titleblock/templatecellwidget.cpp
===================================================================
--- trunk/sources/titleblock/templatecellwidget.cpp 2018-08-06 17:06:45 UTC (rev 5470)
+++ trunk/sources/titleblock/templatecellwidget.cpp 2018-08-06 17:20:50 UTC (rev 5471)
@@ -449,6 +449,8 @@
"<li>%{projectfilename} : nom du fichier</li>"
"<li>%{saveddate} : date d'enregistrement du fichier</li>"
"<li>%{savedtime} : heure d'enregistrement du fichier</li>"
+ "<li>%{savedfilename} : nom du fichier enregistré</li>"
+ "<li>%{savedfilepath} : chemin du fichier enregistré</li>"
"</ul>"
);
return(def_var_string);