Finish a move element with free terminal aligned with other terminal from other element, will create auto creation of conductor

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3594 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-01-09 17:18:16 +00:00
parent f782976fa7
commit 3e80f7076f
10 changed files with 179 additions and 98 deletions

View File

@@ -1380,15 +1380,6 @@ void Conductor::setHighlighted(Conductor::Highlight hl) {
update();
}
/**
* @brief Conductor::autoText
*lance l'autoNumerotation sur ce conducteur
*/
void Conductor::autoText() {
ConductorAutoNumerotation can(this);
can.numerate();
}
/**
Met a jour les proprietes du conducteur apres modification du champ de texte affiche
*/
@@ -1396,21 +1387,26 @@ void Conductor::displayedTextChanged() {
// verifie que le texte a reellement change
if (text_item -> toPlainText() == properties_.text) return;
if (Diagram *my_diagram = diagram()) {
if (Diagram *my_diagram = diagram())
{
int qmbreturn=0;
//if conductor isn't alone at this potential
//ask user to apply text on every conductors of this potential
if (relatedPotentialConductors().size() >= 1){
//if conductor isn't alone at this potential
//ask user to apply text on every conductors of this potential
if (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(this);
if (qmbreturn == QMessageBox::Yes)
{
ConductorAutoNumerotation can(this, my_diagram);
can.applyText(text_item -> toPlainText());
}
}
if (qmbreturn == 0 || qmbreturn == QMessageBox::No) {
if (qmbreturn == 0 || qmbreturn == QMessageBox::No)
{
// initialise l'objet UndoCommand correspondant
ConductorProperties new_properties(properties_);
new_properties.text = text_item -> toPlainText();