mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
The panel now highlights unused title block templates.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1477 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -723,6 +723,23 @@ bool QETProject::usesElement(const ElementsLocation &location) {
|
||||
return(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@param location Location of a title block template
|
||||
@return true if the provided template is used by at least one diagram
|
||||
within this project, false otherwise
|
||||
*/
|
||||
bool QETProject::usesTitleBlockTemplate(const TitleBlockTemplateLocation &location) {
|
||||
// a diagram can only use a title block template embedded wihtin its parent project
|
||||
if (location.parentProject() != this) return(false);
|
||||
|
||||
foreach (Diagram *diagram, diagrams()) {
|
||||
if (diagram -> usesTitleBlockTemplate(location.name())) {
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
/**
|
||||
Supprime tous les elements inutilises dans le projet
|
||||
@param handler Gestionnaire d'erreur
|
||||
@@ -1047,6 +1064,10 @@ void QETProject::addDiagram(Diagram *diagram) {
|
||||
this,
|
||||
SLOT(updateDiagramsFolioData())
|
||||
);
|
||||
connect(
|
||||
diagram, SIGNAL(usedTitleBlockTemplateChanged(const QString &)),
|
||||
this, SLOT(usedTitleBlockTemplateChanged(const QString &))
|
||||
);
|
||||
|
||||
// ajoute le schema au projet
|
||||
diagrams_ << diagram;
|
||||
@@ -1175,6 +1196,14 @@ void QETProject::removeDiagramsTitleBlockTemplate(TitleBlockTemplatesCollection
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Handles the fact a digram changed the title block template it used
|
||||
@param template_name Name of the template
|
||||
*/
|
||||
void QETProject::usedTitleBlockTemplateChanged(const QString &template_name) {
|
||||
emit(diagramUsedTemplate(embeddedTitleBlockTemplatesCollection(), template_name));
|
||||
}
|
||||
|
||||
/**
|
||||
Copie l'element integ_elmt dans la categorie target_cat en utilisant le
|
||||
gestionnaire handler ; en cas d'erreur, error_message est rempli.
|
||||
|
||||
Reference in New Issue
Block a user