Disable seam allowance options if seam allowance is built in.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-04-15 21:15:56 +03:00
parent 0966f536b8
commit 419095300e
2 changed files with 25 additions and 15 deletions

View File

@ -917,19 +917,6 @@ void DialogSeamAllowance::ListChanged()
SetMoveControls(); SetMoveControls();
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::EnableSeamAllowance(bool enable)
{
uiTabPaths->checkBoxBuiltIn->setEnabled(enable);
uiTabPaths->groupBoxAutomatic->setEnabled(enable);
uiTabPaths->groupBoxCustom->setEnabled(enable);
if (enable)
{
InitNodesList();
}
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::NodeChanged(int index) void DialogSeamAllowance::NodeChanged(int index)
{ {
@ -2775,7 +2762,31 @@ void DialogSeamAllowance::InitSeamAllowanceTab()
m_timerWidthAfter->setSingleShot(true); m_timerWidthAfter->setSingleShot(true);
connect(m_timerWidthAfter, &QTimer::timeout, this, &DialogSeamAllowance::EvalWidthAfter); connect(m_timerWidthAfter, &QTimer::timeout, this, &DialogSeamAllowance::EvalWidthAfter);
connect(uiTabPaths->checkBoxSeams, &QCheckBox::toggled, this, &DialogSeamAllowance::EnableSeamAllowance); connect(uiTabPaths->checkBoxSeams, &QCheckBox::toggled, this, [this](bool enable)
{
uiTabPaths->checkBoxBuiltIn->setEnabled(enable);
if (not enable)
{
uiTabPaths->groupBoxAutomatic->setEnabled(enable);
uiTabPaths->groupBoxCustom->setEnabled(enable);
}
else
{
uiTabPaths->checkBoxBuiltIn->toggled(uiTabPaths->checkBoxBuiltIn->isChecked());
}
});
connect(uiTabPaths->checkBoxBuiltIn, &QCheckBox::toggled, this, [this](bool enable)
{
uiTabPaths->groupBoxAutomatic->setEnabled(not enable);
uiTabPaths->groupBoxCustom->setEnabled(not enable);
if (not enable)
{
InitNodesList();
}
});
// init the default seam allowance, convert the value if app unit is different than pattern unit // init the default seam allowance, convert the value if app unit is different than pattern unit
m_saWidth = UnitConvertor(qApp->Settings()->GetDefaultSeamAllowance(), m_saWidth = UnitConvertor(qApp->Settings()->GetDefaultSeamAllowance(),

View File

@ -92,7 +92,6 @@ private slots:
void ShowPlaceLabelsContextMenu(const QPoint &pos); void ShowPlaceLabelsContextMenu(const QPoint &pos);
void ListChanged(); void ListChanged();
void EnableSeamAllowance(bool enable);
void NodeChanged(int index); void NodeChanged(int index);
void PassmarkChanged(int index); void PassmarkChanged(int index);
void CSAStartPointChanged(int index); void CSAStartPointChanged(int index);