From 978a8ba0c3e16c2a943522aac134b4fa710bd7f9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 29 Sep 2018 21:46:39 +0300 Subject: [PATCH] Added missed passmark option in Piece Path dialog. Dialog should provide the same amount of options because a piece path can be used as a custom seam allowance included as main path. --HG-- branch : release --- .../dialogs/tools/piece/dialogpiecepath.cpp | 30 +++++++++++++++++++ .../dialogs/tools/piece/dialogpiecepath.h | 1 + .../dialogs/tools/piece/dialogpiecepath.ui | 17 +++++++++-- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp index 91f0c5a95..933bc129b 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp @@ -496,6 +496,9 @@ void DialogPiecePath::PassmarkChanged(int index) ui->radioButtonIntersection2OnlyLeft->setDisabled(true); ui->radioButtonIntersection2OnlyRight->setDisabled(true); + ui->checkBoxShowSecondPassmark->setDisabled(true); + ui->checkBoxShowSecondPassmark->blockSignals(true); + ui->groupBoxMarkType->blockSignals(true); ui->groupBoxAngleType->blockSignals(true); @@ -574,8 +577,15 @@ void DialogPiecePath::PassmarkChanged(int index) default: break; } + + // Show the second option + ui->checkBoxShowSecondPassmark->setEnabled(true); + ui->checkBoxShowSecondPassmark->setChecked(node.IsShowSecondPassmark()); } } + + ui->checkBoxShowSecondPassmark->blockSignals(false); + ui->groupBoxMarkType->blockSignals(false); ui->groupBoxAngleType->blockSignals(false); } @@ -696,6 +706,24 @@ void DialogPiecePath::PassmarkAngleTypeChanged(int id) } } +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::PassmarkShowSecondChanged(int state) +{ + const int i = ui->comboBoxPassmarks->currentIndex(); + if (i != -1) + { + QListWidgetItem *rowItem = GetItemById(ui->comboBoxPassmarks->currentData().toUInt()); + if (rowItem) + { + VPieceNode rowNode = qvariant_cast(rowItem->data(Qt::UserRole)); + rowNode.SetShowSecondPassmark(state); + rowItem->setData(Qt::UserRole, QVariant::fromValue(rowNode)); + + ListChanged(); + } + } +} + //--------------------------------------------------------------------------------------------------------------------- void DialogPiecePath::EvalWidth() { @@ -992,6 +1020,8 @@ void DialogPiecePath::InitPassmarksTab() this, &DialogPiecePath::PassmarkLineTypeChanged); connect(ui->buttonGroupAngleType, QOverload::of(&QButtonGroup::buttonClicked), this, &DialogPiecePath::PassmarkAngleTypeChanged); + connect(ui->checkBoxShowSecondPassmark, &QCheckBox::stateChanged, this, + &DialogPiecePath::PassmarkShowSecondChanged); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.h b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.h index d4c04f1d3..3f3510aea 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.h +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.h @@ -76,6 +76,7 @@ private slots: void ReturnDefAfter(); void PassmarkLineTypeChanged(int id); void PassmarkAngleTypeChanged(int id); + void PassmarkShowSecondChanged(int state); void EvalWidth(); void EvalWidthBefore(); diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.ui b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.ui index a116deb01..f6df54b5d 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.ui +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.ui @@ -7,7 +7,7 @@ 0 0 436 - 598 + 627 @@ -1134,6 +1134,19 @@ + + + + false + + + This option has effect only if the second passmark on seam line enabled in global preferences. The option helps disable the second passmark for this passmark only. + + + Show the second passmark on seam line + + + @@ -1417,7 +1430,7 @@ - +