diff --git a/sources/editor/ui/qetelementeditor.cpp b/sources/editor/ui/qetelementeditor.cpp index 45530dc98..31ce8482d 100644 --- a/sources/editor/ui/qetelementeditor.cpp +++ b/sources/editor/ui/qetelementeditor.cpp @@ -736,11 +736,13 @@ bool QETElementEditor::checkElement() QList warnings; QList errors; - // Warning #1: Element haven't got terminal + // Warning #1: Element does not have (enough) terminals // (except for report and conductor definition, because they must have one terminal and this checking is done below) + // (another exception: "thumbnails" aka "front-views" may/should not have terminals) if (!m_elmt_scene -> containsTerminals() && !(m_elmt_scene->elementData().m_type & ElementData::AllReport) && - m_elmt_scene->elementData().m_type != ElementData::ConductorDefinition) { + m_elmt_scene->elementData().m_type != ElementData::ConductorDefinition && + m_elmt_scene->elementData().m_type != ElementData::Thumbnail) { warnings << qMakePair( tr("Absence de borne", "warning title"), tr( @@ -749,50 +751,50 @@ bool QETElementEditor::checkElement() "warning description" ) ); - } + } - // Check folio report element - if (m_elmt_scene->elementData().m_type & ElementData::AllReport) - { - int terminal =0; + // Check folio report element + if (m_elmt_scene->elementData().m_type & ElementData::AllReport) + { + int terminal =0; - for(auto qgi : m_elmt_scene -> items()) { - if (qgraphicsitem_cast(qgi)) { - terminal ++; - } - } - - //Error folio report must have only one terminal - if (terminal != 1) { - errors << qMakePair (tr("Absence de borne"), - tr("
Erreur :" - "
Les reports de folio doivent posséder une seul borne." - "
Solution :" - "
Verifier que l'élément ne possède qu'une seul borne")); + for(auto qgi : m_elmt_scene -> items()) { + if (qgraphicsitem_cast(qgi)) { + terminal ++; } } - // Check conductor definition element - if (m_elmt_scene->elementData().m_type == ElementData::ConductorDefinition) - { - int terminal =0; + //Error folio report must have only one terminal + if (terminal != 1) { + errors << qMakePair (tr("Absence de borne"), + tr("
Erreur :" + "
Les reports de folio doivent posséder une seul borne." + "
Solution :" + "
Verifier que l'élément ne possède qu'une seul borne")); + } + } - for(auto qgi : m_elmt_scene -> items()) { - if (qgraphicsitem_cast(qgi)) { - terminal ++; - } - } + // Check conductor definition element + if (m_elmt_scene->elementData().m_type == ElementData::ConductorDefinition) + { + int terminal =0; - // Error: Conductor definition must have exactly one terminal - if (terminal != 1) { - errors << qMakePair (tr("Nombre de bornes incorrect"), - tr("
Erreur :" - "
Les définitions de conducteur ne peuvent posséder qu'une seule borne." - "
Solution :" - "
Vérifier que l'élément ne possède qu'une seule borne")); + for(auto qgi : m_elmt_scene -> items()) { + if (qgraphicsitem_cast(qgi)) { + terminal ++; } } + // Error: Conductor definition must have exactly one terminal + if (terminal != 1) { + errors << qMakePair (tr("Nombre de bornes incorrect"), + tr("
Erreur :" + "
Les définitions de conducteur ne peuvent posséder qu'une seule borne." + "
Solution :" + "
Vérifier que l'élément ne possède qu'une seule borne")); + } + } + if (!errors.count() && !warnings.count()) { return(true); }