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) void VAbstractSpline::ChangedActivDraw(const QString &newName)
{ {
VDrawTool::ChangedActivDraw(newName); VDrawTool::ChangedActivDraw(newName);
const bool selectable = (nameActivDraw == newName); this->setEnabled(enabled);
this->setEnabled(selectable); emit setEnabledPoint(enabled);
emit setEnabledPoint(selectable);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

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

View File

@ -238,7 +238,7 @@ void VToolLine::Disable(bool disable)
void VToolLine::ChangedActivDraw(const QString &newName) void VToolLine::ChangedActivDraw(const QString &newName)
{ {
VDrawTool::ChangedActivDraw(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) void VToolLinePoint::ChangedActivDraw(const QString &newName)
{ {
VToolPoint::ChangedActivDraw(newName); VToolPoint::ChangedActivDraw(newName);
this->setEnabled(nameActivDraw == newName); this->setEnabled(enabled);
mainLine->setEnabled(nameActivDraw == newName); mainLine->setEnabled(enabled);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

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