mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
The project title is now made available to child diagrams as %projecttitle.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1893 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -122,12 +122,14 @@ QString ProjectMainConfigPage::projectTitle() const {
|
||||
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 @@ void ProjectMainConfigPage::initLayout() {
|
||||
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);
|
||||
|
||||
@@ -89,6 +89,7 @@ class ProjectMainConfigPage : public ProjectConfigPage {
|
||||
protected:
|
||||
QLabel *title_label_;
|
||||
QLineEdit *title_value_;
|
||||
QLabel *title_information_;
|
||||
QLabel *project_variables_label_;
|
||||
DiagramContextWidget *project_variables_;
|
||||
};
|
||||
|
||||
@@ -297,6 +297,7 @@ void QETProject::setTitle(const QString &title) {
|
||||
project_title_ = title;
|
||||
emit(projectTitleChanged(this, project_title_));
|
||||
emit(projectInformationsChanged(this));
|
||||
updateDiagramsFolioData();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1204,8 +1205,12 @@ bool QETProject::projectWasModified() {
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user