From aa054e2507055901318ccb6f4a0c35684e2e88e6 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 5 Feb 2014 16:03:26 +0200 Subject: [PATCH] Don't allow save pattern file if we just change size or height. --HG-- branch : develop --- src/mainwindow.h | 2 +- src/tools/drawTools/vtoolalongline.cpp | 1 + src/tools/drawTools/vtoolarc.cpp | 1 + src/tools/drawTools/vtoolbisector.cpp | 1 + src/tools/drawTools/vtoolcutarc.cpp | 1 + src/tools/drawTools/vtoolcutspline.cpp | 1 + src/tools/drawTools/vtoolcutsplinepath.cpp | 1 + src/tools/drawTools/vtoolendline.cpp | 1 + src/tools/drawTools/vtoolheight.cpp | 1 + src/tools/drawTools/vtoolline.cpp | 1 + src/tools/drawTools/vtoollineintersect.cpp | 1 + src/tools/drawTools/vtoolnormal.cpp | 1 + src/tools/drawTools/vtoolpointofcontact.cpp | 1 + src/tools/drawTools/vtoolpointofintersection.cpp | 1 + src/tools/drawTools/vtoolshoulderpoint.cpp | 1 + src/tools/drawTools/vtoolsinglepoint.cpp | 1 + src/tools/drawTools/vtoolspline.cpp | 1 + src/tools/drawTools/vtoolsplinepath.cpp | 1 + src/tools/drawTools/vtooltriangle.cpp | 1 + src/tools/vabstracttool.cpp | 1 + src/tools/vtooldetail.cpp | 1 + src/xml/vdomdocument.cpp | 1 - 22 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.h b/src/mainwindow.h index d578dacf2..cc5da1990 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -139,7 +139,7 @@ public slots: * @brief ChangedGrowth change new height value. * @param text value height. */ - void ChangedGrowth(const QString & text); + void ChangedHeight(const QString & text); /** * @brief ClosedActionTable actions after closing table with variables. */ diff --git a/src/tools/drawTools/vtoolalongline.cpp b/src/tools/drawTools/vtoolalongline.cpp index 5fab3be25..9ad9181c8 100644 --- a/src/tools/drawTools/vtoolalongline.cpp +++ b/src/tools/drawTools/vtoolalongline.cpp @@ -75,6 +75,7 @@ void VToolAlongLine::FullUpdateFromGui(int result) SetAttribute(domElement, AttrFirstPoint, dialogAlongLine->getFirstPointId()); SetAttribute(domElement, AttrSecondPoint, dialogAlongLine->getSecondPointId()); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogAlongLine.clear(); diff --git a/src/tools/drawTools/vtoolarc.cpp b/src/tools/drawTools/vtoolarc.cpp index d6462bb3b..681a389ba 100644 --- a/src/tools/drawTools/vtoolarc.cpp +++ b/src/tools/drawTools/vtoolarc.cpp @@ -149,6 +149,7 @@ void VToolArc::FullUpdateFromGui(int result) SetAttribute(domElement, AttrAngle1, dialogArc->GetF1()); SetAttribute(domElement, AttrAngle2, dialogArc->GetF2()); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogArc.clear(); diff --git a/src/tools/drawTools/vtoolbisector.cpp b/src/tools/drawTools/vtoolbisector.cpp index c57ffc44e..80defed64 100644 --- a/src/tools/drawTools/vtoolbisector.cpp +++ b/src/tools/drawTools/vtoolbisector.cpp @@ -171,6 +171,7 @@ void VToolBisector::FullUpdateFromGui(int result) SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogBisector->getSecondPointId())); SetAttribute(domElement, AttrThirdPoint, QString().setNum(dialogBisector->getThirdPointId())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogBisector.clear(); diff --git a/src/tools/drawTools/vtoolcutarc.cpp b/src/tools/drawTools/vtoolcutarc.cpp index 0337e231f..4d4ea866b 100644 --- a/src/tools/drawTools/vtoolcutarc.cpp +++ b/src/tools/drawTools/vtoolcutarc.cpp @@ -175,6 +175,7 @@ void VToolCutArc::FullUpdateFromGui(int result) SetAttribute(domElement, AttrLength, dialogCutArc->getFormula()); SetAttribute(domElement, AttrArc, QString().setNum(dialogCutArc->getArcId())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogCutArc.clear(); diff --git a/src/tools/drawTools/vtoolcutspline.cpp b/src/tools/drawTools/vtoolcutspline.cpp index c702e9c35..493ec715b 100644 --- a/src/tools/drawTools/vtoolcutspline.cpp +++ b/src/tools/drawTools/vtoolcutspline.cpp @@ -176,6 +176,7 @@ void VToolCutSpline::FullUpdateFromGui(int result) SetAttribute(domElement, AttrLength, dialogCutSpline->getFormula()); SetAttribute(domElement, AttrSpline, QString().setNum(dialogCutSpline->getSplineId())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogCutSpline.clear(); diff --git a/src/tools/drawTools/vtoolcutsplinepath.cpp b/src/tools/drawTools/vtoolcutsplinepath.cpp index fa6e20b2b..907fcd0cf 100644 --- a/src/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/tools/drawTools/vtoolcutsplinepath.cpp @@ -253,6 +253,7 @@ void VToolCutSplinePath::FullUpdateFromGui(int result) SetAttribute(domElement, AttrLength, dialogCutSplinePath->getFormula()); SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogCutSplinePath->getSplinePathId())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogCutSplinePath.clear(); diff --git a/src/tools/drawTools/vtoolendline.cpp b/src/tools/drawTools/vtoolendline.cpp index a41e3796e..68e915e63 100644 --- a/src/tools/drawTools/vtoolendline.cpp +++ b/src/tools/drawTools/vtoolendline.cpp @@ -146,6 +146,7 @@ void VToolEndLine::FullUpdateFromGui(int result) SetAttribute(domElement, AttrAngle, QString().setNum(dialogEndLine->getAngle())); SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogEndLine->getBasePointId())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogEndLine.clear(); diff --git a/src/tools/drawTools/vtoolheight.cpp b/src/tools/drawTools/vtoolheight.cpp index 3548a93b3..db6b8e04d 100644 --- a/src/tools/drawTools/vtoolheight.cpp +++ b/src/tools/drawTools/vtoolheight.cpp @@ -147,6 +147,7 @@ void VToolHeight::FullUpdateFromGui(int result) SetAttribute(domElement, AttrP1Line, QString().setNum(dialogHeight->getP1LineId())); SetAttribute(domElement, AttrP2Line, QString().setNum(dialogHeight->getP2LineId())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogHeight.clear(); diff --git a/src/tools/drawTools/vtoolline.cpp b/src/tools/drawTools/vtoolline.cpp index f97520df5..4b253faaa 100644 --- a/src/tools/drawTools/vtoolline.cpp +++ b/src/tools/drawTools/vtoolline.cpp @@ -121,6 +121,7 @@ void VToolLine::FullUpdateFromGui(int result) SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogLine->getFirstPoint())); SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogLine->getSecondPoint())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogLine.clear(); diff --git a/src/tools/drawTools/vtoollineintersect.cpp b/src/tools/drawTools/vtoollineintersect.cpp index 04ace6d25..8dc10ef30 100644 --- a/src/tools/drawTools/vtoollineintersect.cpp +++ b/src/tools/drawTools/vtoollineintersect.cpp @@ -152,6 +152,7 @@ void VToolLineIntersect::FullUpdateFromGui(int result) SetAttribute(domElement, AttrP1Line2, QString().setNum(dialogLineIntersect->getP1Line2())); SetAttribute(domElement, AttrP2Line2, QString().setNum(dialogLineIntersect->getP2Line2())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogLineIntersect.clear(); diff --git a/src/tools/drawTools/vtoolnormal.cpp b/src/tools/drawTools/vtoolnormal.cpp index 5b58ab0fa..774a4c3fe 100644 --- a/src/tools/drawTools/vtoolnormal.cpp +++ b/src/tools/drawTools/vtoolnormal.cpp @@ -156,6 +156,7 @@ void VToolNormal::FullUpdateFromGui(int result) SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogNormal->getFirstPointId())); SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogNormal->getSecondPointId())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogNormal.clear(); diff --git a/src/tools/drawTools/vtoolpointofcontact.cpp b/src/tools/drawTools/vtoolpointofcontact.cpp index 3ff52733a..1af818bd6 100644 --- a/src/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/tools/drawTools/vtoolpointofcontact.cpp @@ -175,6 +175,7 @@ void VToolPointOfContact::FullUpdateFromGui(int result) SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogPointOfContact->getFirstPoint())); SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogPointOfContact->getSecondPoint())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogPointOfContact.clear(); diff --git a/src/tools/drawTools/vtoolpointofintersection.cpp b/src/tools/drawTools/vtoolpointofintersection.cpp index 60330edb3..d0b79999a 100644 --- a/src/tools/drawTools/vtoolpointofintersection.cpp +++ b/src/tools/drawTools/vtoolpointofintersection.cpp @@ -123,6 +123,7 @@ void VToolPointOfIntersection::FullUpdateFromGui(int result) SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogPointOfIntersection->getFirstPointId())); SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogPointOfIntersection->getSecondPointId())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogPointOfIntersection.clear(); diff --git a/src/tools/drawTools/vtoolshoulderpoint.cpp b/src/tools/drawTools/vtoolshoulderpoint.cpp index 6bc21c411..f860c8c6d 100644 --- a/src/tools/drawTools/vtoolshoulderpoint.cpp +++ b/src/tools/drawTools/vtoolshoulderpoint.cpp @@ -179,6 +179,7 @@ void VToolShoulderPoint::FullUpdateFromGui(int result) SetAttribute(domElement, AttrP2Line, QString().setNum(dialogShoulderPoint->getP2Line())); SetAttribute(domElement, AttrPShoulder, QString().setNum(dialogShoulderPoint->getPShoulder())); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogShoulderPoint.clear(); diff --git a/src/tools/drawTools/vtoolsinglepoint.cpp b/src/tools/drawTools/vtoolsinglepoint.cpp index c98ec47f9..067efaa23 100644 --- a/src/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/tools/drawTools/vtoolsinglepoint.cpp @@ -162,6 +162,7 @@ void VToolSinglePoint::FullUpdateFromGui(int result) SetAttribute(domElement, AttrY, QString().setNum(toMM(p.y()))); //I don't now why but signal does not work. doc->FullUpdateTree(); + emit toolhaveChange(); } } dialogSinglePoint.clear(); diff --git a/src/tools/drawTools/vtoolspline.cpp b/src/tools/drawTools/vtoolspline.cpp index 4a1330305..7fa2c5b38 100644 --- a/src/tools/drawTools/vtoolspline.cpp +++ b/src/tools/drawTools/vtoolspline.cpp @@ -176,6 +176,7 @@ void VToolSpline::FullUpdateFromGui(int result) SetAttribute(domElement, AttrKAsm2, spl.GetKasm2()); SetAttribute(domElement, AttrKCurve, spl.GetKcurve()); emit FullUpdateTree(); + emit toolhaveChange(); } } dialogSpline.clear(); diff --git a/src/tools/drawTools/vtoolsplinepath.cpp b/src/tools/drawTools/vtoolsplinepath.cpp index 89cb8d2e7..d13d28f6b 100644 --- a/src/tools/drawTools/vtoolsplinepath.cpp +++ b/src/tools/drawTools/vtoolsplinepath.cpp @@ -160,6 +160,7 @@ void VToolSplinePath::FullUpdateFromGui(int result) SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.getKCurve())); UpdatePathPoint(domElement, splPath); emit FullUpdateTree(); + emit toolhaveChange(); } } diff --git a/src/tools/drawTools/vtooltriangle.cpp b/src/tools/drawTools/vtooltriangle.cpp index 183b19df4..d8c4c6b6d 100644 --- a/src/tools/drawTools/vtooltriangle.cpp +++ b/src/tools/drawTools/vtooltriangle.cpp @@ -178,6 +178,7 @@ void VToolTriangle::FullUpdateFromGui(int result) SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTriangle->getFirstPointId())); SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTriangle->getSecondPointId())); emit FullUpdateTree(); + emit toolhaveChange(); } } diff --git a/src/tools/vabstracttool.cpp b/src/tools/vabstracttool.cpp index a6565200f..8196111ee 100644 --- a/src/tools/vabstracttool.cpp +++ b/src/tools/vabstracttool.cpp @@ -76,6 +76,7 @@ VAbstractTool::VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id, QOb connect(this, &VAbstractTool::toolhaveChange, this->doc, &VDomDocument::haveLiteChange); connect(this->doc, &VDomDocument::FullUpdateFromFile, this, &VAbstractTool::FullUpdateFromFile); connect(this, &VAbstractTool::FullUpdateTree, this->doc, &VDomDocument::FullUpdateTree); + emit toolhaveChange(); } void VAbstractTool::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view) diff --git a/src/tools/vtooldetail.cpp b/src/tools/vtooldetail.cpp index 9705801c8..6a389b0f9 100644 --- a/src/tools/vtooldetail.cpp +++ b/src/tools/vtooldetail.cpp @@ -198,6 +198,7 @@ void VToolDetail::FullUpdateFromGui(int result) } } emit FullUpdateTree(); + emit toolhaveChange(); } } dialogDetail.clear(); diff --git a/src/xml/vdomdocument.cpp b/src/xml/vdomdocument.cpp index 8147ce4f0..5705846de 100644 --- a/src/xml/vdomdocument.cpp +++ b/src/xml/vdomdocument.cpp @@ -1342,7 +1342,6 @@ void VDomDocument::FullUpdateTree() delete scene; setCurrentData(); emit FullUpdateFromFile(); - emit haveChange(); } void VDomDocument::haveLiteChange()