[qet] [1893] The project title is now made available to child diagrams as %projecttitle .

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 1893
Author:   xavier
Date:     2012-07-02 08:34:40 +0200 (Mon, 02 Jul 2012)
Log Message:
-----------
The project title is now made available to child diagrams as %projecttitle.

Modified Paths:
--------------
    trunk/sources/projectconfigpages.cpp
    trunk/sources/projectconfigpages.h
    trunk/sources/qetproject.cpp

Modified: trunk/sources/projectconfigpages.cpp
===================================================================
--- trunk/sources/projectconfigpages.cpp	2012-07-01 21:54:07 UTC (rev 1892)
+++ trunk/sources/projectconfigpages.cpp	2012-07-02 06:34:40 UTC (rev 1893)
@@ -122,12 +122,14 @@
 void ProjectMainConfigPage::initWidgets() {
 	title_label_ = new QLabel(tr("Titre du projet\240:", "label when configuring"));
 	title_value_ = new QLineEdit();
+	title_information_ = new QLabel(tr("Ce titre sera disponible pour tous les sch\351mas de ce projet en tant que %projecttitle.", "informative label"));
 	project_variables_label_ = new QLabel(
 		tr(
-			"Vous pouvez d\351finir ci-dessous des variables qui seront disponibles pour tous les sch\351mas de ce projet (typiquement pour les cartouches).",
+			"Vous pouvez d\351finir ci-dessous des propri\351t\351s personnalis\351es qui seront disponibles pour tous les sch\351mas de ce projet (typiquement pour les cartouches).",
 			 "informative label"
 		)
 	);
+	project_variables_label_ -> setWordWrap(true);
 	project_variables_ = new DiagramContextWidget();
 	project_variables_ -> setContext(DiagramContext());
 }
@@ -141,6 +143,8 @@
 	title_layout0 -> addWidget(title_label_);
 	title_layout0 -> addWidget(title_value_);
 	main_layout0 -> addLayout(title_layout0);
+	main_layout0 -> addWidget(title_information_);
+	main_layout0 -> addSpacing(10);
 	main_layout0 -> addWidget(project_variables_label_);
 	main_layout0 -> addWidget(project_variables_);
 	setLayout(main_layout0);

Modified: trunk/sources/projectconfigpages.h
===================================================================
--- trunk/sources/projectconfigpages.h	2012-07-01 21:54:07 UTC (rev 1892)
+++ trunk/sources/projectconfigpages.h	2012-07-02 06:34:40 UTC (rev 1893)
@@ -89,6 +89,7 @@
 	protected:
 	QLabel *title_label_;
 	QLineEdit *title_value_;
+	QLabel *title_information_;
 	QLabel *project_variables_label_;
 	DiagramContextWidget *project_variables_;
 };

Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp	2012-07-01 21:54:07 UTC (rev 1892)
+++ trunk/sources/qetproject.cpp	2012-07-02 06:34:40 UTC (rev 1893)
@@ -297,6 +297,7 @@
 	project_title_ = title;
 	emit(projectTitleChanged(this, project_title_));
 	emit(projectInformationsChanged(this));
+	updateDiagramsFolioData();
 }
 
 /**
@@ -1204,8 +1205,12 @@
 */
 void QETProject::updateDiagramsFolioData() {
 	int total_folio = diagrams_.count();
+	
+	DiagramContext project_wide_properties = project_properties_;
+	project_wide_properties.addValue("projecttitle", title());
+	
 	for (int i = 0 ; i < total_folio ; ++ i) {
-		diagrams_[i] -> border_and_titleblock.setFolioData(i + 1, total_folio, project_properties_);
+		diagrams_[i] -> border_and_titleblock.setFolioData(i + 1, total_folio, project_wide_properties);
 	}
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/