When link report, check if all text of the potential is equal.

If not ask user what must to do.


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2801 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-02-04 18:03:02 +00:00
parent 93d1782c2e
commit 5ace5ba5ee
3 changed files with 36 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2006-2014 The QElectroTech Team
Copyright 2006-2014 The QElectroTech team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
@@ -79,6 +79,30 @@ void ConductorAutoNumerotation::numerateDiagram() {
}
}
/**
* @brief ConductorAutoNumerotation::checkPotential
* Check if text of this potential is identical.
* If not, ask user how to numerate
* @param conductor
* One conductor of this potential.
*/
void ConductorAutoNumerotation::checkPotential(Conductor *conductor) {
//fill list of potential
QSet <Conductor *> c_list = conductor->relatedPotentialConductors();
c_list << conductor;
//fill list of text
QStringList strl;
foreach (const Conductor *c, c_list) strl<<(c->text());
//check text list, isn't same in potential, ask user what to do
if (!eachIsEqual(strl)) {
ConductorAutoNumerotationWidget *canw = new ConductorAutoNumerotationWidget(conductor, c_list, conductor -> diagramEditor());
ConductorAutoNumerotation can(conductor);
connect(canw, SIGNAL(textIsSelected(QString)), &can, SLOT(applyText(QString)));
canw -> exec();
}
}
/**
* @brief ConductorAutoNumerotation::applyText
* apply the text @t to @conductor_ and all conductors at the same potential