mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-09 21:54:13 +02:00
Reapply "Feature: Terminal potential grouping"
This reverts commit 1793dcb9a8.
This commit is contained in:
@@ -84,6 +84,7 @@ void TerminalEditor::updateForm()
|
||||
ui->m_orientation_cb->setCurrentIndex(ui->m_orientation_cb->findData(m_part->property("orientation")));
|
||||
ui->m_name_le->setText(m_part->terminalName());
|
||||
ui->m_type_cb->setCurrentIndex(ui->m_type_cb->findData(m_part->terminalType()));
|
||||
ui->m_potential_le->setText(m_part->potential());
|
||||
|
||||
ui->m_show_name_cb->setChecked(m_part->showName());
|
||||
ui->m_label_x_dsb->setValue(m_part->labelPos().x());
|
||||
@@ -263,6 +264,24 @@ void TerminalEditor::nameEdited()
|
||||
m_locked=false;
|
||||
}
|
||||
|
||||
void TerminalEditor::potentialEdited()
|
||||
{
|
||||
if (m_locked) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_locked = true;
|
||||
QString potential_(ui->m_potential_le->text());
|
||||
|
||||
if (m_part->potential() != potential_)
|
||||
{
|
||||
auto undo = new QPropertyUndoCommand(m_part, "potential", m_part->property("potential"), potential_);
|
||||
undo->setText(tr("Modifier le potentiel d'une borne"));
|
||||
undoStack().push(undo);
|
||||
}
|
||||
m_locked = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalEditor::typeEdited
|
||||
*/
|
||||
@@ -458,6 +477,8 @@ void TerminalEditor::activeConnections(bool active)
|
||||
this, &TerminalEditor::labelAlignClicked);
|
||||
m_editor_connections << connect(ui->m_label_frame_cb, &QCheckBox::toggled,
|
||||
this, &TerminalEditor::labelFrameEdited);
|
||||
m_editor_connections << connect(ui->m_potential_le, &QLineEdit::editingFinished,
|
||||
this, &TerminalEditor::potentialEdited);
|
||||
m_editor_connections << connect(ui->m_use_master_label_cb, &QCheckBox::toggled,
|
||||
this, &TerminalEditor::useMasterLabelEdited);
|
||||
m_editor_connections << connect(ui->m_master_label_cb, QOverload<int>::of(&QComboBox::activated),
|
||||
@@ -487,6 +508,7 @@ void TerminalEditor::activeChangeConnections(bool active)
|
||||
m_change_connections << connect(m_part, &PartTerminal::labelVAlignmentChanged, this, &TerminalEditor::updateForm);
|
||||
m_change_connections << connect(m_part, &PartTerminal::labelFrameChanged, this, &TerminalEditor::updateForm);
|
||||
m_change_connections << connect(m_part, &PartTerminal::labelColorChanged, this, &TerminalEditor::updateForm);
|
||||
m_change_connections << connect(m_part, &PartTerminal::potentialChanged, this, &TerminalEditor::updateForm);
|
||||
m_change_connections << connect(m_part, &PartTerminal::useMasterLabelChanged, this, &TerminalEditor::updateForm);
|
||||
m_change_connections << connect(m_part, &PartTerminal::masterLabelIndexChanged, this, &TerminalEditor::updateForm);
|
||||
} else {
|
||||
|
||||
@@ -58,6 +58,7 @@ class TerminalEditor : public ElementItemEditor
|
||||
void orientationEdited();
|
||||
void nameEdited();
|
||||
void typeEdited();
|
||||
void potentialEdited();
|
||||
void showNameEdited();
|
||||
void labelPosEdited();
|
||||
void labelFontClicked();
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="m_name_le"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
@@ -61,7 +61,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Nom :</string>
|
||||
@@ -78,7 +78,21 @@
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="m_type_cb"/>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_potential">
|
||||
<property name="text">
|
||||
<string>Potentiel:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="m_potential_le">
|
||||
<property name="toolTip">
|
||||
<string>Sans effet si "Isolation du potentiel" n'est pas cochée (toutes les bornes du bloc restent alors reliées). Si elle est cochée : les bornes partageant la même valeur restent reliées entre elles, les autres sont isolées.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="m_label_gb">
|
||||
<property name="title">
|
||||
<string>Nom de la borne</string>
|
||||
@@ -214,7 +228,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="m_master_label_gb">
|
||||
<property name="title">
|
||||
<string>Étiquette du maître</string>
|
||||
|
||||
Reference in New Issue
Block a user