mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
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
This commit is contained in:
@@ -46,6 +46,7 @@ NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent) :
|
|||||||
// default titleblock properties
|
// default titleblock properties
|
||||||
QList <TitleBlockTemplatesCollection *> c;
|
QList <TitleBlockTemplatesCollection *> c;
|
||||||
c << QETApp::commonTitleBlockTemplatesCollection() << QETApp::customTitleBlockTemplatesCollection();
|
c << QETApp::commonTitleBlockTemplatesCollection() << QETApp::customTitleBlockTemplatesCollection();
|
||||||
|
if (m_project) c << m_project->embeddedTitleBlockTemplatesCollection();
|
||||||
ipw = new TitleBlockPropertiesWidget(c, TitleBlockProperties::defaultProperties(), true);
|
ipw = new TitleBlockPropertiesWidget(c, TitleBlockProperties::defaultProperties(), true);
|
||||||
// default conductor properties
|
// default conductor properties
|
||||||
cpw = new ConductorPropertiesWidget(ConductorProperties::defaultProperties());
|
cpw = new ConductorPropertiesWidget(ConductorProperties::defaultProperties());
|
||||||
|
|||||||
@@ -456,8 +456,21 @@ void QETProject::setDefaultTitleBlockProperties(const TitleBlockProperties &titl
|
|||||||
if (!titleblock.template_name.isEmpty())
|
if (!titleblock.template_name.isEmpty())
|
||||||
{
|
{
|
||||||
TitleBlockTemplatesFilesCollection *collection = nullptr;
|
TitleBlockTemplatesFilesCollection *collection = nullptr;
|
||||||
collection = titleblock.collection == QET::QetCollection::Common ? QETApp::commonTitleBlockTemplatesCollection() :
|
switch (titleblock.collection)
|
||||||
QETApp::customTitleBlockTemplatesCollection();
|
{
|
||||||
|
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<IntegrationMoveTitleBlockTemplatesHandler> m(new IntegrationMoveTitleBlockTemplatesHandler);
|
QScopedPointer<IntegrationMoveTitleBlockTemplatesHandler> m(new IntegrationMoveTitleBlockTemplatesHandler);
|
||||||
integrateTitleBlockTemplate(collection -> location(titleblock.template_name), m.data());
|
integrateTitleBlockTemplate(collection -> location(titleblock.template_name), m.data());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user