mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-28 06:40:51 +01:00
Add new conductors properties color and section
This commit is contained in:
@@ -400,6 +400,8 @@ ConductorProperties SearchAndReplaceWorker::applyChange(const ConductorPropertie
|
||||
new_properties.m_show_text = change.m_show_text;
|
||||
new_properties.m_function = applyChange(new_properties.m_function, change.m_function);
|
||||
new_properties.m_tension_protocol = applyChange(new_properties.m_tension_protocol, change.m_tension_protocol);
|
||||
new_properties.m_wire_color = applyChange(new_properties.m_wire_color, change.m_wire_color);
|
||||
new_properties.m_wire_section = applyChange(new_properties.m_wire_section, change.m_wire_section);
|
||||
if(change.m_vertical_alignment == Qt::AlignLeft ||
|
||||
change.m_vertical_alignment == Qt::AlignRight) {new_properties.m_vertical_alignment = change.m_vertical_alignment;}
|
||||
if(change.m_horizontal_alignment == Qt::AlignTop ||
|
||||
@@ -501,6 +503,8 @@ ConductorProperties SearchAndReplaceWorker::replaceAdvanced(Conductor *conductor
|
||||
else if (what == "text") {properties.text.replace(rx, replace);}
|
||||
else if (what == "function") {properties.m_function.replace(rx, replace);}
|
||||
else if (what == "tension/protocol") {properties.m_tension_protocol.replace(rx, replace);}
|
||||
else if (what == "couleur-conducteur") {properties.m_wire_color.replace(rx, replace);}
|
||||
else if (what == "section-conducteur") {properties.m_wire_section.replace(rx, replace);}
|
||||
}
|
||||
|
||||
return properties;
|
||||
|
||||
@@ -83,6 +83,8 @@ void ReplaceConductorDialog::setProperties(const ConductorProperties &properties
|
||||
sarw::setupLineEdit(ui->m_text_le, ui->m_erase_text_cb, m_properties.text);
|
||||
sarw::setupLineEdit(ui->m_function_le, ui->m_erase_function_cb, m_properties.m_function);
|
||||
sarw::setupLineEdit(ui->m_tension_protocol_le, ui->m_erase_tension_protocol_cb, m_properties.m_tension_protocol);
|
||||
sarw::setupLineEdit(ui->m_wire_color_le, ui->m_erase_wire_color_cb, m_properties.m_wire_color);
|
||||
sarw::setupLineEdit(ui->m_wire_section_le,ui->m_erase_wire_section_cb,m_properties.m_wire_section);
|
||||
switch (m_properties.m_vertical_alignment) {
|
||||
case Qt::AlignLeft: ui->m_vertical_align_cb->setCurrentIndex(1);break;
|
||||
case Qt::AlignRight: ui->m_vertical_align_cb->setCurrentIndex(2);break;
|
||||
@@ -140,6 +142,8 @@ ConductorProperties ReplaceConductorDialog::properties() const
|
||||
properties_.m_show_text = ui->m_show_text->isChecked();
|
||||
properties_.m_function = ui->m_function_le->text();
|
||||
properties_.m_tension_protocol = ui->m_tension_protocol_le->text();
|
||||
properties_.m_wire_color =ui->m_wire_color_le->text();
|
||||
properties_.m_wire_section =ui->m_wire_section_le->text();
|
||||
switch (ui->m_vertical_align_cb->currentIndex()) {
|
||||
case 0: properties_.m_vertical_alignment = Qt::AlignAbsolute; break;
|
||||
case 1: properties_.m_vertical_alignment = Qt::AlignLeft; break;
|
||||
@@ -227,6 +231,18 @@ void ReplaceConductorDialog::on_m_erase_tension_protocol_cb_clicked()
|
||||
ui->m_tension_protocol_le->setDisabled(ui->m_erase_tension_protocol_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceConductorDialog::on_m_erase_m_wire_color_cb_clicked()
|
||||
{
|
||||
ui->m_wire_color_le->setText(ui->m_erase_wire_color_cb->isChecked() ? SearchAndReplaceWorker::eraseText() : QString());
|
||||
ui->m_wire_color_le->setDisabled(ui->m_erase_wire_color_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceConductorDialog::on_m_erase_m_wire_section_cb_clicked()
|
||||
{
|
||||
ui->m_wire_section_le->setText(ui->m_erase_wire_section_cb->isChecked() ? SearchAndReplaceWorker::eraseText() : QString());
|
||||
ui->m_wire_section_le->setDisabled(ui->m_erase_wire_section_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceConductorDialog::on_m_earth_cb_toggled(bool checked)
|
||||
{
|
||||
if (checked && ui->m_neutral_cb -> isChecked()) {
|
||||
|
||||
@@ -51,6 +51,8 @@ class ReplaceConductorDialog : public QDialog
|
||||
void on_m_erase_text_cb_clicked();
|
||||
void on_m_erase_function_cb_clicked();
|
||||
void on_m_erase_tension_protocol_cb_clicked();
|
||||
void on_m_erase_m_wire_color_cb_clicked();
|
||||
void on_m_erase_m_wire_section_cb_clicked();
|
||||
void on_m_earth_cb_toggled(bool checked);
|
||||
void on_m_neutral_cb_toggled(bool checked);
|
||||
void on_m_update_preview_pb_clicked();
|
||||
|
||||
@@ -36,49 +36,6 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0,0,0,0">
|
||||
<item row="7" column="1">
|
||||
<widget class="QComboBox" name="m_horizontal_align_cb">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>En haut</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>En bas</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Texte sur conducteur horizontal :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_formula_le">
|
||||
<property name="placeholderText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Tension / protocol :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_function_le">
|
||||
<property name="placeholderText">
|
||||
@@ -89,83 +46,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_text_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Fonction :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Formule du texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QCheckBox" name="m_show_text">
|
||||
<property name="toolTip">
|
||||
<string>Texte visible</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Angle :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_tension_protocol_le">
|
||||
<property name="placeholderText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="4">
|
||||
<widget class="QSpinBox" name="m_text_size_sb">
|
||||
<property name="specialValueText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Texte sur conducteur vertical :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@@ -173,34 +53,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_tension_protocol_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_function_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="m_vertical_align_cb">
|
||||
<property name="currentText">
|
||||
<string>Ne pas modifier</string>
|
||||
@@ -222,6 +75,30 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Angle :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Couleur du conducteur</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_formula_cb">
|
||||
<property name="toolTip">
|
||||
@@ -232,17 +109,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Angle :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3" colspan="2">
|
||||
<item row="8" column="3" colspan="2">
|
||||
<widget class="QSpinBox" name="m_vertical_angle_sb">
|
||||
<property name="wrapping">
|
||||
<bool>true</bool>
|
||||
@@ -267,7 +134,56 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="3" colspan="2">
|
||||
<item row="4" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_function_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QComboBox" name="m_horizontal_align_cb">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>En haut</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>En bas</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_text_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_formula_le">
|
||||
<property name="placeholderText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="3" colspan="2">
|
||||
<widget class="QSpinBox" name="m_horizontal_angle_sb">
|
||||
<property name="wrapping">
|
||||
<bool>true</bool>
|
||||
@@ -289,6 +205,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Formule du texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_tension_protocol_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QLineEdit" name="m_text_le">
|
||||
<property name="placeholderText">
|
||||
@@ -299,6 +232,107 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Texte sur conducteur vertical :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="4">
|
||||
<widget class="QSpinBox" name="m_text_size_sb">
|
||||
<property name="specialValueText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Fonction :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Angle :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QCheckBox" name="m_show_text">
|
||||
<property name="toolTip">
|
||||
<string>Texte visible</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_tension_protocol_le">
|
||||
<property name="placeholderText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Texte sur conducteur horizontal :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Tension / protocol :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>Section du conducteur</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_wire_color_cb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_wire_section_cb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_wire_color_le"/>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_wire_section_le"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -793,6 +793,8 @@ QStringList SearchAndReplaceWidget::searchTerms(Conductor *conductor)
|
||||
list.append(properties.text);
|
||||
list.append(properties.m_function);
|
||||
list.append(properties.m_tension_protocol);
|
||||
list.append(properties.m_wire_color);
|
||||
list.append(properties.m_wire_section);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user