mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 09:40:52 +01:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user