From 54981b425ecc76cab9d0f2598a7cebb0863c49c9 Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Mon, 6 Aug 2018 15:32:19 +0000 Subject: [PATCH] title block editor : add '%saveddate' and '%savedtime' as available values, for moment only when user "save as" project git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5467 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qetproject.cpp | 4 ++++ sources/titleblock/templatecellwidget.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index d90cd7272..3d73d22ab 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -255,6 +255,10 @@ void QETProject::setFilePath(const QString &filepath) { setReadOnly(false); } + project_properties_.addValue("saveddate", QDate::currentDate().toString("yyyy-MM-dd")); + project_properties_.addValue("savedtime", QDateTime::currentDateTime().toString("HH:mm")); + + emit(projectFilePathChanged(this, m_file_path)); emit(projectInformationsChanged(this)); updateDiagramsFolioData(); diff --git a/sources/titleblock/templatecellwidget.cpp b/sources/titleblock/templatecellwidget.cpp index 9154d6ff0..9629a379f 100644 --- a/sources/titleblock/templatecellwidget.cpp +++ b/sources/titleblock/templatecellwidget.cpp @@ -447,6 +447,8 @@ QString TitleBlockTemplateCellWidget::defaultVariablesString() const { "
  • %{projecttitle} : titre du projet
  • " "
  • %{projectpath} : chemin du projet
  • " "
  • %{projectfilename} : nom du fichier
  • " + "
  • %{saveddate} : date d'enregistrement du fichier
  • " + "
  • %{savedtime} : heure d'enregistrement du fichier
  • " "" ); return(def_var_string);