mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-06 21:29:59 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user