diff --git a/src/app/valentina/dialogs/vwidgetdetails.cpp b/src/app/valentina/dialogs/vwidgetdetails.cpp index 1942ca3fc..7fe50975a 100644 --- a/src/app/valentina/dialogs/vwidgetdetails.cpp +++ b/src/app/valentina/dialogs/vwidgetdetails.cpp @@ -31,7 +31,7 @@ #include "../ifc/xml/vabstractpattern.h" #include "../vpatterndb/vcontainer.h" #include "../vmisc/vabstractapplication.h" -#include "../vtools/undocommands/toggledetailinlayout.h" +#include "../vtools/undocommands/togglepieceinlayout.h" #include #include @@ -45,7 +45,7 @@ VWidgetDetails::VWidgetDetails(VContainer *data, VAbstractPattern *doc, QWidget { ui->setupUi(this); - FillTable(m_data->DataDetails()); + FillTable(m_data->DataPieces()); ui->tableWidget->setContextMenuPolicy(Qt::CustomContextMenu); @@ -62,7 +62,7 @@ VWidgetDetails::~VWidgetDetails() //--------------------------------------------------------------------------------------------------------------------- void VWidgetDetails::UpdateList() { - FillTable(m_data->DataDetails()); + FillTable(m_data->DataPieces()); } //--------------------------------------------------------------------------------------------------------------------- @@ -93,16 +93,16 @@ void VWidgetDetails::InLayoutStateChanged(int row, int column) return; } - const QHash *allDetails = m_data->DataDetails(); + const QHash *allDetails = m_data->DataPieces(); const bool inLayout = not allDetails->value(id).IsInLayout(); - ToggleDetailInLayout *togglePrint = new ToggleDetailInLayout(id, inLayout, m_data, m_doc); - connect(togglePrint, &ToggleDetailInLayout::UpdateList, this, &VWidgetDetails::UpdateList); + TogglePieceInLayout *togglePrint = new TogglePieceInLayout(id, inLayout, m_data, m_doc); + connect(togglePrint, &TogglePieceInLayout::UpdateList, this, &VWidgetDetails::UpdateList); qApp->getUndoStack()->push(togglePrint); } //--------------------------------------------------------------------------------------------------------------------- -void VWidgetDetails::FillTable(const QHash *details) +void VWidgetDetails::FillTable(const QHash *details) { const int selectedRow = ui->tableWidget->currentRow(); ui->tableWidget->clear(); @@ -114,7 +114,7 @@ void VWidgetDetails::FillTable(const QHash *details) while (i != details->constEnd()) { ++currentRow; - const VDetail det = i.value(); + const VPiece det = i.value(); QTableWidgetItem *item = new QTableWidgetItem(); item->setTextAlignment(Qt::AlignHCenter); @@ -134,7 +134,7 @@ void VWidgetDetails::FillTable(const QHash *details) ui->tableWidget->setItem(currentRow, 0, item); - QString name = det.getName(); + QString name = det.GetName(); if (name.isEmpty()) { name = tr("Unnamed"); @@ -158,7 +158,7 @@ void VWidgetDetails::FillTable(const QHash *details) //--------------------------------------------------------------------------------------------------------------------- void VWidgetDetails::ToggleSectionDetails(bool select) { - const QHash *allDetails = m_data->DataDetails(); + const QHash *allDetails = m_data->DataPieces(); if (allDetails->count() == 0) { return; @@ -172,8 +172,8 @@ void VWidgetDetails::ToggleSectionDetails(bool select) { if (not select == allDetails->value(id).IsInLayout()) { - ToggleDetailInLayout *togglePrint = new ToggleDetailInLayout(id, select, m_data, m_doc); - connect(togglePrint, &ToggleDetailInLayout::UpdateList, this, &VWidgetDetails::UpdateList); + TogglePieceInLayout *togglePrint = new TogglePieceInLayout(id, select, m_data, m_doc); + connect(togglePrint, &TogglePieceInLayout::UpdateList, this, &VWidgetDetails::UpdateList); qApp->getUndoStack()->push(togglePrint); } } @@ -193,7 +193,7 @@ void VWidgetDetails::ShowContextMenu(const QPoint &pos) QAction *actionInvertSelection = menu->addAction(tr("Invert selection")); - const QHash *allDetails = m_data->DataDetails(); + const QHash *allDetails = m_data->DataPieces(); if (allDetails->count() == 0) { return; @@ -201,7 +201,7 @@ void VWidgetDetails::ShowContextMenu(const QPoint &pos) int selectedDetails = 0; - QHash::const_iterator iter = allDetails->constBegin(); + auto iter = allDetails->constBegin(); while (iter != allDetails->constEnd()) { if(iter.value().IsInLayout()) @@ -220,7 +220,6 @@ void VWidgetDetails::ShowContextMenu(const QPoint &pos) actionSelectAll->setDisabled(true); } - QAction *selectedAction = menu->exec(ui->tableWidget->viewport()->mapToGlobal(pos)); bool select; @@ -250,8 +249,8 @@ void VWidgetDetails::ShowContextMenu(const QPoint &pos) { select = not allDetails->value(id).IsInLayout(); - ToggleDetailInLayout *togglePrint = new ToggleDetailInLayout(id, select, m_data, m_doc); - connect(togglePrint, &ToggleDetailInLayout::UpdateList, this, &VWidgetDetails::UpdateList); + TogglePieceInLayout *togglePrint = new TogglePieceInLayout(id, select, m_data, m_doc); + connect(togglePrint, &TogglePieceInLayout::UpdateList, this, &VWidgetDetails::UpdateList); qApp->getUndoStack()->push(togglePrint); } } diff --git a/src/app/valentina/dialogs/vwidgetdetails.h b/src/app/valentina/dialogs/vwidgetdetails.h index 987bb74d1..f33ce9efc 100644 --- a/src/app/valentina/dialogs/vwidgetdetails.h +++ b/src/app/valentina/dialogs/vwidgetdetails.h @@ -33,7 +33,7 @@ class VAbstractPattern; class VContainer; -class VDetail; +class VPiece; namespace Ui { @@ -65,7 +65,7 @@ private: VAbstractPattern *m_doc; VContainer *m_data; - void FillTable(const QHash *details); + void FillTable(const QHash *details); void ToggleSectionDetails(bool select); }; diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index c77fc37eb..fd36726f0 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -615,7 +615,7 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document { VPiece detail; const quint32 id = GetParametrId(domElement); -// detail.setName(GetParametrString(domElement, AttrName, "")); + detail.SetName(GetParametrString(domElement, AttrName, "")); detail.SetMx(qApp->toPixel(GetParametrDouble(domElement, AttrMx, "0.0"))); detail.SetMy(qApp->toPixel(GetParametrDouble(domElement, AttrMy, "0.0"))); // detail.setSeamAllowance(GetParametrUInt(domElement, VToolDetail::AttrSupplement, "1")); @@ -623,7 +623,7 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document // detail.setClosed(GetParametrUInt(domElement, VToolDetail::AttrClosed, "1")); // detail.setForbidFlipping(GetParametrUInt(domElement, VToolDetail::AttrForbidFlipping, // QString().setNum(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping()))); -// detail.SetInLayout(GetParametrBool(domElement, AttrInLayout, trueStr)); + detail.SetInLayout(GetParametrBool(domElement, AttrInLayout, trueStr)); const QStringList tags = QStringList() << VToolSeamAllowance::TagNodes << TagData diff --git a/src/libs/ifc/schema/pattern/v0.4.0.xsd b/src/libs/ifc/schema/pattern/v0.4.0.xsd index eb822a1c5..4cce2e334 100644 --- a/src/libs/ifc/schema/pattern/v0.4.0.xsd +++ b/src/libs/ifc/schema/pattern/v0.4.0.xsd @@ -412,6 +412,8 @@ + + diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 1f004335e..86276b417 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -1694,12 +1694,10 @@ void VPatternConverter::TagDetailToV0_4_0() if (not dom.isNull()) { - dom.removeAttribute(strName); dom.removeAttribute(strSupplement); dom.removeAttribute(strClosed); dom.removeAttribute(strWidth); dom.removeAttribute(strForbidFlipping); - dom.removeAttribute(strInLayout); dom.setAttribute(strVersion, "1"); diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index 0309df112..5b7cecdf2 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -27,6 +27,7 @@ *************************************************************************/ #include "vabstractpiece.h" +#include "vabstractpiece_p.h" #include #include @@ -37,13 +38,13 @@ //--------------------------------------------------------------------------------------------------------------------- VAbstractPiece::VAbstractPiece() + : d(new VAbstractPieceData) {} //--------------------------------------------------------------------------------------------------------------------- VAbstractPiece::VAbstractPiece(const VAbstractPiece &piece) -{ - Q_UNUSED(piece) -} + :d (piece.d) +{} //--------------------------------------------------------------------------------------------------------------------- VAbstractPiece &VAbstractPiece::operator=(const VAbstractPiece &piece) @@ -52,6 +53,7 @@ VAbstractPiece &VAbstractPiece::operator=(const VAbstractPiece &piece) { return *this; } + d = piece.d; return *this; } @@ -59,6 +61,18 @@ VAbstractPiece &VAbstractPiece::operator=(const VAbstractPiece &piece) VAbstractPiece::~VAbstractPiece() {} +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractPiece::GetName() const +{ + return d->m_name; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPiece::SetName(const QString &value) +{ + d->m_name = value; +} + //--------------------------------------------------------------------------------------------------------------------- qreal VAbstractPiece::SumTrapezoids(const QVector &points) { diff --git a/src/libs/vlayout/vabstractpiece.h b/src/libs/vlayout/vabstractpiece.h index 78caab9bd..491712f58 100644 --- a/src/libs/vlayout/vabstractpiece.h +++ b/src/libs/vlayout/vabstractpiece.h @@ -30,9 +30,11 @@ #define VABSTRACTPIECE_H #include +#include template class QVector; class QPointF; +class VAbstractPieceData; class VAbstractPiece { @@ -42,12 +44,18 @@ public: VAbstractPiece &operator=(const VAbstractPiece &piece); virtual ~VAbstractPiece(); + QString GetName() const; + void SetName(const QString &value); + static qreal SumTrapezoids(const QVector &points); static QVector CheckLoops(const QVector &points); static QVector CorrectEquidistantPoints(const QVector &points, bool removeFirstAndLast = true); protected: static QVector RemoveDublicates(const QVector &points, bool removeFirstAndLast = true); + +private: + QSharedDataPointer d; }; #endif // VABSTRACTPIECE_H diff --git a/src/libs/vlayout/vabstractpiece_p.h b/src/libs/vlayout/vabstractpiece_p.h new file mode 100644 index 000000000..470d25ecb --- /dev/null +++ b/src/libs/vlayout/vabstractpiece_p.h @@ -0,0 +1,66 @@ +/************************************************************************ + ** + ** @file + ** @author Roman Telezhynskyi + ** @date 9 11, 2016 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2016 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VABSTRACTPIECE_P_H +#define VABSTRACTPIECE_P_H + +#include +#include + +#include "../vmisc/diagnostic.h" + +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Weffc++") + +class VAbstractPieceData : public QSharedData +{ +public: + VAbstractPieceData() + : m_name() + {} + + VAbstractPieceData(const VAbstractPieceData &piece) + : QSharedData(piece), + m_name(piece.m_name) + {} + + ~VAbstractPieceData(); + + QString m_name; + +private: + VAbstractPieceData &operator=(const VAbstractPieceData &) Q_DECL_EQ_DELETE; +}; + +VAbstractPieceData::~VAbstractPieceData() +{} + +QT_WARNING_POP + +#endif // VABSTRACTPIECE_P_H + diff --git a/src/libs/vlayout/vlayout.pri b/src/libs/vlayout/vlayout.pri index 434680020..29ef87f7c 100644 --- a/src/libs/vlayout/vlayout.pri +++ b/src/libs/vlayout/vlayout.pri @@ -19,7 +19,8 @@ HEADERS += \ $$PWD/vtextmanager.h \ $$PWD/vposter.h \ $$PWD/vgraphicsfillitem.h \ - $$PWD/vabstractpiece.h + $$PWD/vabstractpiece.h \ + $$PWD/vabstractpiece_p.h SOURCES += \ $$PWD/vlayoutgenerator.cpp \ diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 874681bc7..5f25e37cb 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -244,6 +244,18 @@ void VPiece::SetMy(qreal value) d->m_my = value; } +//--------------------------------------------------------------------------------------------------------------------- +bool VPiece::IsInLayout() const +{ + return d->m_inLayout; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VPiece::SetInLayout(bool inLayout) +{ + d->m_inLayout = inLayout; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief Missing find missing nodes in detail. When we deleted object in detail and return this detail need diff --git a/src/libs/vpatterndb/vpiece.h b/src/libs/vpatterndb/vpiece.h index 09261d836..31e82d401 100644 --- a/src/libs/vpatterndb/vpiece.h +++ b/src/libs/vpatterndb/vpiece.h @@ -71,6 +71,9 @@ public: qreal GetMy() const; void SetMy(qreal value); + bool IsInLayout() const; + void SetInLayout(bool inLayout); + QVector Missing(const VPiece &det) const; int indexOfNode(const quint32 &id) const; diff --git a/src/libs/vpatterndb/vpiece_p.h b/src/libs/vpatterndb/vpiece_p.h index 79001e36a..6ddf9fd80 100644 --- a/src/libs/vpatterndb/vpiece_p.h +++ b/src/libs/vpatterndb/vpiece_p.h @@ -44,14 +44,16 @@ public: VPieceData() : m_nodes(), m_mx(0), - m_my(0) + m_my(0), + m_inLayout(true) {} VPieceData(const VPieceData &detail) : QSharedData(detail), m_nodes(detail.m_nodes), m_mx(detail.m_mx), - m_my(detail.m_my) + m_my(detail.m_my), + m_inLayout(detail.m_inLayout) {} ~VPieceData(); @@ -62,6 +64,8 @@ public: qreal m_mx; qreal m_my; + bool m_inLayout; + private: VPieceData &operator=(const VPieceData &) Q_DECL_EQ_DELETE; }; diff --git a/src/libs/vtools/tools/vtooldetail.cpp b/src/libs/vtools/tools/vtooldetail.cpp index a2b4a9d05..42b8f9afa 100644 --- a/src/libs/vtools/tools/vtooldetail.cpp +++ b/src/libs/vtools/tools/vtooldetail.cpp @@ -76,7 +76,7 @@ #include "../undocommands/deletedetail.h" #include "../undocommands/movepiece.h" #include "../undocommands/savedetailoptions.h" -#include "../undocommands/toggledetailinlayout.h" +#include "../undocommands/togglepieceinlayout.h" #include "../vgeometry/varc.h" #include "../vgeometry/vcubicbezier.h" #include "../vgeometry/vcubicbezierpath.h" @@ -805,9 +805,9 @@ void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } else if (selectedAction == inLayoutOption) { - ToggleDetailInLayout *togglePrint = new ToggleDetailInLayout(id, selectedAction->isChecked(), + TogglePieceInLayout *togglePrint = new TogglePieceInLayout(id, selectedAction->isChecked(), &(VAbstractTool::data), doc); - connect(togglePrint, &ToggleDetailInLayout::UpdateList, doc, &VAbstractPattern::CheckInLayoutList); + connect(togglePrint, &TogglePieceInLayout::UpdateList, doc, &VAbstractPattern::CheckInLayoutList); qApp->getUndoStack()->push(togglePrint); } else if (selectedAction == actionRemove) diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index a8e2347e3..5dc59d2d6 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -44,7 +44,7 @@ #include "../undocommands/deletepiece.h" #include "../undocommands/movepiece.h" #include "../undocommands/savepieceoptions.h" -//#include "../undocommands/togglepieceinlayout.h" +#include "../undocommands/togglepieceinlayout.h" #include "../vwidgets/vmaingraphicsview.h" #include @@ -247,9 +247,11 @@ void VToolSeamAllowance::AddAttributes(VAbstractPattern *doc, QDomElement &domEl SCASSERT(doc != nullptr); doc->SetAttribute(domElement, VDomDocument::AttrId, id); + doc->SetAttribute(domElement, AttrName, piece.GetName()); doc->SetAttribute(domElement, AttrVersion, QString().setNum(pieceVersion)); doc->SetAttribute(domElement, AttrMx, qApp->fromPixel(piece.GetMx())); doc->SetAttribute(domElement, AttrMy, qApp->fromPixel(piece.GetMy())); + doc->SetAttribute(domElement, AttrInLayout, piece.IsInLayout()); } //--------------------------------------------------------------------------------------------------------------------- @@ -518,10 +520,10 @@ void VToolSeamAllowance::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) QMenu menu; QAction *actionOption = menu.addAction(QIcon::fromTheme("preferences-other"), tr("Options")); -// QAction *inLayoutOption = menu.addAction(tr("In layout")); -// inLayoutOption->setCheckable(true); -// const VDetail detail = VAbstractTool::data.GetDetail(id); -// inLayoutOption->setChecked(detail.IsInLayout()); + QAction *inLayoutOption = menu.addAction(tr("In layout")); + inLayoutOption->setCheckable(true); + const VPiece detail = VAbstractTool::data.GetPiece(id); + inLayoutOption->setChecked(detail.IsInLayout()); QAction *actionRemove = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete")); _referens > 1 ? actionRemove->setEnabled(false) : actionRemove->setEnabled(true); @@ -537,13 +539,13 @@ void VToolSeamAllowance::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) SetDialog(); m_dialog->show(); } -// else if (selectedAction == inLayoutOption) -// { -// ToggleDetailInLayout *togglePrint = new ToggleDetailInLayout(id, selectedAction->isChecked(), -// &(VAbstractTool::data), doc); -// connect(togglePrint, &ToggleDetailInLayout::UpdateList, doc, &VAbstractPattern::CheckInLayoutList); -// qApp->getUndoStack()->push(togglePrint); -// } + else if (selectedAction == inLayoutOption) + { + TogglePieceInLayout *togglePrint = new TogglePieceInLayout(id, selectedAction->isChecked(), + &(VAbstractTool::data), doc); + connect(togglePrint, &TogglePieceInLayout::UpdateList, doc, &VAbstractPattern::CheckInLayoutList); + qApp->getUndoStack()->push(togglePrint); + } else if (selectedAction == actionRemove) { try diff --git a/src/libs/vtools/undocommands/toggledetailinlayout.cpp b/src/libs/vtools/undocommands/togglepieceinlayout.cpp similarity index 83% rename from src/libs/vtools/undocommands/toggledetailinlayout.cpp rename to src/libs/vtools/undocommands/togglepieceinlayout.cpp index 88aa7daf2..7a3b65016 100644 --- a/src/libs/vtools/undocommands/toggledetailinlayout.cpp +++ b/src/libs/vtools/undocommands/togglepieceinlayout.cpp @@ -26,7 +26,7 @@ ** *************************************************************************/ -#include "toggledetailinlayout.h" +#include "togglepieceinlayout.h" #include #include @@ -38,30 +38,30 @@ #include "../vmisc/def.h" #include "../vmisc/logging.h" #include "../vpatterndb/vcontainer.h" -#include "../vpatterndb/vdetail.h" +#include "../vpatterndb/vpiece.h" #include "vundocommand.h" class QUndoCommand; //--------------------------------------------------------------------------------------------------------------------- -ToggleDetailInLayout::ToggleDetailInLayout(quint32 id, bool state, VContainer *data, VAbstractPattern *doc, +TogglePieceInLayout::TogglePieceInLayout(quint32 id, bool state, VContainer *data, VAbstractPattern *doc, QUndoCommand *parent) : VUndoCommand(QDomElement(), doc, parent), m_id(id), m_data(data), - m_oldState(m_data->DataDetails()->value(m_id).IsInLayout()), + m_oldState(m_data->DataPieces()->value(m_id).IsInLayout()), m_newState(state) { setText(tr("detail in layout list")); } //--------------------------------------------------------------------------------------------------------------------- -ToggleDetailInLayout::~ToggleDetailInLayout() +TogglePieceInLayout::~TogglePieceInLayout() { } //--------------------------------------------------------------------------------------------------------------------- -void ToggleDetailInLayout::undo() +void TogglePieceInLayout::undo() { qCDebug(vUndo, "ToggleDetailInLayout::undo()."); @@ -72,7 +72,7 @@ void ToggleDetailInLayout::undo() } //--------------------------------------------------------------------------------------------------------------------- -void ToggleDetailInLayout::redo() +void TogglePieceInLayout::redo() { qCDebug(vUndo, "ToggleDetailInLayout::redo()."); @@ -83,25 +83,25 @@ void ToggleDetailInLayout::redo() } //--------------------------------------------------------------------------------------------------------------------- -int ToggleDetailInLayout::id() const +int TogglePieceInLayout::id() const { - return static_cast(UndoCommand::ToggleDetailInLayout); + return static_cast(UndoCommand::TogglePieceInLayout); } //--------------------------------------------------------------------------------------------------------------------- -quint32 ToggleDetailInLayout::getDetId() const +quint32 TogglePieceInLayout::getDetId() const { return m_id; } //--------------------------------------------------------------------------------------------------------------------- -bool ToggleDetailInLayout::getNewState() const +bool TogglePieceInLayout::getNewState() const { return m_newState; } //--------------------------------------------------------------------------------------------------------------------- -void ToggleDetailInLayout::Do(bool state) +void TogglePieceInLayout::Do(bool state) { QDomElement detail = doc->elementById(m_id); if (detail.isElement()) @@ -115,9 +115,9 @@ void ToggleDetailInLayout::Do(bool state) detail.removeAttribute(AttrInLayout); } - VDetail det = m_data->DataDetails()->value(m_id); + VPiece det = m_data->DataPieces()->value(m_id); det.SetInLayout(state); - m_data->UpdateDetail(m_id, det); + m_data->UpdatePiece(m_id, det); emit UpdateList(); } else diff --git a/src/libs/vtools/undocommands/toggledetailinlayout.h b/src/libs/vtools/undocommands/togglepieceinlayout.h similarity index 87% rename from src/libs/vtools/undocommands/toggledetailinlayout.h rename to src/libs/vtools/undocommands/togglepieceinlayout.h index 9ba65da8c..d4879968e 100644 --- a/src/libs/vtools/undocommands/toggledetailinlayout.h +++ b/src/libs/vtools/undocommands/togglepieceinlayout.h @@ -41,13 +41,13 @@ class QUndoCommand; class VAbstractPattern; class VContainer; -class ToggleDetailInLayout : public VUndoCommand +class TogglePieceInLayout : public VUndoCommand { Q_OBJECT public: - ToggleDetailInLayout(quint32 id, bool state, VContainer *data, VAbstractPattern *doc, - QUndoCommand *parent = nullptr); - virtual ~ToggleDetailInLayout(); + TogglePieceInLayout(quint32 id, bool state, VContainer *data, VAbstractPattern *doc, + QUndoCommand *parent = nullptr); + virtual ~TogglePieceInLayout(); virtual void undo() Q_DECL_OVERRIDE; virtual void redo() Q_DECL_OVERRIDE; virtual int id() const Q_DECL_OVERRIDE; @@ -57,7 +57,7 @@ public: signals: void UpdateList(); private: - Q_DISABLE_COPY(ToggleDetailInLayout) + Q_DISABLE_COPY(TogglePieceInLayout) quint32 m_id; VContainer *m_data; bool m_oldState; diff --git a/src/libs/vtools/undocommands/undocommands.pri b/src/libs/vtools/undocommands/undocommands.pri index 2514e4765..c73295eee 100644 --- a/src/libs/vtools/undocommands/undocommands.pri +++ b/src/libs/vtools/undocommands/undocommands.pri @@ -21,12 +21,12 @@ HEADERS += \ $$PWD/addgroup.h \ $$PWD/delgroup.h \ $$PWD/label/moveabstractlabel.h \ - $$PWD/toggledetailinlayout.h \ $$PWD/label/operationmovelabel.h \ $$PWD/addpiece.h \ $$PWD/deletepiece.h \ $$PWD/movepiece.h \ - $$PWD/savepieceoptions.h + $$PWD/savepieceoptions.h \ + $$PWD/togglepieceinlayout.h SOURCES += \ $$PWD/addtocalc.cpp \ @@ -48,9 +48,9 @@ SOURCES += \ $$PWD/addgroup.cpp \ $$PWD/delgroup.cpp \ $$PWD/label/moveabstractlabel.cpp \ - $$PWD/toggledetailinlayout.cpp \ $$PWD/label/operationmovelabel.cpp \ $$PWD/addpiece.cpp \ $$PWD/deletepiece.cpp \ $$PWD/movepiece.cpp \ - $$PWD/savepieceoptions.cpp + $$PWD/savepieceoptions.cpp \ + $$PWD/togglepieceinlayout.cpp diff --git a/src/libs/vtools/undocommands/vundocommand.h b/src/libs/vtools/undocommands/vundocommand.h index 697346f63..d4fceb414 100644 --- a/src/libs/vtools/undocommands/vundocommand.h +++ b/src/libs/vtools/undocommands/vundocommand.h @@ -62,7 +62,7 @@ enum class UndoCommand: char { AddPatternPiece, MoveLabel, MoveDoubleLabel, RotationMoveLabel, - ToggleDetailInLayout + TogglePieceInLayout }; class VNodeDetail;