mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 00:30:53 +01:00
like rev 2096 without breaking code
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2099 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -982,13 +982,27 @@ void DiagramView::editConductor(Conductor *edited_conductor) {
|
||||
if (conductor_dialog.exec() == QDialog::Accepted) {
|
||||
// recupere les nouvelles proprietes
|
||||
ConductorProperties new_properties = cpw -> conductorProperties();
|
||||
|
||||
if (new_properties != old_properties) {
|
||||
// initialise l'objet UndoCommand correspondant
|
||||
ChangeConductorPropertiesCommand *ccpc = new ChangeConductorPropertiesCommand(edited_conductor);
|
||||
ccpc -> setOldSettings(old_properties);
|
||||
ccpc -> setNewSettings(new_properties);
|
||||
diagram() -> undoStack().push(ccpc);
|
||||
int qmbreturn=0;
|
||||
//if conductor isn't alone at this potential
|
||||
//ask user to apply text on every conductors of this potential
|
||||
if (edited_conductor -> relatedPotentialConductors().size() >= 1){
|
||||
qmbreturn = QMessageBox::question(diagramEditor(), tr("Textes de conducteurs"),
|
||||
tr("Voulez-vous appliquer le nouveau texte \n"
|
||||
"\340 l'ensemble des conducteurs de ce potentiel ?"),
|
||||
QMessageBox::No| QMessageBox::Yes, QMessageBox::Yes);
|
||||
if (qmbreturn == QMessageBox::Yes){
|
||||
ConductorAutoNumerotation can(edited_conductor);
|
||||
can.setText(new_properties.text);
|
||||
}
|
||||
}
|
||||
if (qmbreturn == 0 || qmbreturn == QMessageBox::No) {
|
||||
// initialise l'objet UndoCommand correspondant
|
||||
ChangeConductorPropertiesCommand *ccpc = new ChangeConductorPropertiesCommand(edited_conductor);
|
||||
ccpc -> setOldSettings(old_properties);
|
||||
ccpc -> setNewSettings(new_properties);
|
||||
diagram() -> undoStack().push(ccpc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user