mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Conductor properties : Add two value, function and tension/protocol.
Revamp some widget to edit it. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4172 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -70,31 +70,14 @@ void ConductorPropertiesDialog::PropertiesDialog(Conductor *conductor, QWidget *
|
||||
QPropertyUndoCommand *undo = new QPropertyUndoCommand(conductor, "properties", old_value, new_value);
|
||||
undo->setText(tr("Modifier les propriétés d'un conducteur", "undo caption"));
|
||||
|
||||
if (!conductor->relatedPotentialConductors().isEmpty())
|
||||
if (!conductor->relatedPotentialConductors().isEmpty() && cpd.applyAll())
|
||||
{
|
||||
undo->setText(tr("Modifier les propriétés de plusieurs conducteurs", "undo caption"));
|
||||
QString old_text = conductor->properties().text;
|
||||
QString new_text = cpd.properties().text;
|
||||
|
||||
foreach (Conductor *potential_conductor, conductor->relatedPotentialConductors())
|
||||
{
|
||||
//"Apply to all conductors of potential" is checked,
|
||||
//we apply the new properties for every conductors in the same potential.
|
||||
if (cpd.applyAll())
|
||||
{
|
||||
old_value.setValue(potential_conductor->properties());
|
||||
new QPropertyUndoCommand (potential_conductor, "properties", old_value, new_value, undo);
|
||||
}
|
||||
//The num of conductor isn't affected by "Apply to all conductors of potential"
|
||||
//we always apply it to the potential if he change.
|
||||
else if(old_text != new_text)
|
||||
{
|
||||
old_value.setValue(potential_conductor->properties());
|
||||
ConductorProperties new_properties = potential_conductor->properties();
|
||||
new_properties.text = new_text;
|
||||
new_value.setValue(new_properties);
|
||||
new QPropertyUndoCommand (potential_conductor, "properties", old_value, new_value, undo);
|
||||
}
|
||||
old_value.setValue(potential_conductor->properties());
|
||||
new QPropertyUndoCommand (potential_conductor, "properties", old_value, new_value, undo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user