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:
blacksun
2015-08-29 14:18:30 +00:00
parent bda6d607b3
commit 1bdb13594b
16 changed files with 557 additions and 397 deletions

View File

@@ -20,9 +20,9 @@
#include "qetdiagrameditor.h"
#include "conductor.h"
#include "diagram.h"
#include "potentialtextsdialog.h"
#include "qet.h"
#include "QPropertyUndoCommand/qpropertyundocommand.h"
#include "potentialselectordialog.h"
/**
* @brief ConductorAutoNumerotation::ConductorAutoNumerotation
@@ -51,31 +51,6 @@ void ConductorAutoNumerotation::numerate() {
else if (conductor_ -> properties().type == ConductorProperties::Multi) numerateNewConductor();
}
/**
* @brief ConductorAutoNumerotation::checkPotential
* Check if eah texts of this potential is identical.
* If not, ask user how to numerate
* @param conductor
* A conductor of the potential to check.
*/
void ConductorAutoNumerotation::checkPotential(Conductor *conductor, QUndoCommand *parent) {
//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 (!QET::eachStrIsEqual(strl)) {
PotentialTextsDialog ptd(conductor, conductor->diagramEditor());
if ( ptd.exec() == QDialog::Accepted ) {
ConductorAutoNumerotation can(conductor, conductor -> diagram(), parent);
can.applyText(ptd.selectedText());
}
}
}
/**
* @brief ConductorAutoNumerotation::applyText
* apply the text @t to @conductor_ and all conductors at the same potential
@@ -130,9 +105,8 @@ void ConductorAutoNumerotation::numeratePotential()
//the texts isn't identicals
else
{
PotentialTextsDialog ptd (conductor_, conductor_ -> diagramEditor());
ptd.exec();
applyText(ptd.selectedText());
PotentialSelectorDialog psd(conductor_, m_parent_undo, conductor_->diagramEditor());
psd.exec();
}
}