From a58ed2d91c5e99472d8e47dae00ef917cf6571d0 Mon Sep 17 00:00:00 2001 From: blacksun Date: Sat, 25 Apr 2015 08:43:00 +0000 Subject: [PATCH] Add title block embedded in a project (but not in common or custom collection) available as a default title block for a new diagram in this project. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3919 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/configpages.cpp | 1 + sources/qetproject.cpp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sources/configpages.cpp b/sources/configpages.cpp index 85e2fa164..e08b599e6 100644 --- a/sources/configpages.cpp +++ b/sources/configpages.cpp @@ -46,6 +46,7 @@ NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent) : // default titleblock properties QList c; c << QETApp::commonTitleBlockTemplatesCollection() << QETApp::customTitleBlockTemplatesCollection(); + if (m_project) c << m_project->embeddedTitleBlockTemplatesCollection(); ipw = new TitleBlockPropertiesWidget(c, TitleBlockProperties::defaultProperties(), true); // default conductor properties cpw = new ConductorPropertiesWidget(ConductorProperties::defaultProperties()); diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index a98974d1d..c4184939e 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -456,8 +456,21 @@ void QETProject::setDefaultTitleBlockProperties(const TitleBlockProperties &titl if (!titleblock.template_name.isEmpty()) { TitleBlockTemplatesFilesCollection *collection = nullptr; - collection = titleblock.collection == QET::QetCollection::Common ? QETApp::commonTitleBlockTemplatesCollection() : - QETApp::customTitleBlockTemplatesCollection(); + switch (titleblock.collection) + { + case QET::Common : + collection = QETApp::commonTitleBlockTemplatesCollection(); + break; + case QET::Custom : + collection = QETApp::customTitleBlockTemplatesCollection(); + break; + case QET::Embendded : + //Titleblock is already embedded to project + return; + default: + return; + } + QScopedPointer m(new IntegrationMoveTitleBlockTemplatesHandler); integrateTitleBlockTemplate(collection -> location(titleblock.template_name), m.data()); }