Add new variables for report folio and can be added in a composite text

{conductor_color}
{conductor_section}
This commit is contained in:
Laurent Trinques
2020-07-05 14:01:38 +02:00
parent beaa2ccdc8
commit fb75bf0a73
3 changed files with 12 additions and 2 deletions

View File

@@ -190,7 +190,7 @@ void DynamicTextFieldEditor::fillInfoComboBox()
QString type = elementEditor()->elementScene()->elementType();
if(type.contains("report"))
strl << "function" << "tension_protocol";
strl << "function" << "tension_protocol" << "conductor_color" << "conductor_section";
else
strl = QETApp::elementInfoKeys();

View File

@@ -298,6 +298,8 @@ QStringList QETApp::elementInfoKeys()
<< "comment"
<< "function"
<< "tension_protocol"
<< "conductor_color"
<< "conductor_section"
<< "auxiliary1"
<< "auxiliary2"
@@ -329,6 +331,8 @@ QString QETApp::elementTranslatedInfoKey(const QString &info)
else if (info == "comment") return tr("Commentaire");
else if (info == "function") return tr("Fonction");
else if (info == "tension_protocol") return tr("Tension / Protocole");
else if (info == "conductor_color") return tr("conductor_color");
else if (info == "conductor_section") return tr("conductor_section");
else if (info == "auxiliary1") return tr("Bloc auxiliaire 1");
else if (info == "auxiliary2") return tr("Bloc auxiliaire 2");
@@ -369,6 +373,8 @@ QString QETApp::elementInfoToVar(const QString &info)
else if (info == "location") return QString("%{location}");
else if (info == "function") return QString("%{function}");
else if (info == "tension_protocol") return QString("%{tension_protocol}");
else if (info == "conductor_color") return QString("%{conductor_color}");
else if (info == "conductor_section") return QString("%{conductor_section}");
return (QString ("%{void}"));
}
@@ -384,6 +390,8 @@ QStringList QETApp::conductorInfoKeys()
keys.append("text");
keys.append("function");
keys.append("tension/protocol");
keys.append("conductor_color");
keys.append("conductor_section");
return keys;
}
@@ -400,6 +408,8 @@ QString QETApp::conductorTranslatedInfoKey(const QString &key)
else if (key == "text") return tr("Texte");
else if (key == "function") return tr("Fonction");
else if (key == "tension/protocol") return tr("Tension / Protocole");
else if (key == "conductor_color") return tr("conductor_color");
else if (key == "conductor_section")return tr("conductor_section");
return QString();
}

View File

@@ -56,7 +56,7 @@ void CompositeTextEditDialog::setUpComboBox()
if(m_text && (m_text->parentElement()->linkType() & Element::AllReport)) //Special treatment for text owned by a folio report
{
qstrl << "label" << "function" << "tension_protocol";
qstrl << "label" << "function" << "tension_protocol" << "conductor_color" << "conductor_section";
}
else
{