Refactoring.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-05-23 17:42:53 +03:00
parent 2034f94aa9
commit 71930befed
12 changed files with 17 additions and 61 deletions

View File

@ -88,16 +88,6 @@ void VAbstractSpline::DetailsMode(bool mode)
ShowHandles(detailsMode);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChangedActivDraw disable or enable context menu after change active pattern peace.
* @param newName new name active pattern peace.
*/
void VAbstractSpline::ChangedActivDraw(const QString &newName)
{
Disable(!(nameActivDraw == newName));
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ShowTool highlight tool.

View File

@ -51,7 +51,7 @@ public:
public slots:
virtual void FullUpdateFromFile ();
void Disable(bool disable);
virtual void Disable(bool disable);
void DetailsMode(bool mode);
signals:
/**
@ -80,7 +80,6 @@ protected:
* @brief RefreshGeometry refresh item on scene.
*/
virtual void RefreshGeometry ()=0;
virtual void ChangedActivDraw ( const QString &newName );
virtual void ShowTool(quint32 id, bool enable);
virtual void SetFactor(qreal factor);
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event );

View File

@ -72,6 +72,16 @@ void VDrawTool::ShowTool(quint32 id, bool enable)
Q_UNUSED(enable);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChangedActivDraw disable or enable context menu after change active pattern peace.
* @param newName new name active pattern peace.
*/
void VDrawTool::ChangedActivDraw(const QString &newName)
{
Disable(!(nameActivDraw == newName));
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChangedNameDraw save new name active pattern peace.

View File

@ -64,12 +64,13 @@ public:
public slots:
virtual void ShowTool(quint32 id, bool enable);
virtual void ChangedActivDraw(const QString &newName) = 0;
virtual void ChangedActivDraw(const QString &newName);
void ChangedNameDraw(const QString &oldName, const QString &newName);
virtual void FullUpdateFromGuiOk(int result);
virtual void FullUpdateFromGuiApply();
virtual void SetFactor(qreal factor);
virtual void EnableToolMove(bool move);
virtual void Disable(bool disable)=0;
protected:
/** @brief nameActivDraw name of tool's pattern peace. */

View File

@ -57,16 +57,6 @@ VToolCut::VToolCut(VPattern *doc, VContainer *data, const quint32 &id, const QSt
secondCurve->setVisible(false);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChangedActivDraw disable or enable context menu after change active pattern peace.
* @param newName new name active pattern peace.
*/
void VToolCut::ChangedActivDraw(const QString &newName)
{
Disable(!(nameActivDraw == newName));
}
//---------------------------------------------------------------------------------------------------------------------
void VToolCut::HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirection direction)
{

View File

@ -51,10 +51,9 @@ public:
void setCurveCutId(const quint32 &value);
public slots:
virtual void ChangedActivDraw(const QString &newName);
virtual void CurveChoosed(quint32 id)=0;
void HoverPath(quint32 id, SimpleCurvePoint curvePosition, PathDirection direction);
void Disable(bool disable);
virtual void Disable(bool disable);
void DetailsMode(bool mode);
protected:
/** @brief formula keep formula of length */

View File

@ -228,16 +228,6 @@ void VToolLine::Disable(bool disable)
this->setPen(QPen(QColor(baseColor), qApp->toPixel(qApp->widthHairLine())/factor, LineStyleToPenStyle(typeLine)));
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChangedActivDraw disable or enable context menu after change active pattern peace.
* @param newName new name active pattern peace.
*/
void VToolLine::ChangedActivDraw(const QString &newName)
{
Disable(!(nameActivDraw == newName));
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief contextMenuEvent handle context menu events.

View File

@ -64,10 +64,9 @@ public:
virtual void SetLineColor(const QString &value);
public slots:
virtual void FullUpdateFromFile();
virtual void ChangedActivDraw(const QString &newName);
virtual void ShowTool(quint32 id, bool enable);
virtual void SetFactor(qreal factor);
void Disable(bool disable);
virtual void Disable(bool disable);
protected:
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
virtual void AddToFile();

View File

@ -64,16 +64,6 @@ VToolLinePoint::~VToolLinePoint()
delete mainLine;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChangedActivDraw disable or enable context menu after change active pattern peace.
* @param newName new name active pattern peace.
*/
void VToolLinePoint::ChangedActivDraw(const QString &newName)
{
Disable(!(nameActivDraw == newName));
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief RefreshGeometry refresh item on scene.

View File

@ -55,9 +55,8 @@ public:
void SetAngle(const qreal &value);
public slots:
virtual void ChangedActivDraw(const QString &newName);
virtual void SetFactor(qreal factor);
void Disable(bool disable);
virtual void Disable(bool disable);
protected:
/** @brief formula string with length formula. */
QString formulaLength;

View File

@ -140,16 +140,6 @@ void VToolPoint::UpdateNamePosition(qreal mx, qreal my)
qApp->getUndoStack()->push(moveLabel);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChangedActivDraw disable or enable context menu after change active pattern peace.
* @param newName new name active pattern peace.
*/
void VToolPoint::ChangedActivDraw(const QString &newName)
{
Disable(!(nameActivDraw == newName));
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ShowTool highlight tool.

View File

@ -53,10 +53,9 @@ public:
void setEnabled(bool enabled);
public slots:
void NameChangePosition(const QPointF &pos);
virtual void ChangedActivDraw(const QString &newName);
virtual void ShowTool(quint32 id, bool enable);
virtual void SetFactor(qreal factor);
void Disable(bool disable);
virtual void Disable(bool disable);
void DeleteFromLabel();
virtual void EnableToolMove(bool move);
void PointChoosed();