From d35684a44a807674e697a2f5ebb8f3cc570dbe5a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 24 Jul 2018 15:29:53 +0300 Subject: [PATCH] Fix regression. Valentina doesn't show a notch mark in a custom seam allowance list. --HG-- branch : develop --- .../dialogs/tools/piece/dialogpiecepath.cpp | 18 ++++++++++++++++-- .../dialogs/tools/piece/dialogpiecepath.h | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp index 063ac5702..2b86fdc2a 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp @@ -92,6 +92,7 @@ void DialogPiecePath::EnbleShowMode(bool disable) m_showMode = disable; ui->comboBoxType->setDisabled(m_showMode); ui->comboBoxPiece->setDisabled(m_showMode); + RefreshPathList(GetPiecePath()); ValidObjects(PathIsValid()); } @@ -1078,13 +1079,14 @@ VPiecePath DialogPiecePath::GetPiecePath() const //--------------------------------------------------------------------------------------------------------------------- void DialogPiecePath::SetPiecePath(const VPiecePath &path) { + SetType(path.GetType()); // Set first to know path type + ui->listWidget->clear(); for (int i = 0; i < path.CountNodes(); ++i) { NewItem(path.at(i)); } - SetType(path.GetType()); ui->lineEditName->setText(path.GetName()); VisToolPiecePath *visPath = qobject_cast(vis); @@ -1389,7 +1391,7 @@ void DialogPiecePath::ValidObjects(bool value) //--------------------------------------------------------------------------------------------------------------------- void DialogPiecePath::NewItem(const VPieceNode &node) { - NewNodeItem(ui->listWidget, node, GetType() == PiecePathType::CustomSeamAllowance); + NewNodeItem(ui->listWidget, node, IsShowNotch()); } //--------------------------------------------------------------------------------------------------------------------- @@ -1425,3 +1427,15 @@ void DialogPiecePath::SetFormulaVisible(const QString &formula) ui->plainTextEditFormulaVisible->setPlainText(f); MoveCursorToEnd(ui->plainTextEditFormulaVisible); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::RefreshPathList(const VPiecePath &path) +{ + ui->listWidget->blockSignals(true); + ui->listWidget->clear(); + for (int i = 0; i < path.CountNodes(); ++i) + { + NewItem(path.at(i)); + } + ui->listWidget->blockSignals(false); +} diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.h b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.h index 97e6056b8..d4c04f1d3 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.h +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.h @@ -160,6 +160,8 @@ private: void SetFormulaVisible(const QString &formula); bool IsShowNotch() const; + + void RefreshPathList(const VPiecePath &path); }; inline bool DialogPiecePath::IsShowNotch() const