Forgot to update passmark options for piece path dialog.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2017-04-10 11:31:16 +03:00
parent cb9d2bbe25
commit 2ef3c7bcb0
4 changed files with 61 additions and 17 deletions

View File

@ -378,11 +378,13 @@ void DialogPiecePath::PassmarkChanged(int index)
ui->radioButtonOneLine->setDisabled(true);
ui->radioButtonTwoLines->setDisabled(true);
ui->radioButtonThreeLines->setDisabled(true);
ui->radioButtonTMark->setDisabled(true);
ui->radioButtonVMark->setDisabled(true);
ui->radioButtonStraightforward->setDisabled(true);
ui->radioButtonBisector->setDisabled(true);
ui->groupBoxLineType->blockSignals(true);
ui->groupBoxMarkType->blockSignals(true);
ui->groupBoxAngleType->blockSignals(true);
if (index != -1)
@ -397,6 +399,8 @@ void DialogPiecePath::PassmarkChanged(int index)
ui->radioButtonOneLine->setEnabled(true);
ui->radioButtonTwoLines->setEnabled(true);
ui->radioButtonThreeLines->setEnabled(true);
ui->radioButtonTMark->setEnabled(true);
ui->radioButtonVMark->setEnabled(true);
switch(node.GetPassmarkLineType())
{
@ -409,6 +413,12 @@ void DialogPiecePath::PassmarkChanged(int index)
case PassmarkLineType::ThreeLines:
ui->radioButtonThreeLines->setChecked(true);
break;
case PassmarkLineType::TMark:
ui->radioButtonTMark->setChecked(true);
break;
case PassmarkLineType::VMark:
ui->radioButtonVMark->setChecked(true);
break;
default:
break;
}
@ -430,7 +440,7 @@ void DialogPiecePath::PassmarkChanged(int index)
}
}
}
ui->groupBoxLineType->blockSignals(false);
ui->groupBoxMarkType->blockSignals(false);
ui->groupBoxAngleType->blockSignals(false);
}
@ -458,18 +468,26 @@ void DialogPiecePath::PassmarkLineTypeChanged(int id)
VPieceNode rowNode = qvariant_cast<VPieceNode>(rowItem->data(Qt::UserRole));
PassmarkLineType lineType = PassmarkLineType::OneLine;
if (id == ui->buttonGroupLineType->id(ui->radioButtonOneLine))
if (id == ui->buttonGroupMarkType->id(ui->radioButtonOneLine))
{
lineType = PassmarkLineType::OneLine;
}
else if (id == ui->buttonGroupLineType->id(ui->radioButtonTwoLines))
else if (id == ui->buttonGroupMarkType->id(ui->radioButtonTwoLines))
{
lineType = PassmarkLineType::TwoLines;
}
else if (id == ui->buttonGroupLineType->id(ui->radioButtonThreeLines))
else if (id == ui->buttonGroupMarkType->id(ui->radioButtonThreeLines))
{
lineType = PassmarkLineType::ThreeLines;
}
else if (id == ui->buttonGroupMarkType->id(ui->radioButtonTMark))
{
lineType = PassmarkLineType::TMark;
}
else if (id == ui->buttonGroupMarkType->id(ui->radioButtonVMark))
{
lineType = PassmarkLineType::VMark;
}
rowNode.SetPassmarkLineType(lineType);
rowItem->setData(Qt::UserRole, QVariant::fromValue(rowNode));
@ -729,7 +747,7 @@ void DialogPiecePath::InitPassmarksTab()
connect(ui->comboBoxPassmarks, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &DialogPiecePath::PassmarkChanged);
connect(ui->buttonGroupLineType, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
connect(ui->buttonGroupMarkType, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
this, &DialogPiecePath::PassmarkLineTypeChanged);
connect(ui->buttonGroupAngleType, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
this, &DialogPiecePath::PassmarkAngleTypeChanged);

View File

@ -815,12 +815,12 @@
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBoxLineType">
<widget class="QGroupBox" name="groupBoxMarkType">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Lines</string>
<string>Marks</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
@ -832,7 +832,7 @@
<string>One line</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroupLineType</string>
<string notr="true">buttonGroupMarkType</string>
</attribute>
</widget>
</item>
@ -845,7 +845,7 @@
<string>Two lines</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroupLineType</string>
<string notr="true">buttonGroupMarkType</string>
</attribute>
</widget>
</item>
@ -858,7 +858,33 @@
<string>Three lines</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroupLineType</string>
<string notr="true">buttonGroupMarkType</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonTMark">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>T mark</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroupMarkType</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonVMark">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>V mark</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroupMarkType</string>
</attribute>
</widget>
</item>
@ -967,7 +993,7 @@
</connection>
</connections>
<buttongroups>
<buttongroup name="buttonGroupLineType"/>
<buttongroup name="buttonGroupAngleType"/>
<buttongroup name="buttonGroupMarkType"/>
</buttongroups>
</ui>

View File

@ -854,7 +854,7 @@ void DialogSeamAllowance::PassmarkChanged(int index)
uiTabPassmarks->radioButtonStraightforward->setDisabled(true);
uiTabPassmarks->radioButtonBisector->setDisabled(true);
uiTabPassmarks->groupBoxLineType->blockSignals(true);
uiTabPassmarks->groupBoxMarkType->blockSignals(true);
uiTabPassmarks->groupBoxAngleType->blockSignals(true);
if (index != -1)
@ -910,7 +910,7 @@ void DialogSeamAllowance::PassmarkChanged(int index)
}
}
}
uiTabPassmarks->groupBoxLineType->blockSignals(false);
uiTabPassmarks->groupBoxMarkType->blockSignals(false);
uiTabPassmarks->groupBoxAngleType->blockSignals(false);
}

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>208</width>
<height>285</height>
<height>321</height>
</rect>
</property>
<property name="windowTitle">
@ -32,12 +32,12 @@
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBoxLineType">
<widget class="QGroupBox" name="groupBoxMarkType">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Lines</string>
<string>Marks</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>