diff --git a/src/app/valentina/dialogs/dialogpatternproperties.cpp b/src/app/valentina/dialogs/dialogpatternproperties.cpp index 3b428f707..5cd288afb 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.cpp +++ b/src/app/valentina/dialogs/dialogpatternproperties.cpp @@ -71,8 +71,6 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pat { ui->setupUi(this); - ui->lineEditAuthor->setClearButtonEnabled(true); - SCASSERT(doc != nullptr) qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c()); @@ -99,9 +97,6 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pat ui->pushButtonShowInExplorer->setText(tr("Show in Finder")); #endif //defined(Q_OS_MAC) - ui->lineEditAuthor->setText(doc->GetAuthor()); - connect(ui->lineEditAuthor, &QLineEdit::editingFinished, this, &DialogPatternProperties::DescEdited); - ui->plainTextEditDescription->setPlainText(doc->GetDescription()); connect(ui->plainTextEditDescription, &QPlainTextEdit::textChanged, this, &DialogPatternProperties::DescEdited); @@ -179,32 +174,11 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pat ui->lineEditPatternNumber->setText(doc->GetPatternNumber()); ui->lineEditCompanyName->setText(doc->GetCompanyName()); ui->lineEditCustomerName->setText(doc->GetCustomerName()); - ui->checkBoxShowDate->setText(ui->checkBoxShowDate->text() - .arg(QDate::currentDate().toString(Qt::SystemLocaleLongDate))); - ui->lineEditSize->setText(doc->GetPatternSize()); - - const QString plSize = QLatin1String("%") + qApp->TrVars()->PlaceholderToUser(pl_size) + QLatin1String("%"); - const QString plHeight = QLatin1String("%") + qApp->TrVars()->PlaceholderToUser(pl_height) + QLatin1String("%"); - ui->lineEditSize->setToolTip(tr("Use %1 and %2 to insert pattern size and height").arg(plSize, plHeight)); - - ui->checkBoxShowDate->setChecked(doc->IsDateVisible()); - if (doc->MPath().isEmpty() == true) - { - ui->checkBoxShowMeasurements->setChecked(false); - ui->checkBoxShowMeasurements->setEnabled(false); - } - else - { - ui->checkBoxShowMeasurements->setChecked(doc->IsMeasurementsVisible()); - } connect(ui->lineEditPatternName, &QLineEdit::editingFinished, this, &DialogPatternProperties::LabelDataChanged); connect(ui->lineEditPatternNumber, &QLineEdit::editingFinished, this, &DialogPatternProperties::LabelDataChanged); connect(ui->lineEditCompanyName, &QLineEdit::editingFinished, this, &DialogPatternProperties::LabelDataChanged); connect(ui->lineEditCustomerName, &QLineEdit::editingFinished, this, &DialogPatternProperties::LabelDataChanged); - connect(ui->lineEditSize, &QLineEdit::editingFinished, this, &DialogPatternProperties::LabelDataChanged); - connect(ui->checkBoxShowDate, &QCheckBox::stateChanged, this, &DialogPatternProperties::LabelDataChanged); - connect(ui->checkBoxShowMeasurements, &QCheckBox::stateChanged, this, &DialogPatternProperties::LabelDataChanged); connect(ui->pushButtonEditPatternLabel, &QPushButton::clicked, this, &DialogPatternProperties::EditLabel); } @@ -538,7 +512,6 @@ void DialogPatternProperties::SaveDescription() { doc->SetNotes(ui->plainTextEditTechNotes->document()->toPlainText()); doc->SetDescription(ui->plainTextEditDescription->document()->toPlainText()); - doc->SetAuthor(ui->lineEditAuthor->text()); descriptionChanged = false; emit doc->patternChanged(false); @@ -587,9 +560,6 @@ void DialogPatternProperties::SaveLabelData() doc->SetPatternNumber(ui->lineEditPatternNumber->text()); doc->SetCompanyName(ui->lineEditCompanyName->text()); doc->SetCustomerName(ui->lineEditCustomerName->text()); - doc->SetPatternSize(ui->lineEditSize->text()); - doc->SetDateVisible(ui->checkBoxShowDate->isChecked()); - doc->SetMesurementsVisible(ui->checkBoxShowMeasurements->isChecked()); labelDataChanged = false; askSaveLabelData = false; diff --git a/src/app/valentina/dialogs/dialogpatternproperties.ui b/src/app/valentina/dialogs/dialogpatternproperties.ui index cf5244d3d..e9eb41b53 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.ui +++ b/src/app/valentina/dialogs/dialogpatternproperties.ui @@ -21,7 +21,7 @@ - 0 + 3 @@ -80,20 +80,6 @@ - - - - - - Author: - - - - - - - - @@ -1313,37 +1299,9 @@ - - - - Pattern size: - - - - - - - 40 - - - - - - - Show date of layout creation (%1) - - - - - - - Show measurements file - - - diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 733ee5cb7..a2f20c1d8 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -106,7 +106,6 @@ void VPattern::CreateEmptyFile() unit.appendChild(newNodeText); patternElement.appendChild(unit); - patternElement.appendChild(createElement(TagAuthor)); patternElement.appendChild(createElement(TagDescription)); patternElement.appendChild(createElement(TagNotes)); @@ -149,10 +148,10 @@ void VPattern::Parse(const Document &parse) SCASSERT(sceneDraw != nullptr) SCASSERT(sceneDetail != nullptr) - QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes + QStringList tags = QStringList() << TagDraw << TagIncrements << TagDescription << TagNotes << TagMeasurements << TagVersion << TagGradation << TagImage << TagUnit << TagPatternName << TagPatternNum << TagCompanyName << TagCustomerName - << TagSize << TagShowDate << TagShowMeasurements; + << TagPatternLabel; PrepareForParse(parse); QDomNode domNode = documentElement().firstChild(); while (domNode.isNull() == false) @@ -188,50 +187,41 @@ void VPattern::Parse(const Document &parse) qCDebug(vXML, "Tag increments."); ParseIncrementsElement(domElement); break; - case 2: // TagAuthor - qCDebug(vXML, "Tag author."); - break; - case 3: // TagDescription + case 2: // TagDescription qCDebug(vXML, "Tag description."); break; - case 4: // TagNotes + case 3: // TagNotes qCDebug(vXML, "Tag notes."); break; - case 5: // TagMeasurements + case 4: // TagMeasurements qCDebug(vXML, "Tag measurements."); break; - case 6: // TagVersion + case 5: // TagVersion qCDebug(vXML, "Tag version."); break; - case 7: // TagGradation + case 6: // TagGradation qCDebug(vXML, "Tag gradation."); break; - case 8: // TagImage + case 7: // TagImage qCDebug(vXML, "Tag image."); break; - case 9: // TagUnit + case 8: // TagUnit qCDebug(vXML, "Tag unit."); break; - case 10: // TagPatternName + case 9: // TagPatternName qCDebug(vXML, "Pattern name."); break; - case 11: // TagPatternNumber + case 10: // TagPatternNumber qCDebug(vXML, "Pattern number."); break; - case 12: // TagCompanyName + case 11: // TagCompanyName qCDebug(vXML, "Company name."); break; - case 13: // TagCustomerName + case 12: // TagCustomerName qCDebug(vXML, "Customer name."); break; - case 14: // TagSize - qCDebug(vXML, "Size"); - break; - case 15: - qCDebug(vXML, "Show creation date"); - break; - case 16: - qCDebug(vXML, "Show measurements"); + case 13: // TagPatternLabel + qCDebug(vXML, "Pattern label."); break; default: qCDebug(vXML, "Wrong tag name %s", qUtf8Printable(domElement.tagName())); @@ -3393,21 +3383,6 @@ void VPattern::ParseIncrementsElement(const QDomNode &node) } } -//--------------------------------------------------------------------------------------------------------------------- -QString VPattern::GetAuthor() const -{ - return UniqueTagText(TagAuthor, qApp->ValentinaSettings()->GetUser()); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPattern::SetAuthor(const QString &text) -{ - CheckTagExists(TagAuthor); - setTagText(TagAuthor, text); - modified = true; - emit patternChanged(false); -} - //--------------------------------------------------------------------------------------------------------------------- void VPattern::AddEmptyIncrement(const QString &name) { diff --git a/src/app/valentina/xml/vpattern.h b/src/app/valentina/xml/vpattern.h index 2ce56e4e6..c0daab674 100644 --- a/src/app/valentina/xml/vpattern.h +++ b/src/app/valentina/xml/vpattern.h @@ -66,9 +66,6 @@ public: QRectF ActiveDrawBoundingRect() const; - QString GetAuthor() const; - void SetAuthor(const QString &text); - void AddEmptyIncrement(const QString &name); void AddEmptyIncrementAfter(const QString &after, const QString &name); void RemoveIncrement(const QString &name); diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index d2d9480cf..51ca35345 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -59,7 +59,6 @@ const QString VAbstractPattern::TagCalculation = QStringLiteral("calculatio const QString VAbstractPattern::TagModeling = QStringLiteral("modeling"); const QString VAbstractPattern::TagDetails = QStringLiteral("details"); const QString VAbstractPattern::TagDetail = QStringLiteral("detail"); -const QString VAbstractPattern::TagAuthor = QStringLiteral("author"); const QString VAbstractPattern::TagDescription = QStringLiteral("description"); const QString VAbstractPattern::TagNotes = QStringLiteral("notes"); const QString VAbstractPattern::TagImage = QStringLiteral("image"); @@ -88,9 +87,6 @@ const QString VAbstractPattern::TagPatternNum = QStringLiteral("patternNum const QString VAbstractPattern::TagCustomerName = QStringLiteral("customer"); const QString VAbstractPattern::TagCompanyName = QStringLiteral("company"); const QString VAbstractPattern::TagPatternLabel = QStringLiteral("patternLabel"); -const QString VAbstractPattern::TagSize = QStringLiteral("size"); -const QString VAbstractPattern::TagShowDate = QStringLiteral("showDate"); -const QString VAbstractPattern::TagShowMeasurements = QStringLiteral("showMeasurements"); const QString VAbstractPattern::TagGrainline = QStringLiteral("grainline"); const QString VAbstractPattern::TagPath = QStringLiteral("path"); const QString VAbstractPattern::TagNodes = QStringLiteral("nodes"); @@ -1332,51 +1328,6 @@ void VAbstractPattern::SetCustomerName(const QString& qsName) emit patternChanged(false); } -//--------------------------------------------------------------------------------------------------------------------- -QString VAbstractPattern::GetPatternSize() const -{ - return UniqueTagText(TagSize); -} - -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractPattern::SetPatternSize(const QString& qsSize) -{ - CheckTagExists(TagSize); - setTagText(TagSize, qsSize); - modified = true; - emit patternChanged(false); -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VAbstractPattern::IsDateVisible() const -{ - return UniqueTagText(TagShowDate) != falseStr; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractPattern::SetDateVisible(bool bVisible) -{ - CheckTagExists(TagShowDate); - setTagText(TagShowDate, bVisible == true? trueStr : falseStr); - modified = true; - emit patternChanged(false); -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VAbstractPattern::IsMeasurementsVisible() const -{ - return UniqueTagText(TagShowMeasurements) == trueStr; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VAbstractPattern::SetMesurementsVisible(bool bVisible) -{ - CheckTagExists(TagShowMeasurements); - setTagText(TagShowMeasurements, bVisible == true? trueStr : falseStr); - modified = true; - emit patternChanged(false); -} - //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::SetPatternLabelTemplate(const QVector &lines) { @@ -1556,25 +1507,21 @@ QDomElement VAbstractPattern::CheckTagExists(const QString &tag) QDomElement element; if (list.isEmpty()) { - const QStringList tags = QStringList() << TagUnit << TagImage << TagAuthor << TagDescription << TagNotes + const QStringList tags = QStringList() << TagUnit << TagImage << TagDescription << TagNotes << TagGradation << TagPatternName << TagPatternNum << TagCompanyName - << TagCustomerName << TagPatternLabel << TagSize << TagShowDate - << TagShowMeasurements; + << TagCustomerName << TagPatternLabel; switch (tags.indexOf(tag)) { case 1: //TagImage element = createElement(TagImage); break; - case 2: //TagAuthor - element = createElement(TagAuthor); - break; - case 3: //TagDescription + case 2: //TagDescription element = createElement(TagDescription); break; - case 4: //TagNotes + case 3: //TagNotes element = createElement(TagNotes); break; - case 5: //TagGradation + case 4: //TagGradation { element = createElement(TagGradation); @@ -1587,30 +1534,21 @@ QDomElement VAbstractPattern::CheckTagExists(const QString &tag) element.appendChild(sizes); break; } - case 6: // TagPatternName + case 5: // TagPatternName element = createElement(TagPatternName); break; - case 7: // TagPatternNum + case 6: // TagPatternNum element = createElement(TagPatternNum); break; - case 8: // TagCompanyName + case 7: // TagCompanyName element = createElement(TagCompanyName); break; - case 9: // TagCustomerName + case 8: // TagCustomerName element = createElement(TagCustomerName); break; - case 10: // TagPatternLabel + case 9: // TagPatternLabel element = createElement(TagPatternLabel); break; - case 11: // TagSize - element = createElement(TagSize); - break; - case 12: // TagShowDate - element = createElement(TagShowDate); - break; - case 13: // TagShowMeasurements - element = createElement(TagShowMeasurements); - break; case 0: //TagUnit (Mandatory tag) default: return QDomElement(); diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 65cbf2da9..7b85bc2a4 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -147,12 +147,6 @@ public: void SetPatternNumber(const QString &qsNum); QString GetCustomerName() const; void SetCustomerName(const QString& qsName); - QString GetPatternSize() const; - void SetPatternSize(const QString &qsSize); - bool IsDateVisible() const; - void SetDateVisible(bool bVisible); - bool IsMeasurementsVisible() const; - void SetMesurementsVisible(bool bVisible); void SetPatternLabelTemplate(const QVector &lines); QVector GetPatternLabelTemplate() const; @@ -187,7 +181,6 @@ public: static const QString TagModeling; static const QString TagDetails; static const QString TagDetail; - static const QString TagAuthor; static const QString TagDescription; static const QString TagImage; static const QString TagNotes; @@ -216,9 +209,6 @@ public: static const QString TagCompanyName; static const QString TagCustomerName; static const QString TagPatternLabel; - static const QString TagSize; - static const QString TagShowDate; - static const QString TagShowMeasurements; static const QString TagGrainline; static const QString TagPath; static const QString TagNodes;