Updated detail dialog with pattern piece data editing
--HG-- branch : feature
This commit is contained in:
parent
1899abc39e
commit
8140647242
|
@ -51,7 +51,8 @@ public:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
VDetailData(const VDetailData &detail)
|
VDetailData(const VDetailData &detail)
|
||||||
:QSharedData(detail), _id(NULL_ID), nodes(detail.nodes), mx(detail.mx), my(detail.my)
|
:QSharedData(detail), _id(NULL_ID), nodes(detail.nodes), mx(detail.mx), my(detail.my),
|
||||||
|
m_ppData(detail.m_ppData)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
~VDetailData() {}
|
~VDetailData() {}
|
||||||
|
|
|
@ -38,8 +38,7 @@ HEADERS += \
|
||||||
$$PWD/tools/dialogcubicbezier.h \
|
$$PWD/tools/dialogcubicbezier.h \
|
||||||
$$PWD/tools/dialogcubicbezierpath.h \
|
$$PWD/tools/dialogcubicbezierpath.h \
|
||||||
$$PWD/tools/dialoggroup.h \
|
$$PWD/tools/dialoggroup.h \
|
||||||
$$PWD/tools/dialogrotation.h \
|
$$PWD/tools/dialogrotation.h
|
||||||
$$PWD/tools/dialogpatternpiecedata.h
|
|
||||||
|
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
|
@ -78,8 +77,7 @@ SOURCES += \
|
||||||
$$PWD/tools/dialogcubicbezier.cpp \
|
$$PWD/tools/dialogcubicbezier.cpp \
|
||||||
$$PWD/tools/dialogcubicbezierpath.cpp \
|
$$PWD/tools/dialogcubicbezierpath.cpp \
|
||||||
$$PWD/tools/dialoggroup.cpp \
|
$$PWD/tools/dialoggroup.cpp \
|
||||||
$$PWD/tools/dialogrotation.cpp \
|
$$PWD/tools/dialogrotation.cpp
|
||||||
$$PWD/tools/dialogpatternpiecedata.cpp
|
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
$$PWD/tools/dialogalongline.ui \
|
$$PWD/tools/dialogalongline.ui \
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "../../../vgeometry/vsplinepath.h"
|
#include "../../../vgeometry/vsplinepath.h"
|
||||||
#include "../../../vpatterndb/vcontainer.h"
|
#include "../../../vpatterndb/vcontainer.h"
|
||||||
#include "../../../ifc/xml/vdomdocument.h"
|
#include "../../../ifc/xml/vdomdocument.h"
|
||||||
|
#include "vpatternpiecedata.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -90,6 +91,19 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge
|
||||||
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
|
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
|
||||||
connect(ui.toolButtonUp, &QToolButton::clicked, this, &DialogDetail::ScrollUp);
|
connect(ui.toolButtonUp, &QToolButton::clicked, this, &DialogDetail::ScrollUp);
|
||||||
connect(ui.toolButtonDown, &QToolButton::clicked, this, &DialogDetail::ScrollDown);
|
connect(ui.toolButtonDown, &QToolButton::clicked, this, &DialogDetail::ScrollDown);
|
||||||
|
|
||||||
|
m_qslMaterials << tr("Fabric") << tr("Lining") << tr("Interfacing") << tr("Interlining");
|
||||||
|
ui.comboBoxMaterial->addItems(m_qslMaterials);
|
||||||
|
m_qslPlacements << tr("None") << tr("Cut on fold");
|
||||||
|
ui.comboBoxPlacement->addItems(m_qslPlacements);
|
||||||
|
|
||||||
|
connect(ui.pushButtonAdd, &QPushButton::clicked, this, &DialogDetail::AddUpdate);
|
||||||
|
connect(ui.pushButtonCancel, &QPushButton::clicked, this, &DialogDetail::Cancel);
|
||||||
|
connect(ui.pushButtonRemove, &QPushButton::clicked, this, &DialogDetail::Remove);
|
||||||
|
connect(ui.listWidgetMCP, &QListWidget::itemClicked, this, &DialogDetail::SetEditMode);
|
||||||
|
SetAddMode();
|
||||||
|
|
||||||
|
ui.tabWidget->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -153,6 +167,74 @@ void DialogDetail::CheckState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogDetail::UpdateList()
|
||||||
|
{
|
||||||
|
ui.listWidgetMCP->clear();
|
||||||
|
for (int i = 0; i < detail.GetPatternPieceData().GetMCPCount(); ++i)
|
||||||
|
{
|
||||||
|
MaterialCutPlacement mcp = detail.GetPatternPieceData().GetMCP(i);
|
||||||
|
QString qsText = tr("Cut %1 of %2%3");
|
||||||
|
qsText = qsText.arg(mcp.m_iCutNumber);
|
||||||
|
if (mcp.m_eMaterial < MaterialType::mtUserDefined)
|
||||||
|
qsText = qsText.arg(m_qslMaterials[int(mcp.m_eMaterial)]);
|
||||||
|
else
|
||||||
|
qsText = qsText.arg(mcp.m_qsMaterialUserDef);
|
||||||
|
if (mcp.m_ePlacement == PlacementType::ptCutOnFold)
|
||||||
|
qsText = qsText.arg(tr(" on Fold"));
|
||||||
|
else
|
||||||
|
qsText = qsText.arg("");
|
||||||
|
|
||||||
|
ui.listWidgetMCP->addItem(qsText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogDetail::AddUpdate()
|
||||||
|
{
|
||||||
|
MaterialCutPlacement mcp;
|
||||||
|
mcp.m_qsMaterialUserDef = ui.comboBoxMaterial->currentText();
|
||||||
|
mcp.m_eMaterial = MaterialType::mtUserDefined;
|
||||||
|
for (int i = 0; i < m_qslMaterials.count(); ++i)
|
||||||
|
if (mcp.m_qsMaterialUserDef == m_qslMaterials[i])
|
||||||
|
mcp.m_eMaterial = MaterialType(i);
|
||||||
|
|
||||||
|
mcp.m_iCutNumber = ui.spinBoxCutNumber->value();
|
||||||
|
mcp.m_ePlacement = PlacementType(ui.comboBoxPlacement->currentIndex());
|
||||||
|
|
||||||
|
if (m_bAddMode == true)
|
||||||
|
{
|
||||||
|
detail.GetPatternPieceData().Append(mcp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int iR = ui.listWidgetMCP->currentRow();
|
||||||
|
SCASSERT(iR >= 0);
|
||||||
|
detail.GetPatternPieceData().Set(iR, mcp);
|
||||||
|
SetAddMode();
|
||||||
|
}
|
||||||
|
UpdateList();
|
||||||
|
ClearFields();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogDetail::Cancel()
|
||||||
|
{
|
||||||
|
ClearFields();
|
||||||
|
SetAddMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogDetail::Remove()
|
||||||
|
{
|
||||||
|
int iR = ui.listWidgetMCP->currentRow();
|
||||||
|
SCASSERT(iR >= 0);
|
||||||
|
detail.GetPatternPieceData().RemoveMCP(iR);
|
||||||
|
UpdateList();
|
||||||
|
ClearFields();
|
||||||
|
SetAddMode();
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief NewItem add new object (point, arc, spline or spline path) to list
|
* @brief NewItem add new object (point, arc, spline or spline path) to list
|
||||||
|
@ -245,6 +327,14 @@ VDetail DialogDetail::CreateDetail() const
|
||||||
detail.setName(ui.lineEditNameDetail->text());
|
detail.setName(ui.lineEditNameDetail->text());
|
||||||
detail.setSeamAllowance(supplement);
|
detail.setSeamAllowance(supplement);
|
||||||
detail.setClosed(closed);
|
detail.setClosed(closed);
|
||||||
|
|
||||||
|
detail.GetPatternPieceData().SetLetter(ui.lineEditLetter->text());
|
||||||
|
detail.GetPatternPieceData().SetName(ui.lineEditName->text());
|
||||||
|
|
||||||
|
qDebug() << "DD" << detail.GetPatternPieceData().GetLetter()
|
||||||
|
<< detail.GetPatternPieceData().GetName()
|
||||||
|
<< detail.GetPatternPieceData().GetMCPCount();
|
||||||
|
|
||||||
return detail;
|
return detail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,6 +382,11 @@ void DialogDetail::setDetail(const VDetail &value)
|
||||||
ui.listWidget->setCurrentRow(0);
|
ui.listWidget->setCurrentRow(0);
|
||||||
ui.listWidget->setFocus(Qt::OtherFocusReason);
|
ui.listWidget->setFocus(Qt::OtherFocusReason);
|
||||||
ui.toolButtonDelete->setEnabled(true);
|
ui.toolButtonDelete->setEnabled(true);
|
||||||
|
|
||||||
|
ui.lineEditLetter->setText(detail.GetPatternPieceData().GetLetter());
|
||||||
|
ui.lineEditName->setText(detail.GetPatternPieceData().GetName());
|
||||||
|
UpdateList();
|
||||||
|
|
||||||
ValidObjects(DetailIsValid());
|
ValidObjects(DetailIsValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -555,3 +650,41 @@ bool DialogDetail::DetailIsClockwise() const
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogDetail::ClearFields()
|
||||||
|
{
|
||||||
|
ui.comboBoxMaterial->setCurrentIndex(0);
|
||||||
|
ui.spinBoxCutNumber->setValue(0);
|
||||||
|
ui.comboBoxPlacement->setCurrentIndex(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogDetail::SetAddMode()
|
||||||
|
{
|
||||||
|
ui.pushButtonAdd->setText(tr("Add"));
|
||||||
|
ui.pushButtonCancel->hide();
|
||||||
|
ui.pushButtonRemove->hide();
|
||||||
|
ui.listWidgetMCP->setCurrentRow(-1);
|
||||||
|
m_bAddMode = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogDetail::SetEditMode()
|
||||||
|
{
|
||||||
|
int iR = ui.listWidgetMCP->currentRow();
|
||||||
|
// this method can be called by clicking on item or by update. In the latter case there is nothing else to do!
|
||||||
|
if (iR < 0 || iR >= detail.GetPatternPieceData().GetMCPCount())
|
||||||
|
return;
|
||||||
|
|
||||||
|
ui.pushButtonAdd->setText(tr("Update"));
|
||||||
|
ui.pushButtonCancel->show();
|
||||||
|
ui.pushButtonRemove->show();
|
||||||
|
|
||||||
|
MaterialCutPlacement mcp = detail.GetPatternPieceData().GetMCP(iR);
|
||||||
|
ui.comboBoxMaterial->setCurrentText(mcp.m_qsMaterialUserDef);
|
||||||
|
ui.spinBoxCutNumber->setValue(mcp.m_iCutNumber);
|
||||||
|
ui.comboBoxPlacement->setCurrentIndex(int(mcp.m_ePlacement));
|
||||||
|
|
||||||
|
m_bAddMode = false;
|
||||||
|
}
|
||||||
|
|
|
@ -62,6 +62,13 @@ protected:
|
||||||
*/
|
*/
|
||||||
virtual void SaveData() Q_DECL_OVERRIDE;
|
virtual void SaveData() Q_DECL_OVERRIDE;
|
||||||
virtual void CheckState() Q_DECL_OVERRIDE;
|
virtual void CheckState() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void UpdateList();
|
||||||
|
void AddUpdate();
|
||||||
|
void Cancel();
|
||||||
|
void Remove();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/** @brief ui keeps information about user interface */
|
/** @brief ui keeps information about user interface */
|
||||||
|
@ -85,6 +92,18 @@ private:
|
||||||
VDetail CreateDetail() const;
|
VDetail CreateDetail() const;
|
||||||
void ValidObjects(bool value);
|
void ValidObjects(bool value);
|
||||||
void EnableObjectGUI(bool value);
|
void EnableObjectGUI(bool value);
|
||||||
|
|
||||||
|
bool m_bAddMode;
|
||||||
|
|
||||||
|
QStringList m_qslMaterials;
|
||||||
|
QStringList m_qslPlacements;
|
||||||
|
|
||||||
|
void ClearFields();
|
||||||
|
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void SetAddMode();
|
||||||
|
void SetEditMode();
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>522</width>
|
<width>522</width>
|
||||||
<height>425</height>
|
<height>481</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -20,11 +20,422 @@
|
||||||
<property name="locale">
|
<property name="locale">
|
||||||
<locale language="English" country="UnitedStates"/>
|
<locale language="English" country="UnitedStates"/>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<item>
|
<property name="currentIndex">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="tab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>General</string>
|
||||||
|
</attribute>
|
||||||
|
<widget class="QLabel" name="helpLabel">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>59</x>
|
||||||
|
<y>468</y>
|
||||||
|
<width>504</width>
|
||||||
|
<height>15</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Ready!</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="layoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>50</x>
|
||||||
|
<y>40</y>
|
||||||
|
<width>367</width>
|
||||||
|
<height>34</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_7"/>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="layoutWidget_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>30</y>
|
||||||
|
<width>561</width>
|
||||||
|
<height>361</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetDefaultConstraint</enum>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Bias X:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxBiasX">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>0.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelUnitX">
|
||||||
|
<property name="text">
|
||||||
|
<string>cm</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Bias Y:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxBiasY">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelUnitY">
|
||||||
|
<property name="text">
|
||||||
|
<string>cm</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxReverse">
|
||||||
|
<property name="text">
|
||||||
|
<string>Reverse</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Options</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelEditNameDetail">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>159</red>
|
||||||
|
<green>158</green>
|
||||||
|
<blue>158</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="locale">
|
||||||
|
<locale language="English" country="UnitedStates"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Name of detail:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEditNameDetail">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Detail</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxSeams">
|
||||||
|
<property name="text">
|
||||||
|
<string>Seam allowance</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelEditWidth">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="locale">
|
||||||
|
<locale language="English" country="UnitedStates"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Width:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxSeams">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>1.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelUnit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>cm</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxClosed">
|
||||||
|
<property name="text">
|
||||||
|
<string>Closed</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetFixedSize</enum>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<item alignment="Qt::AlignLeft">
|
||||||
|
<widget class="QToolButton" name="toolButtonDelete">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Delete</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QToolButton" name="toolButtonDown">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Scroll down the list</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-down">
|
||||||
|
<normaloff/>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QToolButton" name="toolButtonUp">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Scroll up the list</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="go-up">
|
||||||
|
<normaloff/>
|
||||||
|
</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QListWidget" name="listWidget"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>50</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>327</width>
|
||||||
|
<height>32</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>All objects in path should follow in clockwise direction.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>32</width>
|
||||||
|
<height>32</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -38,376 +449,160 @@
|
||||||
<pixmap resource="../../../vmisc/share/resources/icon.qrc">:/icon/32x32/clockwise.png</pixmap>
|
<pixmap resource="../../../vmisc/share/resources/icon.qrc">:/icon/32x32/clockwise.png</pixmap>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</widget>
|
||||||
<item>
|
<widget class="QWidget" name="tab_2">
|
||||||
<widget class="QLabel" name="label_4">
|
<attribute name="title">
|
||||||
<property name="text">
|
<string>Pattern piece data</string>
|
||||||
<string>All objects in path should follow in clockwise direction.</string>
|
</attribute>
|
||||||
</property>
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
</widget>
|
<item row="0" column="0">
|
||||||
</item>
|
<widget class="QWidget" name="widget" native="true">
|
||||||
</layout>
|
<widget class="QLabel" name="label_6">
|
||||||
</item>
|
<property name="geometry">
|
||||||
<item>
|
<rect>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
<x>9</x>
|
||||||
<item>
|
<y>38</y>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<width>40</width>
|
||||||
<item>
|
<height>16</height>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
</rect>
|
||||||
<property name="spacing">
|
</property>
|
||||||
<number>6</number>
|
<property name="text">
|
||||||
</property>
|
<string>Name:</string>
|
||||||
<property name="sizeConstraint">
|
</property>
|
||||||
<enum>QLayout::SetDefaultConstraint</enum>
|
</widget>
|
||||||
</property>
|
<widget class="QLineEdit" name="lineEditName">
|
||||||
<property name="leftMargin">
|
<property name="geometry">
|
||||||
<number>0</number>
|
<rect>
|
||||||
</property>
|
<x>55</x>
|
||||||
<property name="topMargin">
|
<y>38</y>
|
||||||
<number>0</number>
|
<width>125</width>
|
||||||
</property>
|
<height>23</height>
|
||||||
<item>
|
</rect>
|
||||||
<widget class="QLabel" name="label">
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="maxLength">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<number>15</number>
|
||||||
<horstretch>1</horstretch>
|
</property>
|
||||||
<verstretch>0</verstretch>
|
</widget>
|
||||||
</sizepolicy>
|
<widget class="QListWidget" name="listWidgetMCP">
|
||||||
</property>
|
<property name="geometry">
|
||||||
<property name="text">
|
<rect>
|
||||||
<string>Bias X:</string>
|
<x>280</x>
|
||||||
</property>
|
<y>0</y>
|
||||||
</widget>
|
<width>201</width>
|
||||||
</item>
|
<height>381</height>
|
||||||
<item>
|
</rect>
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxBiasX">
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="focusPolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<enum>Qt::ClickFocus</enum>
|
||||||
<horstretch>1</horstretch>
|
</property>
|
||||||
<verstretch>0</verstretch>
|
</widget>
|
||||||
</sizepolicy>
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
</property>
|
<property name="geometry">
|
||||||
<property name="minimum">
|
<rect>
|
||||||
<double>-900.990000000000009</double>
|
<x>0</x>
|
||||||
</property>
|
<y>70</y>
|
||||||
<property name="maximum">
|
<width>271</width>
|
||||||
<double>900.990000000000009</double>
|
<height>153</height>
|
||||||
</property>
|
</rect>
|
||||||
<property name="singleStep">
|
</property>
|
||||||
<double>0.100000000000000</double>
|
<property name="title">
|
||||||
</property>
|
<string>Material/Cut number/Placement</string>
|
||||||
<property name="value">
|
</property>
|
||||||
<double>0.000000000000000</double>
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
</property>
|
<item row="0" column="0" colspan="2">
|
||||||
</widget>
|
<widget class="QLabel" name="label_7">
|
||||||
</item>
|
<property name="text">
|
||||||
<item>
|
<string>Material type:</string>
|
||||||
<widget class="QLabel" name="labelUnitX">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>cm</string>
|
</item>
|
||||||
</property>
|
<item row="0" column="2" colspan="2">
|
||||||
</widget>
|
<widget class="QComboBox" name="comboBoxMaterial">
|
||||||
</item>
|
<property name="editable">
|
||||||
</layout>
|
<bool>true</bool>
|
||||||
</item>
|
</property>
|
||||||
<item>
|
</widget>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_8">
|
||||||
<property name="sizePolicy">
|
<property name="text">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<string>Cut number:</string>
|
||||||
<horstretch>1</horstretch>
|
</property>
|
||||||
<verstretch>0</verstretch>
|
</widget>
|
||||||
</sizepolicy>
|
</item>
|
||||||
</property>
|
<item row="1" column="2" colspan="2">
|
||||||
<property name="text">
|
<widget class="QSpinBox" name="spinBoxCutNumber">
|
||||||
<string>Bias Y:</string>
|
<property name="maximum">
|
||||||
</property>
|
<number>1000</number>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
</widget>
|
||||||
<item>
|
</item>
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxBiasY">
|
<item row="2" column="0">
|
||||||
<property name="sizePolicy">
|
<widget class="QLabel" name="label_9">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<property name="text">
|
||||||
<horstretch>1</horstretch>
|
<string>Placement:</string>
|
||||||
<verstretch>0</verstretch>
|
</property>
|
||||||
</sizepolicy>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
<property name="minimum">
|
<item row="2" column="2" colspan="2">
|
||||||
<double>-900.990000000000009</double>
|
<widget class="QComboBox" name="comboBoxPlacement"/>
|
||||||
</property>
|
</item>
|
||||||
<property name="maximum">
|
<item row="3" column="0">
|
||||||
<double>900.990000000000009</double>
|
<widget class="QPushButton" name="pushButtonAdd">
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="singleStep">
|
<string>Add</string>
|
||||||
<double>0.100000000000000</double>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="3" column="1" colspan="2">
|
||||||
<item>
|
<widget class="QPushButton" name="pushButtonCancel">
|
||||||
<widget class="QLabel" name="labelUnitY">
|
<property name="text">
|
||||||
<property name="text">
|
<string>Cancel</string>
|
||||||
<string>cm</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="3" column="3">
|
||||||
</layout>
|
<widget class="QPushButton" name="pushButtonRemove">
|
||||||
</item>
|
<property name="text">
|
||||||
<item>
|
<string>Remove</string>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
</property>
|
||||||
<item>
|
</widget>
|
||||||
<widget class="QCheckBox" name="checkBoxReverse">
|
</item>
|
||||||
<property name="text">
|
</layout>
|
||||||
<string>Reverse</string>
|
</widget>
|
||||||
</property>
|
<widget class="QLabel" name="label_5">
|
||||||
</widget>
|
<property name="geometry">
|
||||||
</item>
|
<rect>
|
||||||
</layout>
|
<x>9</x>
|
||||||
</item>
|
<y>9</y>
|
||||||
<item>
|
<width>40</width>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<height>16</height>
|
||||||
<property name="title">
|
</rect>
|
||||||
<string>Options</string>
|
</property>
|
||||||
</property>
|
<property name="text">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<string>Letter:</string>
|
||||||
<item>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
</widget>
|
||||||
<item>
|
<widget class="QLineEdit" name="lineEditLetter">
|
||||||
<widget class="QLabel" name="labelEditNameDetail">
|
<property name="geometry">
|
||||||
<property name="sizePolicy">
|
<rect>
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<x>55</x>
|
||||||
<horstretch>0</horstretch>
|
<y>9</y>
|
||||||
<verstretch>0</verstretch>
|
<width>125</width>
|
||||||
</sizepolicy>
|
<height>23</height>
|
||||||
</property>
|
</rect>
|
||||||
<property name="palette">
|
</property>
|
||||||
<palette>
|
<property name="maxLength">
|
||||||
<active>
|
<number>3</number>
|
||||||
<colorrole role="WindowText">
|
</property>
|
||||||
<brush brushstyle="SolidPattern">
|
</widget>
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</active>
|
|
||||||
<inactive>
|
|
||||||
<colorrole role="WindowText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>255</red>
|
|
||||||
<green>0</green>
|
|
||||||
<blue>0</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</inactive>
|
|
||||||
<disabled>
|
|
||||||
<colorrole role="WindowText">
|
|
||||||
<brush brushstyle="SolidPattern">
|
|
||||||
<color alpha="255">
|
|
||||||
<red>159</red>
|
|
||||||
<green>158</green>
|
|
||||||
<blue>158</blue>
|
|
||||||
</color>
|
|
||||||
</brush>
|
|
||||||
</colorrole>
|
|
||||||
</disabled>
|
|
||||||
</palette>
|
|
||||||
</property>
|
|
||||||
<property name="locale">
|
|
||||||
<locale language="English" country="UnitedStates"/>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Name of detail:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="lineEditNameDetail">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Detail</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxSeams">
|
|
||||||
<property name="text">
|
|
||||||
<string>Seam allowance</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="labelEditWidth">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>1</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="locale">
|
|
||||||
<locale language="English" country="UnitedStates"/>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Width:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxSeams">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
|
||||||
<horstretch>1</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>900.990000000000009</double>
|
|
||||||
</property>
|
|
||||||
<property name="singleStep">
|
|
||||||
<double>0.100000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<double>1.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="labelUnit">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>cm</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="checkBoxClosed">
|
|
||||||
<property name="text">
|
|
||||||
<string>Closed</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetFixedSize</enum>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<item alignment="Qt::AlignLeft">
|
|
||||||
<widget class="QToolButton" name="toolButtonDelete">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Delete</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item alignment="Qt::AlignRight">
|
|
||||||
<widget class="QToolButton" name="toolButtonDown">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Scroll down the list</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="go-down">
|
|
||||||
<normaloff/>
|
|
||||||
</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item alignment="Qt::AlignRight">
|
|
||||||
<widget class="QToolButton" name="toolButtonUp">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Scroll up the list</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="go-up">
|
|
||||||
<normaloff/>
|
|
||||||
</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</widget>
|
||||||
<item>
|
|
||||||
<widget class="QListWidget" name="listWidget"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="helpLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Ready!</string>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::RichText</enum>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
|
@ -420,14 +615,28 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
<tabstop>lineEditLetter</tabstop>
|
||||||
|
<tabstop>lineEditName</tabstop>
|
||||||
|
<tabstop>comboBoxMaterial</tabstop>
|
||||||
|
<tabstop>spinBoxCutNumber</tabstop>
|
||||||
|
<tabstop>comboBoxPlacement</tabstop>
|
||||||
|
<tabstop>pushButtonAdd</tabstop>
|
||||||
|
<tabstop>pushButtonCancel</tabstop>
|
||||||
|
<tabstop>pushButtonRemove</tabstop>
|
||||||
|
<tabstop>tabWidget</tabstop>
|
||||||
|
<tabstop>listWidgetMCP</tabstop>
|
||||||
|
<tabstop>buttonBox</tabstop>
|
||||||
|
<tabstop>toolButtonUp</tabstop>
|
||||||
<tabstop>listWidget</tabstop>
|
<tabstop>listWidget</tabstop>
|
||||||
|
<tabstop>checkBoxClosed</tabstop>
|
||||||
|
<tabstop>toolButtonDelete</tabstop>
|
||||||
<tabstop>doubleSpinBoxBiasX</tabstop>
|
<tabstop>doubleSpinBoxBiasX</tabstop>
|
||||||
<tabstop>doubleSpinBoxBiasY</tabstop>
|
<tabstop>doubleSpinBoxBiasY</tabstop>
|
||||||
|
<tabstop>checkBoxReverse</tabstop>
|
||||||
<tabstop>lineEditNameDetail</tabstop>
|
<tabstop>lineEditNameDetail</tabstop>
|
||||||
<tabstop>checkBoxSeams</tabstop>
|
<tabstop>checkBoxSeams</tabstop>
|
||||||
<tabstop>doubleSpinBoxSeams</tabstop>
|
<tabstop>doubleSpinBoxSeams</tabstop>
|
||||||
<tabstop>checkBoxClosed</tabstop>
|
<tabstop>toolButtonDown</tabstop>
|
||||||
<tabstop>buttonBox</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../vmisc/share/resources/icon.qrc"/>
|
<include location="../../../vmisc/share/resources/icon.qrc"/>
|
||||||
|
|
|
@ -1,250 +0,0 @@
|
||||||
/************************************************************************
|
|
||||||
**
|
|
||||||
** @file vpatternconverter.cpp
|
|
||||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
||||||
** @date 11 12, 2014
|
|
||||||
**
|
|
||||||
** @brief
|
|
||||||
** @copyright
|
|
||||||
** This source code is part of the Valentine project, a pattern making
|
|
||||||
** program, whose allow create and modeling patterns of clothing.
|
|
||||||
** Copyright (C) 2013-2015 Valentina project
|
|
||||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
||||||
**
|
|
||||||
** Valentina is free software: you can redistribute it and/or modify
|
|
||||||
** it under the terms of the GNU General Public License as published by
|
|
||||||
** the Free Software Foundation, either version 3 of the License, or
|
|
||||||
** (at your option) any later version.
|
|
||||||
**
|
|
||||||
** Valentina is distributed in the hope that it will be useful,
|
|
||||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
** GNU General Public License for more details.
|
|
||||||
**
|
|
||||||
** You should have received a copy of the GNU General Public License
|
|
||||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
**
|
|
||||||
*************************************************************************/
|
|
||||||
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QFormLayout>
|
|
||||||
#include <QGridLayout>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QGroupBox>
|
|
||||||
|
|
||||||
#include "vpatternpiecedata.h"
|
|
||||||
#include "dialogpatternpiecedata.h"
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
DialogPatternPieceData::DialogPatternPieceData(const VContainer *data, const quint32 &toolId, QWidget *parent) :
|
|
||||||
DialogTool(data, toolId, parent)
|
|
||||||
{
|
|
||||||
// main dialog layout
|
|
||||||
QVBoxLayout* pLayout = new QVBoxLayout(this);
|
|
||||||
|
|
||||||
// widgets layout
|
|
||||||
QHBoxLayout* pWidgetsLayout = new QHBoxLayout;
|
|
||||||
|
|
||||||
setWindowTitle(tr("Pattern piece data"));
|
|
||||||
QFormLayout* pFormLayout = new QFormLayout;
|
|
||||||
QLabel* plb;
|
|
||||||
|
|
||||||
plb = new QLabel(tr("Letter") + ":");
|
|
||||||
m_pleLetter = new QLineEdit;
|
|
||||||
m_pleLetter->setMaxLength(3);
|
|
||||||
pFormLayout->addRow(plb, m_pleLetter);
|
|
||||||
|
|
||||||
plb = new QLabel(tr("Name") + ":");
|
|
||||||
m_pleName = new QLineEdit;
|
|
||||||
m_pleName->setMaxLength(15);
|
|
||||||
pFormLayout->addRow(plb, m_pleName);
|
|
||||||
|
|
||||||
pWidgetsLayout->addLayout(pFormLayout);
|
|
||||||
|
|
||||||
QGroupBox* pgb = new QGroupBox(tr("Material/Cut number/Placement"));
|
|
||||||
QGridLayout* pLayoutGB = new QGridLayout(pgb);
|
|
||||||
|
|
||||||
pFormLayout = new QFormLayout;
|
|
||||||
|
|
||||||
plb = new QLabel(tr("Material type") + ":");
|
|
||||||
m_pcbMaterial = new QComboBox;
|
|
||||||
m_pcbMaterial->setFixedWidth(200);
|
|
||||||
m_qslMaterials << tr("Fabric") << tr("Lining") << tr("Interfacing") << tr("Interlining");
|
|
||||||
m_pcbMaterial->addItems(m_qslMaterials);
|
|
||||||
m_pcbMaterial->setEditable(true);
|
|
||||||
pFormLayout->addRow(plb, m_pcbMaterial);
|
|
||||||
|
|
||||||
plb = new QLabel(tr("Cut number") + ":");
|
|
||||||
m_psbCutNumber = new QSpinBox;
|
|
||||||
m_psbCutNumber->setRange(0, 1000);
|
|
||||||
pFormLayout->addRow(plb, m_psbCutNumber);
|
|
||||||
|
|
||||||
plb = new QLabel(tr("Placement type") + ":");
|
|
||||||
m_pcbPlacement = new QComboBox;
|
|
||||||
m_qslPlacements << tr("None") << tr("Cut on fold");
|
|
||||||
m_pcbPlacement->addItems(m_qslPlacements);
|
|
||||||
pFormLayout->addRow(plb, m_pcbPlacement);
|
|
||||||
pLayoutGB->addLayout(pFormLayout, 0, 0);
|
|
||||||
|
|
||||||
QHBoxLayout* pMCPButtonLayout = new QHBoxLayout;
|
|
||||||
m_pbOpAddUpdate = new QPushButton;
|
|
||||||
connect(m_pbOpAddUpdate, &QPushButton::clicked, this, &DialogPatternPieceData::AddUpdate);
|
|
||||||
pMCPButtonLayout->addStretch(1);
|
|
||||||
pMCPButtonLayout->addWidget(m_pbOpAddUpdate);
|
|
||||||
m_pbOpCancel = new QPushButton(tr("Cancel"));
|
|
||||||
connect(m_pbOpCancel, &QPushButton::clicked, this, &DialogPatternPieceData::Cancel);
|
|
||||||
pMCPButtonLayout->addWidget(m_pbOpCancel);
|
|
||||||
m_pbOpRemove = new QPushButton(tr("Remove"));
|
|
||||||
connect(m_pbOpRemove, &QPushButton::clicked, this, &DialogPatternPieceData::Remove);
|
|
||||||
pMCPButtonLayout->addWidget(m_pbOpRemove);
|
|
||||||
pLayoutGB->addLayout(pMCPButtonLayout, 1, 0);
|
|
||||||
|
|
||||||
m_plwMCP = new QListWidget;
|
|
||||||
connect(m_plwMCP, &QListWidget::itemClicked, this, &DialogPatternPieceData::SetEditMode);
|
|
||||||
pLayoutGB->addWidget(m_plwMCP, 0, 1, 3, 1);
|
|
||||||
pLayoutGB->setRowStretch(2, 1);
|
|
||||||
pLayoutGB->setColumnStretch(2, 1);
|
|
||||||
|
|
||||||
pWidgetsLayout->addWidget(pgb);
|
|
||||||
|
|
||||||
pWidgetsLayout->setStretch(2, 1);
|
|
||||||
|
|
||||||
pLayout->addLayout(pWidgetsLayout);
|
|
||||||
|
|
||||||
QHBoxLayout* pButtonsLayout = new QHBoxLayout;
|
|
||||||
pButtonsLayout->addStretch(0);
|
|
||||||
bOk = new QPushButton(tr("OK"));
|
|
||||||
connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted);
|
|
||||||
QPushButton* pbCancel = new QPushButton(tr("Cancel"));
|
|
||||||
connect(pbCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
|
|
||||||
pButtonsLayout->addWidget(bOk);
|
|
||||||
pButtonsLayout->addWidget(pbCancel);
|
|
||||||
|
|
||||||
pLayout->addLayout(pButtonsLayout);
|
|
||||||
pLayout->setStretch(0, 1);
|
|
||||||
|
|
||||||
SetAddMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternPieceData::SetDetail(const VDetail& rDetail)
|
|
||||||
{
|
|
||||||
m_detail = rDetail;
|
|
||||||
m_pleLetter->setText(m_detail.GetPatternPieceData().GetLetter());
|
|
||||||
m_pleName->setText(m_detail.GetPatternPieceData().GetName());
|
|
||||||
UpdateList();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternPieceData::SaveData()
|
|
||||||
{
|
|
||||||
m_detail.GetPatternPieceData().SetLetter(m_pleLetter->text());
|
|
||||||
m_detail.GetPatternPieceData().SetName(m_pleName->text());
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternPieceData::UpdateList()
|
|
||||||
{
|
|
||||||
m_plwMCP->clear();
|
|
||||||
for (int i = 0; i < m_detail.GetPatternPieceData().GetMCPCount(); ++i)
|
|
||||||
{
|
|
||||||
MaterialCutPlacement mcp = m_detail.GetPatternPieceData().GetMCP(i);
|
|
||||||
QString qsText = tr("Cut %1 of %2%3");
|
|
||||||
qsText = qsText.arg(mcp.m_iCutNumber);
|
|
||||||
if (mcp.m_eMaterial < MaterialType::mtUserDefined)
|
|
||||||
qsText = qsText.arg(m_qslMaterials[int(mcp.m_eMaterial)]);
|
|
||||||
else
|
|
||||||
qsText = qsText.arg(mcp.m_qsMaterialUserDef);
|
|
||||||
if (mcp.m_ePlacement == PlacementType::ptCutOnFold)
|
|
||||||
qsText = qsText.arg(tr(" on Fold"));
|
|
||||||
else
|
|
||||||
qsText = qsText.arg("");
|
|
||||||
|
|
||||||
m_plwMCP->addItem(qsText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternPieceData::AddUpdate()
|
|
||||||
{
|
|
||||||
MaterialCutPlacement mcp;
|
|
||||||
mcp.m_qsMaterialUserDef = m_pcbMaterial->currentText();
|
|
||||||
mcp.m_eMaterial = MaterialType::mtUserDefined;
|
|
||||||
for (int i = 0; i < m_qslMaterials.count(); ++i)
|
|
||||||
if (mcp.m_qsMaterialUserDef == m_qslMaterials[i])
|
|
||||||
mcp.m_eMaterial = MaterialType(i);
|
|
||||||
|
|
||||||
mcp.m_iCutNumber = m_psbCutNumber->value();
|
|
||||||
mcp.m_ePlacement = PlacementType(m_pcbPlacement->currentIndex());
|
|
||||||
|
|
||||||
if (m_bAddMode == true)
|
|
||||||
{
|
|
||||||
m_detail.GetPatternPieceData().Append(mcp);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int iR = m_plwMCP->currentRow();
|
|
||||||
SCASSERT(iR >= 0);
|
|
||||||
m_detail.GetPatternPieceData().Set(iR, mcp);
|
|
||||||
SetAddMode();
|
|
||||||
}
|
|
||||||
UpdateList();
|
|
||||||
ClearFields();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternPieceData::Cancel()
|
|
||||||
{
|
|
||||||
ClearFields();
|
|
||||||
SetAddMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternPieceData::Remove()
|
|
||||||
{
|
|
||||||
int iR = m_plwMCP->currentRow();
|
|
||||||
SCASSERT(iR >= 0);
|
|
||||||
m_detail.GetPatternPieceData().RemoveMCP(iR);
|
|
||||||
UpdateList();
|
|
||||||
ClearFields();
|
|
||||||
SetAddMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternPieceData::ClearFields()
|
|
||||||
{
|
|
||||||
m_pcbMaterial->setCurrentIndex(0);
|
|
||||||
m_psbCutNumber->setValue(0);
|
|
||||||
m_pcbPlacement->setCurrentIndex(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternPieceData::SetAddMode()
|
|
||||||
{
|
|
||||||
m_pbOpAddUpdate->setText(tr("Add"));
|
|
||||||
m_pbOpCancel->hide();
|
|
||||||
m_pbOpRemove->hide();
|
|
||||||
m_plwMCP->setCurrentRow(-1);
|
|
||||||
m_bAddMode = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternPieceData::SetEditMode()
|
|
||||||
{
|
|
||||||
int iR = m_plwMCP->currentRow();
|
|
||||||
// this method can be called by clicking on item or by update. In the latter case there is nothing else to do!
|
|
||||||
if (iR < 0 || iR >= m_detail.GetPatternPieceData().GetMCPCount())
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_pbOpAddUpdate->setText(tr("Update"));
|
|
||||||
m_pbOpCancel->show();
|
|
||||||
m_pbOpRemove->show();
|
|
||||||
|
|
||||||
MaterialCutPlacement mcp = m_detail.GetPatternPieceData().GetMCP(iR);
|
|
||||||
m_pcbMaterial->setCurrentText(mcp.m_qsMaterialUserDef);
|
|
||||||
m_psbCutNumber->setValue(mcp.m_iCutNumber);
|
|
||||||
m_pcbPlacement->setCurrentIndex(int(mcp.m_ePlacement));
|
|
||||||
|
|
||||||
m_bAddMode = false;
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
/************************************************************************
|
|
||||||
**
|
|
||||||
** @file vpatternconverter.cpp
|
|
||||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
||||||
** @date 11 12, 2014
|
|
||||||
**
|
|
||||||
** @brief
|
|
||||||
** @copyright
|
|
||||||
** This source code is part of the Valentine project, a pattern making
|
|
||||||
** program, whose allow create and modeling patterns of clothing.
|
|
||||||
** Copyright (C) 2013-2015 Valentina project
|
|
||||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
||||||
**
|
|
||||||
** Valentina is free software: you can redistribute it and/or modify
|
|
||||||
** it under the terms of the GNU General Public License as published by
|
|
||||||
** the Free Software Foundation, either version 3 of the License, or
|
|
||||||
** (at your option) any later version.
|
|
||||||
**
|
|
||||||
** Valentina is distributed in the hope that it will be useful,
|
|
||||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
** GNU General Public License for more details.
|
|
||||||
**
|
|
||||||
** You should have received a copy of the GNU General Public License
|
|
||||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
**
|
|
||||||
*************************************************************************/
|
|
||||||
|
|
||||||
#ifndef DIALOGPATTERNPIECEDATA_H
|
|
||||||
#define DIALOGPATTERNPIECEDATA_H
|
|
||||||
|
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QSpinBox>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QListWidget>
|
|
||||||
|
|
||||||
#include "vdetail.h"
|
|
||||||
#include "dialogtool.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This dialog allows user to edit pattern piece meta data
|
|
||||||
*/
|
|
||||||
class DialogPatternPieceData : public DialogTool
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
DialogPatternPieceData(const VContainer* data, const quint32& toolId, QWidget* parent = nullptr);
|
|
||||||
|
|
||||||
VDetail GetDetail() const;
|
|
||||||
void SetDetail(const VDetail& rDetail);
|
|
||||||
|
|
||||||
void SaveData();
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void UpdateList();
|
|
||||||
void AddUpdate();
|
|
||||||
void Cancel();
|
|
||||||
void Remove();
|
|
||||||
|
|
||||||
private:
|
|
||||||
VDetail m_detail;
|
|
||||||
|
|
||||||
QLineEdit* m_pleName;
|
|
||||||
QLineEdit* m_pleLetter;
|
|
||||||
QComboBox* m_pcbMaterial;
|
|
||||||
QSpinBox* m_psbCutNumber;
|
|
||||||
QComboBox* m_pcbPlacement;
|
|
||||||
|
|
||||||
QPushButton* m_pbOpAddUpdate;
|
|
||||||
QPushButton* m_pbOpCancel;
|
|
||||||
QPushButton* m_pbOpRemove;
|
|
||||||
|
|
||||||
QListWidget* m_plwMCP;
|
|
||||||
|
|
||||||
QStringList m_qslMaterials;
|
|
||||||
QStringList m_qslPlacements;
|
|
||||||
|
|
||||||
bool m_bAddMode;
|
|
||||||
|
|
||||||
void ClearFields();
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void SetAddMode();
|
|
||||||
void SetEditMode();
|
|
||||||
};
|
|
||||||
|
|
||||||
inline VDetail DialogPatternPieceData::GetDetail() const
|
|
||||||
{
|
|
||||||
return m_detail;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // DIALOGPATTERNPIECEDATA_H
|
|
|
@ -36,7 +36,6 @@
|
||||||
#include "../vwidgets/vmaingraphicsview.h"
|
#include "../vwidgets/vmaingraphicsview.h"
|
||||||
#include "../dialogs/tools/dialogtool.h"
|
#include "../dialogs/tools/dialogtool.h"
|
||||||
#include "../dialogs/tools/dialogdetail.h"
|
#include "../dialogs/tools/dialogdetail.h"
|
||||||
#include "../dialogs/tools/dialogpatternpiecedata.h"
|
|
||||||
#include "../undocommands/savedetailoptions.h"
|
#include "../undocommands/savedetailoptions.h"
|
||||||
#include "../undocommands/movedetail.h"
|
#include "../undocommands/movedetail.h"
|
||||||
#include "../undocommands/adddet.h"
|
#include "../undocommands/adddet.h"
|
||||||
|
@ -295,21 +294,17 @@ void VToolDetail::FullUpdateFromGuiOk(int result)
|
||||||
if (result == QDialog::Accepted)
|
if (result == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
VDetail newDet;
|
|
||||||
VDetail oldDet = VAbstractTool::data.GetDetail(id);
|
|
||||||
DialogDetail *dialogTool = qobject_cast<DialogDetail*>(dialog);
|
DialogDetail *dialogTool = qobject_cast<DialogDetail*>(dialog);
|
||||||
//SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
|
|
||||||
|
VDetail newDet = dialogTool->getDetail();
|
||||||
|
VDetail oldDet = VAbstractTool::data.GetDetail(id);
|
||||||
|
|
||||||
|
qDebug() << "VTOOL" << newDet.GetPatternPieceData().GetLetter()
|
||||||
|
<< newDet.GetPatternPieceData().GetName()
|
||||||
|
<< newDet.GetPatternPieceData().GetMCPCount()
|
||||||
|
<< dialogTool->getDetail().GetPatternPieceData().GetName();
|
||||||
|
|
||||||
if (dialogTool != nullptr)
|
|
||||||
{
|
|
||||||
newDet = dialogTool->getDetail();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DialogPatternPieceData* dialogPPD = qobject_cast<DialogPatternPieceData*>(dialog);
|
|
||||||
SCASSERT(dialogPPD != nullptr);
|
|
||||||
newDet = dialogPPD->GetDetail();
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveDetailOptions *saveCommand = new SaveDetailOptions(oldDet, newDet, doc, id, this->scene());
|
SaveDetailOptions *saveCommand = new SaveDetailOptions(oldDet, newDet, doc, id, this->scene());
|
||||||
connect(saveCommand, &SaveDetailOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
|
connect(saveCommand, &SaveDetailOptions::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
|
||||||
|
@ -551,7 +546,6 @@ void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction *actionOption = menu.addAction(QIcon::fromTheme("preferences-other"), tr("Options"));
|
QAction *actionOption = menu.addAction(QIcon::fromTheme("preferences-other"), tr("Options"));
|
||||||
QAction* actionData = menu.addAction(tr("Details info"));
|
|
||||||
QAction *actionRemove = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
|
QAction *actionRemove = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
|
||||||
if (_referens > 1)
|
if (_referens > 1)
|
||||||
{
|
{
|
||||||
|
@ -572,16 +566,6 @@ void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
setDialog();
|
setDialog();
|
||||||
dialog->show();
|
dialog->show();
|
||||||
}
|
}
|
||||||
else if (selectedAction == actionData)
|
|
||||||
{
|
|
||||||
dialog = new DialogPatternPieceData(getData(), id, qApp->getMainWindow());
|
|
||||||
dialog->setModal(true);
|
|
||||||
|
|
||||||
connect(dialog, &DialogTool::DialogClosed, this, &VToolDetail::FullUpdateFromGuiOk);
|
|
||||||
VDetail detail = VAbstractTool::data.GetDetail(id);
|
|
||||||
qobject_cast<DialogPatternPieceData*>(dialog)->SetDetail(detail);
|
|
||||||
dialog->show();
|
|
||||||
}
|
|
||||||
else if (selectedAction == actionRemove)
|
else if (selectedAction == actionRemove)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue
Block a user