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

View File

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

View File

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

View File

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