Use variable "enabled" everywhere.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-02-06 11:58:04 +02:00
parent e94c5070dc
commit 16662a34d5
5 changed files with 9 additions and 12 deletions

View File

@ -85,9 +85,8 @@ void VAbstractSpline::Disable(bool disable)
void VAbstractSpline::ChangedActivDraw(const QString &newName)
{
VDrawTool::ChangedActivDraw(newName);
const bool selectable = (nameActivDraw == newName);
this->setEnabled(selectable);
emit setEnabledPoint(selectable);
this->setEnabled(enabled);
emit setEnabledPoint(enabled);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -60,10 +60,8 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt
void VToolCut::ChangedActivDraw(const QString &newName)
{
VToolPoint::ChangedActivDraw(newName);
const bool flag = (nameActivDraw == newName);
this->setEnabled(flag);
firstCurve->ChangedActivDraw(flag);
secondCurve->ChangedActivDraw(flag);
firstCurve->ChangedActivDraw(enabled);
secondCurve->ChangedActivDraw(enabled);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -238,7 +238,7 @@ void VToolLine::Disable(bool disable)
void VToolLine::ChangedActivDraw(const QString &newName)
{
VDrawTool::ChangedActivDraw(newName);
this->setEnabled(nameActivDraw == newName);
this->setEnabled(enabled);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -70,8 +70,8 @@ VToolLinePoint::~VToolLinePoint()
void VToolLinePoint::ChangedActivDraw(const QString &newName)
{
VToolPoint::ChangedActivDraw(newName);
this->setEnabled(nameActivDraw == newName);
mainLine->setEnabled(nameActivDraw == newName);
this->setEnabled(enabled);
mainLine->setEnabled(enabled);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -133,8 +133,8 @@ void VToolPoint::UpdateNamePosition(qreal mx, qreal my)
void VToolPoint::ChangedActivDraw(const QString &newName)
{
VDrawTool::ChangedActivDraw(newName);
this->setEnabled(nameActivDraw == newName);
namePoint->setEnabled(nameActivDraw == newName);
this->setEnabled(enabled);
namePoint->setEnabled(enabled);
}
//---------------------------------------------------------------------------------------------------------------------