Element info keys : replace all -(minus) by _(underscore)

This change will brake all information with -(minus) from projects
created before this commit, but in the other side the use of data bases
for QET will be more easily to understand by avoid to replace the
-(minus) by _(underscore) in the tables of data bases.
Sorry for that, it's for your good.
This commit is contained in:
Claveau Joshua
2020-03-26 15:29:15 +01:00
parent f7a090c3ca
commit fb7cc6fd3e
291 changed files with 1581 additions and 1581 deletions

View File

@@ -183,13 +183,13 @@ namespace autonum
str.replace("%{description}", dc.value("description").toString());
str.replace("%{designation}", dc.value("designation").toString());
str.replace("%{manufacturer}", dc.value("manufacturer").toString());
str.replace("%{manufacturer-reference}", dc.value("manufacturer-reference").toString());
str.replace("%{manufacturer_reference}", dc.value("manufacturer_reference").toString());
str.replace("%{supplier}", dc.value("supplier").toString());
str.replace("%{quantity}", dc.value("quantity").toString());
str.replace("%{unity}", dc.value("unity").toString());
str.replace("%{auxiliary1}", dc.value("auxiliary1").toString());
str.replace("%{auxiliary2}", dc.value("auxiliary2").toString());
str.replace("%{machine-manufacturer-reference}", dc.value("machine-manufacturer-reference").toString());
str.replace("%{machine_manufacturer_reference}", dc.value("machine_manufacturer_reference").toString());
str.replace("%{location}", dc.value("location").toString());
str.replace("%{function}", dc.value("function").toString());
str.replace("%{void}", QString());

View File

@@ -261,7 +261,7 @@ void ConductorProperties::toXml(QDomElement &e) const
e.setAttribute("num", text);
e.setAttribute("formula", m_formula);
e.setAttribute("function", m_function);
e.setAttribute("tension-protocol", m_tension_protocol);
e.setAttribute("tension_protocol", m_tension_protocol);
e.setAttribute("numsize", QString::number(text_size));
e.setAttribute("condsize", QString::number(cond_size));
e.setAttribute("displaytext", m_show_text);
@@ -313,7 +313,7 @@ void ConductorProperties::fromXml(QDomElement &e)
text = e.attribute("num");
m_formula = e.attribute("formula");
m_function = e.attribute("function");
m_tension_protocol = e.attribute("tension-protocol");
m_tension_protocol = e.attribute("tension_protocol");
text_size = e.attribute("numsize", QString::number(9)).toInt();
cond_size = e.attribute("condsize", QString::number(1)).toDouble();
m_show_text = e.attribute("displaytext", QString::number(1)).toInt();
@@ -346,7 +346,7 @@ void ConductorProperties::toSettings(QSettings &settings, const QString &prefix)
settings.setValue(prefix + "text", text);
settings.setValue(prefix + "formula", m_formula);
settings.setValue(prefix + "function", m_function);
settings.setValue(prefix + "tension-protocol", m_tension_protocol);
settings.setValue(prefix + "tension_protocol", m_tension_protocol);
settings.setValue(prefix + "textsize", QString::number(text_size));
settings.setValue(prefix + "size", QString::number(cond_size));
settings.setValue(prefix + "displaytext", m_show_text);
@@ -384,7 +384,7 @@ void ConductorProperties::fromSettings(QSettings &settings, const QString &prefi
text = settings.value(prefix + "text", "_").toString();
m_formula = settings.value(prefix + "formula", "").toString();
m_function = settings.value(prefix + "function", "").toString();
m_tension_protocol = settings.value(prefix + "tension-protocol", "").toString();
m_tension_protocol = settings.value(prefix + "tension_protocol", "").toString();
text_size = settings.value(prefix + "textsize", "7").toInt();
cond_size = settings.value(prefix + "size", "1").toInt();
m_show_text = settings.value(prefix + "displaytext", true).toBool();

View File

@@ -40,12 +40,12 @@
* plant -> the plant assigned to the element
* comment -> a little comment wich can be displayed in the folio
* manufacturer -> the manufacturer of the element
* manufacturer-reference -> the manufacturer reference of the element
* manufacturer_reference -> the manufacturer reference of the element
* quantity -> quantity of the element
* unity -> unity of the element
* auxiliary1 -> auxiliary 1 of element
* auxiliary2 -> auxiliary 2 of element
* machine-manufacturer-reference -> reference of the machine manufacturer
* machine_manufacturer_reference -> reference of the machine manufacturer
* supplier -> the supplier of the element
* function -> the function of element
* location -> the location assigned to the element

View File

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

View File

@@ -152,7 +152,7 @@ void ElementPropertiesEditorWidget::updateTree()
*/
void ElementPropertiesEditorWidget::populateTree()
{
QStringList keys{"label", "plant", "comment", "description", "designation", "manufacturer", "manufacturer-reference", "supplier", "quantity", "unity", "machine-manufacturer-reference"};
QStringList keys{"label", "plant", "comment", "description", "designation", "manufacturer", "manufacturer_reference", "supplier", "quantity", "unity", "machine_manufacturer_reference"};
for(const QString& key : keys)
{

View File

@@ -179,13 +179,13 @@ QString nomenclature::getElementInfo(Element *elmt) {
info += autonum::AssignVariables::formulaToLabel(elmt_info["plant"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["comment"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["manufacturer"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["manufacturer-reference"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["manufacturer_reference"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["supplier"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["quantity"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["unity"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["auxiliary1"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["auxiliary2"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["machine-manufacturer-reference"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["machine_manufacturer_reference"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["location"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + ";";
info += autonum::AssignVariables::formulaToLabel(elmt_info["function"].toString(), elmt->rSequenceStruct(), elmt->diagram(), elmt) + "\n";

View File

@@ -1145,7 +1145,7 @@ void DynamicElementTextItem::conductorPropertiesChanged()
{
if(m_info_name == "function")
setPlainText(m_watched_conductor? m_watched_conductor.data()->properties().m_function : "");
else if (m_info_name == "tension-protocol")
else if (m_info_name == "tension_protocol")
setPlainText(m_watched_conductor? m_watched_conductor.data()->properties().m_tension_protocol : "");
}
else if (m_text_from == CompositeText) {
@@ -1179,8 +1179,8 @@ QString DynamicElementTextItem::reportReplacedCompositeText() const
{
if(string.contains("%{function}"))
string.replace("%{function}", m_watched_conductor.data()->properties().m_function);
if(string.contains("%{tension-protocol}"))
string.replace("%{tension-protocol}", m_watched_conductor.data()->properties().m_tension_protocol);
if(string.contains("%{tension_protocol}"))
string.replace("%{tension_protocol}", m_watched_conductor.data()->properties().m_tension_protocol);
}
}

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";
}
else
{

View File

@@ -1781,7 +1781,7 @@ QStringList DynamicTextItemDelegate::availableInfo(DynamicElementTextItem *deti)
if (!cond->properties().m_function.isEmpty())
qstrl << "function";
if(!cond->properties().m_tension_protocol.isEmpty())
qstrl << "tension-protocol";
qstrl << "tension_protocol";
}
return qstrl;