From 2efe887cad36697bedee423d7c711b1c43ba9135 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 3 May 2021 20:30:36 +0300 Subject: [PATCH 01/29] Separate script for travis deployment. Check status after each command call. Travis has habit to silent errors in the python script. --- .travis.yml | 13 ++---------- scripts/travis-deploy.sh | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 scripts/travis-deploy.sh diff --git a/.travis.yml b/.travis.yml index eede29a3a..f431a9b85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -136,14 +136,5 @@ notifications: on_success: change on_failure: always after_success: -- | - if [[ "$DEPLOY" == "true" ]]; then - ../scripts/macfixqtdylibrpath.py $TRAVIS_BUILD_DIR/build/src/app/valentina/bin/Valentina.app; - if [[ "$LEGACY" = false ]]; then - tar -C $TRAVIS_BUILD_DIR/build/src/app/valentina/bin --exclude "*.DS_Store" -cvzf valentina-osx-${TRAVIS_COMMIT}.tar.gz Valentina.app/; - python3 $TRAVIS_BUILD_DIR/scripts/deploy.py upload $ACCESS_TOKEN $TRAVIS_BUILD_DIR/build/valentina-osx-${TRAVIS_COMMIT}.tar.gz "/0.7.x/Mac OS X/valentina-osx-${TRAVIS_COMMIT}.tar.xz"; - else - tar -C $TRAVIS_BUILD_DIR/build/src/app/valentina/bin --exclude "*.DS_Store" -cvzf valentina-osx-${TRAVIS_COMMIT}-legacy.tar.gz Valentina.app/; - python3 $TRAVIS_BUILD_DIR/scripts/deploy.py upload $ACCESS_TOKEN $TRAVIS_BUILD_DIR/build/valentina-osx-${TRAVIS_COMMIT}-legacy.tar.gz "/0.7.x/Mac OS X/valentina-osx-${TRAVIS_COMMIT}-legacy.tar.xz"; - fi - fi +- ../scripts/travis-deploy.sh + diff --git a/scripts/travis-deploy.sh b/scripts/travis-deploy.sh new file mode 100644 index 000000000..39e297c0e --- /dev/null +++ b/scripts/travis-deploy.sh @@ -0,0 +1,43 @@ +print_error() { + echo "[CI] ERROR: $1" +} + + +print_info() { + echo "[CI] INFO: $1" +} + + +check_failure() { + if [ $? -ne 0 ] ; then + if [ -z $1 ] ; then + print_error $1 + else + print_error "Failure exit code is detected." + fi + exit 1 + fi +} + +if [[ "$DEPLOY" == "true" ]]; then + ../scripts/macfixqtdylibrpath.py $TRAVIS_BUILD_DIR/build/src/app/valentina/bin/Valentina.app; + check_failure "Unable to patch the app bundle."; + + if [[ "$LEGACY" = false ]]; then + legacy_suffix = "" + else + legacy_suffix = "-legacy" + fi + + print_info "Start compressing."; + tar -C $TRAVIS_BUILD_DIR/build/src/app/valentina/bin --exclude "*.DS_Store" -cvJf valentina-osx-${TRAVIS_COMMIT}${legacy_suffix}.tar.xz Valentina.app/; + check_failure "Unable to create an archive."; + + print_info "Start uploading."; + python3 $TRAVIS_BUILD_DIR/scripts/deploy.py upload $ACCESS_TOKEN $TRAVIS_BUILD_DIR/build/valentina-osx-${TRAVIS_COMMIT}${legacy_suffix}.tar.xz "/0.7.x/Mac OS X/valentina-osx-${TRAVIS_COMMIT}${legacy_suffix}.tar.xz"; + check_failure "Unable to upload."; + + print_info "Successfully uploaded."; +else + print_info "No deployment needed."; +fi From abdebbbfaa129f1867a8e3c00847c24436baa524 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 5 May 2021 18:53:15 +0300 Subject: [PATCH 02/29] Fix correct handle a final measurement formula error when exporting a pattern recipe. Valentina must not crash. --- ChangeLog.txt | 1 + src/app/valentina/mainwindow.cpp | 16 ++++++++++++---- src/libs/ifc/exception/vexception.cpp | 2 +- src/libs/ifc/exception/vexception.h | 2 +- src/libs/vformat/vpatternrecipe.cpp | 27 ++++++++++++++++++--------- 5 files changed, 33 insertions(+), 15 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0d70c9784..f9e4d6705 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -8,6 +8,7 @@ - Remember last selected export format. - [smart-pattern/valentina#123] Error inside Save layout dialog. - Improve error handling for the dxf export. +- Fix correct handle a final measurement formula error when exporting a pattern recipe. # Version 0.7.46 Mar 31, 2021 - Fix incorrect calculation of value for multisize measurements in Valentina. diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 55bdf85c5..e6dd9659a 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -34,6 +34,7 @@ #include "../ifc/exception/vexceptionemptyparameter.h" #include "../ifc/exception/vexceptionwrongid.h" #include "../ifc/exception/vexceptionundo.h" +#include "../ifc/exception/vexceptioninvalidhistory.h" #include "version.h" #include "core/vapplication.h" #include "../vmisc/customevents.h" @@ -4819,11 +4820,18 @@ void MainWindow::CreateActions() return; } - VPatternRecipe recipe(doc); - QString error; - if (not recipe.SaveDocument(fileName, error)) + try { - qCWarning(vMainWindow, "%s", qUtf8Printable(tr("Could not save recipe. %1").arg(error))); + VPatternRecipe recipe(doc); + QString error; + if (not recipe.SaveDocument(fileName, error)) + { + qCWarning(vMainWindow, "%s", qUtf8Printable(tr("Could not save recipe. %1").arg(error))); + } + } + catch (const VExceptionInvalidHistory &e) + { + qCCritical(vMainWindow, "%s", qUtf8Printable(tr("Could not create recipe file. %1").arg(e.ErrorMessage()))); } }); diff --git a/src/libs/ifc/exception/vexception.cpp b/src/libs/ifc/exception/vexception.cpp index cbd5de0bb..e7c4364d3 100644 --- a/src/libs/ifc/exception/vexception.cpp +++ b/src/libs/ifc/exception/vexception.cpp @@ -41,7 +41,7 @@ * @param error string with error */ VException::VException(const QString &error) V_NOEXCEPT_EXPR (true) - :QException(), error(error), moreInfo(QString()) + : error(error) { Q_ASSERT_X(not error.isEmpty(), Q_FUNC_INFO, "Error message is empty"); } diff --git a/src/libs/ifc/exception/vexception.h b/src/libs/ifc/exception/vexception.h index 1ce4cb66d..6cdecf9a7 100644 --- a/src/libs/ifc/exception/vexception.h +++ b/src/libs/ifc/exception/vexception.h @@ -64,7 +64,7 @@ protected: QString error; /** @brief moreInfo more information about error */ - QString moreInfo; + QString moreInfo {}; QString MoreInfo(const QString &detInfo) const; }; diff --git a/src/libs/vformat/vpatternrecipe.cpp b/src/libs/vformat/vpatternrecipe.cpp index bfd036b68..241f9a99a 100644 --- a/src/libs/vformat/vpatternrecipe.cpp +++ b/src/libs/vformat/vpatternrecipe.cpp @@ -435,17 +435,26 @@ QDomElement VPatternRecipe::FinalMeasurement(const VFinalMeasurement &fm, const SetAttribute(recipeFinalMeasurement, QStringLiteral("formula"), fm.formula); // TODO: localize QScopedPointer cal(new Calculator()); - const qreal result = cal->EvalFormula(data.DataVariables(), fm.formula); - if (qIsInf(result) || qIsNaN(result)) + try { - const QString errorMsg = QString("%1\n\n%1").arg(tr("Reading final measurements error."), - tr("Value for final measurtement '%1' is infinite or NaN. " - "Please, check your calculations.").arg(fm.name)); - VAbstractApplication::VApp()->IsPedantic() ? throw VException(errorMsg) : - qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; - } + const qreal result = cal->EvalFormula(data.DataVariables(), fm.formula); + if (qIsInf(result) || qIsNaN(result)) + { + const QString errorMsg = QString("%1\n\n%1").arg(tr("Reading final measurements error."), + tr("Value for final measurtement '%1' is infinite or NaN. " + "Please, check your calculations.").arg(fm.name)); + VAbstractApplication::VApp()->IsPedantic() ? throw VException(errorMsg) + : qWarning() + << VAbstractValApplication::warningMessageSignature + errorMsg; + } - SetAttribute(recipeFinalMeasurement, QStringLiteral("value"), result); + SetAttribute(recipeFinalMeasurement, QStringLiteral("value"), result); + } + catch (const qmu::QmuParserError &e) + { + throw VExceptionInvalidHistory(tr("Unable to create record for final measurement '%1'. Error: %2") + .arg(fm.name).arg(e.GetMsg())); + } return recipeFinalMeasurement; } From 69da5ba9b7716ec932a36f648e78a5097c9cfe00 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 7 May 2021 11:19:06 +0300 Subject: [PATCH 03/29] Fix regression. Incorrect data caching. --- ChangeLog.txt | 1 + src/app/tape/tmainwindow.cpp | 12 +- src/app/valentina/mainwindow.cpp | 8 +- src/app/valentina/xml/vpattern.cpp | 3 + src/libs/ifc/xml/vabstractmconverter.cpp | 13 ++ src/libs/ifc/xml/vabstractmconverter.h | 2 + src/libs/ifc/xml/vabstractpattern.cpp | 178 +++++++++++++--------- src/libs/ifc/xml/vabstractpattern.h | 21 ++- src/libs/ifc/xml/vdomdocument.cpp | 18 --- src/libs/ifc/xml/vdomdocument.h | 2 - src/libs/ifc/xml/vvstconverter.cpp | 2 +- src/libs/vformat/vmeasurements.cpp | 184 +++++++++++++---------- src/libs/vformat/vmeasurements.h | 12 +- src/libs/vmisc/literals.cpp | 1 - src/libs/vmisc/literals.h | 1 - 15 files changed, 275 insertions(+), 183 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f9e4d6705..440092ec2 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -9,6 +9,7 @@ - [smart-pattern/valentina#123] Error inside Save layout dialog. - Improve error handling for the dxf export. - Fix correct handle a final measurement formula error when exporting a pattern recipe. +- Fix regression. Incorrect data caching. # Version 0.7.46 Mar 31, 2021 - Fix incorrect calculation of value for multisize measurements in Valentina. diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 53c89fddd..e93e86962 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -332,7 +332,7 @@ bool TMainWindow::LoadFile(const QString &path) throw VException(tr("File contains invalid known measurement(s).")); } - mUnit = m->MUnit(); + mUnit = m->Units(); pUnit = mUnit; currentDimensionA = m->DimensionABase(); @@ -2672,7 +2672,7 @@ void TMainWindow::InitMenu() void TMainWindow::InitDimensionsBaseValue() { const QList dimensions = m->Dimensions().values(); - const QString unit = UnitsToStr(m->MUnit(), true); + const QString unit = UnitsToStr(m->Units(), true); const bool fc = m->IsFullCircumference(); auto DimensionsBaseValue = [this, dimensions, unit, fc](int index, QLabel *name, QLabel *base) @@ -2726,7 +2726,7 @@ void TMainWindow::InitDimensionGradation(int index, const MeasurementDimension_p SCASSERT(control != nullptr) const bool fc = m->IsFullCircumference(); - const QString unit = UnitsToStr(m->MUnit(), true); + const QString unit = UnitsToStr(m->Units(), true); qreal current = -1; if (control->currentIndex() != -1) @@ -2811,7 +2811,7 @@ void TMainWindow::InitDimensionGradation(int index, const MeasurementDimension_p void TMainWindow::InitDimensionControls() { const QList dimensions = m->Dimensions().values(); - const QString unit = UnitsToStr(m->MUnit(), true); + const QString unit = UnitsToStr(m->Units(), true); auto InitControl = [this, dimensions, unit](int index, QLabel *&name, QComboBox *&control) { @@ -3574,7 +3574,7 @@ bool TMainWindow::LoadFromExistingFile(const QString &path) throw VException(tr("File contains invalid known measurement(s).")); } - mUnit = m->MUnit(); + mUnit = m->Units(); pUnit = mUnit; currentDimensionA = m->DimensionABase(); @@ -4358,7 +4358,7 @@ void TMainWindow::InitMeasurementUnits() } QString units; - switch (m->MUnit()) + switch (m->Units()) { case Unit::Mm: units = tr("Millimeters"); diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index e6dd9659a..943114667 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -2064,7 +2064,7 @@ void MainWindow::CleanWaterkmarkEditors() //--------------------------------------------------------------------------------------------------------------------- void MainWindow::StoreMultisizeMDimensions() { - VAbstractValApplication::VApp()->SetMeasurementsUnits(m->MUnit()); + VAbstractValApplication::VApp()->SetMeasurementsUnits(m->Units()); QList dimensions = m->Dimensions().values(); @@ -2090,7 +2090,7 @@ void MainWindow::StoreMultisizeMDimensions() labels.value(currentBase, QString::number(fc ? currentBase*2 : currentBase))); const bool circumference = dimension->IsCircumference(); VAbstractValApplication::VApp() - ->SetDimensionSizeUnits(circumference ? m->MUnit() : Unit::LAST_UNIT_DO_NOT_USE); + ->SetDimensionSizeUnits(circumference ? m->Units() : Unit::LAST_UNIT_DO_NOT_USE); break; } case MeasurementDimension::W: @@ -5197,7 +5197,7 @@ bool MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile) { doc->SetMPath(RelativeMPath(fileName, customMeasureFile)); } - VAbstractValApplication::VApp()->SetPatternUnits(doc->MUnit()); + VAbstractValApplication::VApp()->SetPatternUnits(doc->Units()); QString path = AbsoluteMPath(fileName, doc->MPath()); QString fixedMPath; @@ -5284,7 +5284,7 @@ bool MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile) { doc->SetMPath(RelativeMPath(fileName, fixedMPath)); } - VAbstractValApplication::VApp()->SetPatternUnits(doc->MUnit()); + VAbstractValApplication::VApp()->SetPatternUnits(doc->Units()); } } catch (VException &e) diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 7ff6d238d..b59489571 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -141,6 +141,9 @@ void VPattern::CreateEmptyFile() insertBefore(createProcessingInstruction(QStringLiteral("xml"), QStringLiteral("version=\"1.0\" encoding=\"UTF-8\"")), this->firstChild()); + + // Cache values + m_units = VAbstractValApplication::VApp()->patternUnits(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/ifc/xml/vabstractmconverter.cpp b/src/libs/ifc/xml/vabstractmconverter.cpp index 2ec8fdc23..1cfb68bc2 100644 --- a/src/libs/ifc/xml/vabstractmconverter.cpp +++ b/src/libs/ifc/xml/vabstractmconverter.cpp @@ -41,6 +41,19 @@ VAbstractMConverter::VAbstractMConverter(const QString &fileName) { } +//--------------------------------------------------------------------------------------------------------------------- +auto VAbstractMConverter::Units() const -> Unit +{ + Unit units = StrToUnits(UniqueTagText(TagUnit, unitCM)); + + if (units == Unit::Px) + { + units = Unit::Cm; + } + + return units; +} + //--------------------------------------------------------------------------------------------------------------------- void VAbstractMConverter::AddRootComment() { diff --git a/src/libs/ifc/xml/vabstractmconverter.h b/src/libs/ifc/xml/vabstractmconverter.h index 77e3d226c..a45f343de 100644 --- a/src/libs/ifc/xml/vabstractmconverter.h +++ b/src/libs/ifc/xml/vabstractmconverter.h @@ -43,6 +43,8 @@ public: explicit VAbstractMConverter(const QString &fileName); virtual ~VAbstractMConverter() Q_DECL_EQ_DEFAULT; + auto Units() const -> Unit; + protected: void AddRootComment(); static QMultiMap OldNamesToNewNames_InV0_3_0(); diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index a9fc274db..1507381da 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -155,14 +155,6 @@ bool VAbstractPattern::patternLabelWasChanged = false; namespace { -// Need to be reinited in setXMLContent as well -Q_GLOBAL_STATIC_WITH_ARGS(QString, patternNumberCached, (unknownCharacter)) -Q_GLOBAL_STATIC_WITH_ARGS(QString, labelDateFormatCached, (unknownCharacter)) -Q_GLOBAL_STATIC_WITH_ARGS(QString, patternNameCached, (unknownCharacter)) -Q_GLOBAL_STATIC_WITH_ARGS(QString, MPathCached, (unknownCharacter)) -Q_GLOBAL_STATIC_WITH_ARGS(QString, WatermarkPathCached, (unknownCharacter)) -Q_GLOBAL_STATIC_WITH_ARGS(QString, companyNameCached, (unknownCharacter)) - void ReadExpressionAttribute(QVector &expressions, const QDomElement &element, const QString &attribute) { VFormulaField formula; @@ -592,17 +584,26 @@ void VAbstractPattern::setXMLContent(const QString &fileName) { Clear(); VDomDocument::setXMLContent(fileName); + m_patternNumber = ReadPatternNumber(); + m_labelDateFormat = ReadLabelDateFormat(); + m_patternName = ReadPatternName(); + m_MPath = ReadMPath(); + m_watermarkPath = ReadWatermarkPath(); + m_companyName = ReadCompanyName(); + m_units = ReadUnits(); } //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::Clear() { clear(); - *patternNumberCached = unknownCharacter; - *labelDateFormatCached = unknownCharacter; - *patternNameCached = unknownCharacter; - *MPathCached = unknownCharacter; - *companyNameCached = unknownCharacter; + m_patternNumber.clear(); + m_labelDateFormat.clear(); + m_patternName.clear(); + m_MPath.clear(); + m_watermarkPath.clear(); + m_companyName.clear(); + m_units = Unit::LAST_UNIT_DO_NOT_USE; } //--------------------------------------------------------------------------------------------------------------------- @@ -820,11 +821,7 @@ QVector VAbstractPattern::getLocalHistory() const //--------------------------------------------------------------------------------------------------------------------- QString VAbstractPattern::MPath() const { - if (*MPathCached == unknownCharacter) - { - *MPathCached = UniqueTagText(TagMeasurements); - } - return *MPathCached; + return m_MPath; } //--------------------------------------------------------------------------------------------------------------------- @@ -832,9 +829,10 @@ void VAbstractPattern::SetMPath(const QString &path) { if (setTagText(TagMeasurements, path)) { - emit patternChanged(false); + m_MPath = path; patternLabelWasChanged = true; - *MPathCached = path; + modified = true; + emit patternChanged(false); } else { @@ -932,19 +930,15 @@ void VAbstractPattern::SetNotes(const QString &text) //--------------------------------------------------------------------------------------------------------------------- QString VAbstractPattern::GetPatternName() const { - if (*patternNameCached == unknownCharacter) - { - *patternNameCached = UniqueTagText(TagPatternName); - } - return *patternNameCached; + return m_patternName; } //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::SetPatternName(const QString &qsName) { - *patternNameCached = qsName; + m_patternName = qsName; CheckTagExists(TagPatternName); - setTagText(TagPatternName, *patternNameCached); + setTagText(TagPatternName, m_patternName); patternLabelWasChanged = true; modified = true; emit patternChanged(false); @@ -953,19 +947,15 @@ void VAbstractPattern::SetPatternName(const QString &qsName) //--------------------------------------------------------------------------------------------------------------------- QString VAbstractPattern::GetCompanyName() const { - if (*companyNameCached == unknownCharacter) - { - *companyNameCached = UniqueTagText(TagCompanyName); - } - return *companyNameCached; + return m_companyName; } //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::SetCompanyName(const QString& qsName) { - *companyNameCached = qsName; + m_companyName = qsName; CheckTagExists(TagCompanyName); - setTagText(TagCompanyName, *companyNameCached); + setTagText(TagCompanyName, m_companyName); patternLabelWasChanged = true; modified = true; emit patternChanged(false); @@ -974,19 +964,15 @@ void VAbstractPattern::SetCompanyName(const QString& qsName) //--------------------------------------------------------------------------------------------------------------------- QString VAbstractPattern::GetPatternNumber() const { - if (*patternNumberCached == unknownCharacter) - { - *patternNumberCached = UniqueTagText(TagPatternNum); - } - return *patternNumberCached; + return m_patternNumber; } //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::SetPatternNumber(const QString& qsNum) { - *patternNumberCached = qsNum; + m_patternNumber = qsNum; CheckTagExists(TagPatternNum); - setTagText(TagPatternNum, *patternNumberCached); + setTagText(TagPatternNum, m_patternNumber); patternLabelWasChanged = true; modified = true; emit patternChanged(false); @@ -1043,34 +1029,15 @@ void VAbstractPattern::SetCustomerEmail(const QString &email) //--------------------------------------------------------------------------------------------------------------------- QString VAbstractPattern::GetLabelDateFormat() const { - if (*labelDateFormatCached == unknownCharacter) - { - const QString globalLabelDateFormat = VAbstractApplication::VApp()->Settings()->GetLabelDateFormat(); - - const QDomNodeList list = elementsByTagName(TagPatternLabel); - if (list.isEmpty()) - { - return globalLabelDateFormat; - } - - try - { - *labelDateFormatCached = GetParametrString(list.at(0).toElement(), AttrDateFormat); - } - catch (const VExceptionEmptyParameter &) - { - return globalLabelDateFormat; - } - } - return *labelDateFormatCached; + return m_labelDateFormat; } //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::SetLabelDateFormat(const QString &format) { - *labelDateFormatCached = format; + m_labelDateFormat = format; QDomElement tag = CheckTagExists(TagPatternLabel); - SetAttribute(tag, AttrDateFormat, *labelDateFormatCached); + SetAttribute(tag, AttrDateFormat, m_labelDateFormat); patternLabelWasChanged = true; modified = true; emit patternChanged(false); @@ -1142,7 +1109,8 @@ bool VAbstractPattern::SetWatermarkPath(const QString &path) emit patternChanged(false); patternLabelWasChanged = true; - *WatermarkPathCached = path; + m_watermarkPath = path; + modified = true; return true; } else @@ -1151,7 +1119,8 @@ bool VAbstractPattern::SetWatermarkPath(const QString &path) { emit patternChanged(false); patternLabelWasChanged = true; - *WatermarkPathCached = path; + m_watermarkPath = path; + modified = true; return true; } else @@ -1165,11 +1134,7 @@ bool VAbstractPattern::SetWatermarkPath(const QString &path) //--------------------------------------------------------------------------------------------------------------------- QString VAbstractPattern::GetWatermarkPath() const { - if (*WatermarkPathCached == unknownCharacter) - { - *WatermarkPathCached = UniqueTagText(TagWatermark); - } - return *WatermarkPathCached; + return m_watermarkPath; } //--------------------------------------------------------------------------------------------------------------------- @@ -2277,6 +2242,73 @@ bool VAbstractPattern::GroupHasItem(const QDomElement &groupDomElement, quint32 return result; } +//--------------------------------------------------------------------------------------------------------------------- +auto VAbstractPattern::ReadUnits() const -> Unit +{ + Unit units = StrToUnits(UniqueTagText(TagUnit, unitCM)); + + if (units == Unit::Px) + { + units = Unit::Cm; + } + + return units; +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractPattern::ReadPatternNumber() const +{ + return UniqueTagText(TagPatternNum); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractPattern::ReadLabelDateFormat() const +{ + const QString globalLabelDateFormat = VAbstractApplication::VApp()->Settings()->GetLabelDateFormat(); + + const QDomNodeList list = elementsByTagName(TagPatternLabel); + if (list.isEmpty()) + { + return globalLabelDateFormat; + } + + QString labelDateFormat; + + try + { + labelDateFormat = GetParametrString(list.at(0).toElement(), AttrDateFormat); + } + catch (const VExceptionEmptyParameter &) + { + return globalLabelDateFormat; + } + return labelDateFormat; +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractPattern::ReadPatternName() const +{ + return UniqueTagText(TagPatternName); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractPattern::ReadMPath() const +{ + return UniqueTagText(TagMeasurements); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractPattern::ReadWatermarkPath() const +{ + return UniqueTagText(TagWatermark); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractPattern::ReadCompanyName() const +{ + return UniqueTagText(TagCompanyName); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief Adds an item to the given group with the given toolId and objectId @@ -2455,6 +2487,12 @@ VContainer VAbstractPattern::GetCompletePPData(const QString &name) const return VContainer(nullptr, nullptr, VContainer::UniqueNamespace()); } +//--------------------------------------------------------------------------------------------------------------------- +Unit VAbstractPattern::Units() const +{ + return m_units; +} + //--------------------------------------------------------------------------------------------------------------------- QStringList VAbstractPattern::FilterGroupTags(const QString &tags) { diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 668b35c98..5b580d732 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -233,6 +233,8 @@ public: virtual VContainer GetCompleteData() const; virtual VContainer GetCompletePPData(const QString &name) const; + auto Units() const -> Unit; + static const QString TagPattern; static const QString TagCalculation; static const QString TagModeling; @@ -396,6 +398,14 @@ protected: /** @brief modified keep state of the document for cases that do not cover QUndoStack*/ mutable bool modified; + Unit m_units{Unit::LAST_UNIT_DO_NOT_USE}; + QString m_patternNumber{}; + QString m_labelDateFormat{}; + QString m_patternName{}; + QString m_MPath{}; + QString m_watermarkPath{}; + QString m_companyName{}; + /** @brief tools list with pointer on tools. */ static QHash tools; /** @brief patternLabelLines list to speed up reading a template by many pieces. */ @@ -420,7 +430,16 @@ protected: QVector getLocalHistory(const QString &draw) const; - bool GroupHasItem(const QDomElement &groupDomElement, quint32 toolId, quint32 objectId); + bool GroupHasItem(const QDomElement &groupDomElement, quint32 toolId, quint32 objectId); + + auto ReadUnits() const -> Unit; + auto ReadPatternNumber() const ->QString; + auto ReadLabelDateFormat() const ->QString; + auto ReadPatternName() const ->QString; + auto ReadMPath() const ->QString; + auto ReadWatermarkPath() const -> QString; + auto ReadCompanyName() const -> QString; + private: Q_DISABLE_COPY(VAbstractPattern) diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index 2d3efa581..b4394eecd 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -232,8 +232,6 @@ bool LessThen(const QDomNode &element1, const QDomNode &element2) } return false; } - -Unit mUnitCached = Unit::LAST_UNIT_DO_NOT_USE; } // namespace Q_LOGGING_CATEGORY(vXML, "v.xml") @@ -636,22 +634,6 @@ quint32 VDomDocument::GetParametrId(const QDomElement &domElement) return id; } -//--------------------------------------------------------------------------------------------------------------------- -Unit VDomDocument::MUnit() const -{ - if (mUnitCached == Unit::LAST_UNIT_DO_NOT_USE) - { - mUnitCached = StrToUnits(UniqueTagText(TagUnit, unitCM)); - - if (mUnitCached == Unit::Px) - { - mUnitCached = Unit::Cm; - } - } - - return mUnitCached; -} - //--------------------------------------------------------------------------------------------------------------------- QString VDomDocument::UniqueTagText(const QString &tagName, const QString &defVal) const { diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index 238851546..97a5f0c57 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -118,8 +118,6 @@ public: static qreal GetParametrDouble(const QDomElement& domElement, const QString &name, const QString &defValue); static quint32 GetParametrId(const QDomElement& domElement); - Unit MUnit() const; - virtual void setXMLContent(const QString &fileName); static QString UnitsHelpString(); diff --git a/src/libs/ifc/xml/vvstconverter.cpp b/src/libs/ifc/xml/vvstconverter.cpp index c90ed01c9..34c2d9018 100644 --- a/src/libs/ifc/xml/vvstconverter.cpp +++ b/src/libs/ifc/xml/vvstconverter.cpp @@ -345,7 +345,7 @@ void VVSTConverter::AddNewTagsForV0_5_0() return GetParametrInt(baseTag, QStringLiteral("base"), QChar('0')); }; - const Unit units = MUnit(); + const Unit units = Units(); { const int step = static_cast(UnitConvertor(6, Unit::Cm, units)); diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp index 6ae147f8f..9f5feb51c 100644 --- a/src/libs/vformat/vmeasurements.cpp +++ b/src/libs/vformat/vmeasurements.cpp @@ -109,10 +109,7 @@ const QString VMeasurements::DimensionZ = QStringLiteral("z"); namespace { -using VDimensions = QMap; - Q_GLOBAL_STATIC_WITH_ARGS(const QString, defBirthDate, (QLatin1String("1800-01-01"))) -Q_GLOBAL_STATIC(VDimensions, dimensionsCached) //--------------------------------------------------------------------------------------------------------------------- QString FileComment() @@ -124,8 +121,7 @@ QString FileComment() //--------------------------------------------------------------------------------------------------------------------- VMeasurements::VMeasurements(VContainer *data) - :VDomDocument(), - data(data), + : data(data), type(MeasurementsType::Unknown) { SCASSERT(data != nullptr) @@ -133,8 +129,7 @@ VMeasurements::VMeasurements(VContainer *data) //--------------------------------------------------------------------------------------------------------------------- VMeasurements::VMeasurements(Unit unit, VContainer *data) - :VDomDocument(), - data(data), + : data(data), type(MeasurementsType::Individual) { SCASSERT(data != nullptr) @@ -145,9 +140,8 @@ VMeasurements::VMeasurements(Unit unit, VContainer *data) //--------------------------------------------------------------------------------------------------------------------- VMeasurements::VMeasurements(Unit unit, const QVector &dimensions, VContainer *data) - :VDomDocument(), - data(data), - type(MeasurementsType::Multisize) + : data(data), + type(MeasurementsType::Multisize) { SCASSERT(data != nullptr) @@ -159,6 +153,8 @@ void VMeasurements::setXMLContent(const QString &fileName) { VDomDocument::setXMLContent(fileName); type = ReadType(); + m_units = ReadUnits(); + m_dimensions = ReadDimensions(); } //--------------------------------------------------------------------------------------------------------------------- @@ -277,6 +273,12 @@ void VMeasurements::MoveBottom(const QString &name) } } +//--------------------------------------------------------------------------------------------------------------------- +auto VMeasurements::Units() const -> Unit +{ + return m_units; +} + //--------------------------------------------------------------------------------------------------------------------- void VMeasurements::StoreNames(bool store) { @@ -327,25 +329,25 @@ void VMeasurements::ReadMeasurements(qreal baseA, qreal baseB, qreal baseC) cons if (not specialUnits) { - base = UnitConvertor(base, MUnit(), *data->GetPatternUnit()); - shiftA = UnitConvertor(shiftA, MUnit(), *data->GetPatternUnit()); - shiftB = UnitConvertor(shiftB, MUnit(), *data->GetPatternUnit()); - shiftC = UnitConvertor(shiftC, MUnit(), *data->GetPatternUnit()); + base = UnitConvertor(base, Units(), *data->GetPatternUnit()); + shiftA = UnitConvertor(shiftA, Units(), *data->GetPatternUnit()); + shiftB = UnitConvertor(shiftB, Units(), *data->GetPatternUnit()); + shiftC = UnitConvertor(shiftC, Units(), *data->GetPatternUnit()); QMutableMapIterator iterator(corrections); while (iterator.hasNext()) { iterator.next(); - iterator.setValue(UnitConvertor(iterator.value(), MUnit(), *data->GetPatternUnit())); + iterator.setValue(UnitConvertor(iterator.value(), Units(), *data->GetPatternUnit())); } - convertedBaseA = UnitConvertor(convertedBaseA, MUnit(), *data->GetPatternUnit()); - convertedBaseB = UnitConvertor(convertedBaseB, MUnit(), *data->GetPatternUnit()); - convertedBaseC = UnitConvertor(convertedBaseC, MUnit(), *data->GetPatternUnit()); + convertedBaseA = UnitConvertor(convertedBaseA, Units(), *data->GetPatternUnit()); + convertedBaseB = UnitConvertor(convertedBaseB, Units(), *data->GetPatternUnit()); + convertedBaseC = UnitConvertor(convertedBaseC, Units(), *data->GetPatternUnit()); - convertedStepA = UnitConvertor(convertedStepA, MUnit(), *data->GetPatternUnit()); - convertedStepB = UnitConvertor(convertedStepB, MUnit(), *data->GetPatternUnit()); - convertedStepC = UnitConvertor(convertedStepC, MUnit(), *data->GetPatternUnit()); + convertedStepA = UnitConvertor(convertedStepA, Units(), *data->GetPatternUnit()); + convertedStepB = UnitConvertor(convertedStepB, Units(), *data->GetPatternUnit()); + convertedStepC = UnitConvertor(convertedStepC, Units(), *data->GetPatternUnit()); } meash = QSharedPointer::create(static_cast(i), name, @@ -380,7 +382,7 @@ void VMeasurements::ReadMeasurements(qreal baseA, qreal baseB, qreal baseC) cons if (not specialUnits) { - value = UnitConvertor(value, MUnit(), *data->GetPatternUnit()); + value = UnitConvertor(value, Units(), *data->GetPatternUnit()); } meash = QSharedPointer::create(data, static_cast(i), name, value, formula, ok); @@ -846,61 +848,9 @@ QString VMeasurements::MeasurementForDimension(IMD type) const } //--------------------------------------------------------------------------------------------------------------------- -auto VMeasurements::Dimensions() const -> QMap +auto VMeasurements::Dimensions() const -> VDimensions { - if (type != MeasurementsType::Multisize) - { - return QMap(); - } - - if (dimensionsCached->isEmpty()) - { - const Unit units = MUnit(); - const QDomNodeList list = elementsByTagName(TagDimension); - for (int i=0; i < list.size(); ++i) - { - const QDomElement dom = list.at(i).toElement(); - const MeasurementDimension type = StrToDimensionType(GetParametrString(dom, AttrType)); - const qreal min = GetParametrDouble(dom, AttrMin, QChar('0')); - const qreal max = GetParametrDouble(dom, AttrMax, QChar('0')); - const qreal step = GetParametrDouble(dom, AttrStep, QStringLiteral("-1")); - const qreal base = GetParametrDouble(dom, AttrBase, QChar('0')); - - const DimesionLabels labels = ReadDimensionLabels(dom); - - if (type == MeasurementDimension::X) - { - auto dimension = QSharedPointer::create(units, min, max, step); - dimension->SetBaseValue(base); - dimension->SetLabels(labels); - dimensionsCached->insert(type, dimension); - } - else if (type == MeasurementDimension::Y) - { - auto dimension = QSharedPointer::create(units, min, max, step); - dimension->SetBaseValue(base); - dimension->SetCircumference(GetParametrBool(dom, AttrCircumference, trueStr)); - dimension->SetLabels(labels); - dimensionsCached->insert(type, dimension); - } - else if (type == MeasurementDimension::W) - { - auto dimension = QSharedPointer::create(units, min, max, step); - dimension->SetBaseValue(base); - dimension->SetLabels(labels); - dimensionsCached->insert(type, dimension); - } - else if (type == MeasurementDimension::Z) - { - auto dimension = QSharedPointer::create(units, min, max, step); - dimension->SetBaseValue(base); - dimension->SetLabels(labels); - dimensionsCached->insert(type, dimension); - } - } - } - - return *dimensionsCached; + return m_dimensions; } //--------------------------------------------------------------------------------------------------------------------- @@ -976,7 +926,7 @@ void VMeasurements::SetDimensionLabels(const QMapclear(); // Invalidate cache + m_dimensions = ReadDimensions(); // Refresh cache } //--------------------------------------------------------------------------------------------------------------------- @@ -1187,6 +1137,10 @@ void VMeasurements::CreateEmptyMultisizeFile(Unit unit, this->appendChild(mElement); insertBefore(createProcessingInstruction(QStringLiteral("xml"), QStringLiteral("version=\"1.0\" encoding=\"UTF-8\"")), this->firstChild()); + + // Cache data + m_units = unit; + m_dimensions = ReadDimensions(); } //--------------------------------------------------------------------------------------------------------------------- @@ -1215,6 +1169,10 @@ void VMeasurements::CreateEmptyIndividualFile(Unit unit) this->appendChild(mElement); insertBefore(createProcessingInstruction(QStringLiteral("xml"), QStringLiteral("version=\"1.0\" encoding=\"UTF-8\"")), this->firstChild()); + + // Cache data + m_units = unit; + m_dimensions = ReadDimensions(); } //--------------------------------------------------------------------------------------------------------------------- @@ -1246,7 +1204,7 @@ QDomElement VMeasurements::CreateDimensions(const QVectorelementsByTagName(tag); if (nodeList.isEmpty()) @@ -1332,6 +1290,76 @@ MeasurementsType VMeasurements::ReadType() const } } +//--------------------------------------------------------------------------------------------------------------------- +auto VMeasurements::ReadUnits() const -> Unit +{ + Unit units = StrToUnits(UniqueTagText(TagUnit, unitCM)); + + if (units == Unit::Px) + { + units = Unit::Cm; + } + + return units; +} + +//--------------------------------------------------------------------------------------------------------------------- +auto VMeasurements::ReadDimensions() const -> VDimensions +{ + if (type != MeasurementsType::Multisize) + { + return {}; + } + + VDimensions dimensions; + + const Unit units = Units(); + const QDomNodeList list = elementsByTagName(TagDimension); + for (int i=0; i < list.size(); ++i) + { + const QDomElement dom = list.at(i).toElement(); + const MeasurementDimension type = StrToDimensionType(GetParametrString(dom, AttrType)); + const qreal min = GetParametrDouble(dom, AttrMin, QChar('0')); + const qreal max = GetParametrDouble(dom, AttrMax, QChar('0')); + const qreal step = GetParametrDouble(dom, AttrStep, QStringLiteral("-1")); + const qreal base = GetParametrDouble(dom, AttrBase, QChar('0')); + + const DimesionLabels labels = ReadDimensionLabels(dom); + + if (type == MeasurementDimension::X) + { + auto dimension = QSharedPointer::create(units, min, max, step); + dimension->SetBaseValue(base); + dimension->SetLabels(labels); + dimensions.insert(type, dimension); + } + else if (type == MeasurementDimension::Y) + { + auto dimension = QSharedPointer::create(units, min, max, step); + dimension->SetBaseValue(base); + dimension->SetCircumference(GetParametrBool(dom, AttrCircumference, trueStr)); + dimension->SetLabels(labels); + dimensions.insert(type, dimension); + } + else if (type == MeasurementDimension::W) + { + auto dimension = QSharedPointer::create(units, min, max, step); + dimension->SetBaseValue(base); + dimension->SetLabels(labels); + dimensions.insert(type, dimension); + } + else if (type == MeasurementDimension::Z) + { + auto dimension = QSharedPointer::create(units, min, max, step); + dimension->SetBaseValue(base); + dimension->SetLabels(labels); + dimensions.insert(type, dimension); + } + } + + return dimensions; +} + //--------------------------------------------------------------------------------------------------------------------- qreal VMeasurements::EvalFormula(VContainer *data, const QString &formula, bool *ok) const { diff --git a/src/libs/vformat/vmeasurements.h b/src/libs/vformat/vmeasurements.h index 22f17f906..05054710e 100644 --- a/src/libs/vformat/vmeasurements.h +++ b/src/libs/vformat/vmeasurements.h @@ -44,6 +44,8 @@ class VContainer; enum class GenderType : qint8 { Male, Female, Unknown }; +using VDimensions = QMap; + class VMeasurements : public VDomDocument { Q_DECLARE_TR_FUNCTIONS(VMeasurements) @@ -65,6 +67,8 @@ public: void MoveDown(const QString &name); void MoveBottom(const QString &name); + auto Units() const -> Unit; + void StoreNames(bool store); void ReadMeasurements(qreal baseA, qreal baseB=0, qreal baseC=0) const; @@ -117,7 +121,7 @@ public: QString MeasurementForDimension(IMD type) const; - auto Dimensions() const -> QMap; + auto Dimensions() const -> VDimensions; auto GetRestrictions() const -> QMap; void SetRestrictions(const QMap &restrictions); @@ -201,6 +205,10 @@ private: VContainer *data; MeasurementsType type; + // Cache data to quick access + Unit m_units{Unit::LAST_UNIT_DO_NOT_USE}; + VDimensions m_dimensions{}; + /** @brief m_keepNames store names in container to check uniqueness. */ bool m_keepNames{true}; @@ -214,6 +222,8 @@ private: QDomElement MakeEmpty(const QString &name, const QString &formula); QDomElement FindM(const QString &name) const; MeasurementsType ReadType() const; + auto ReadUnits() const -> Unit; + auto ReadDimensions() const -> VDimensions; qreal EvalFormula(VContainer *data, const QString &formula, bool *ok) const; diff --git a/src/libs/vmisc/literals.cpp b/src/libs/vmisc/literals.cpp index 926a04b10..a0faaaa90 100644 --- a/src/libs/vmisc/literals.cpp +++ b/src/libs/vmisc/literals.cpp @@ -34,4 +34,3 @@ const QString preferencesOtherIcon = QStringLiteral("preferences-other"); const QString degreeSymbol = QStringLiteral("°"); const QString trueStr = QStringLiteral("true"); const QString falseStr = QStringLiteral("false"); -const QString unknownCharacter = QStringLiteral("�"); diff --git a/src/libs/vmisc/literals.h b/src/libs/vmisc/literals.h index 798a84181..d20a07865 100644 --- a/src/libs/vmisc/literals.h +++ b/src/libs/vmisc/literals.h @@ -40,6 +40,5 @@ extern const QString preferencesOtherIcon; extern const QString degreeSymbol; extern const QString trueStr; extern const QString falseStr; -extern const QString unknownCharacter; #endif // LITERALS_H From b89be44a884703b636e1a8c8051593d008d979dd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 7 May 2021 17:00:23 +0300 Subject: [PATCH 04/29] Improve tool tooltip. Show segment names and aliases. Show segments for tools: Curve intersect axis, Point of intersection curves. Show aliases for tools: Segment Arc, Segment Spline, Segment Spline Path. --- ChangeLog.txt | 3 +- .../toolsinglepoint/toolcut/vtoolcutarc.cpp | 4 ++ .../toolcut/vtoolcutspline.cpp | 3 ++ .../toolcut/vtoolcutsplinepath.cpp | 3 ++ .../toollinepoint/vtoolcurveintersectaxis.cpp | 34 +++++++++++++++-- .../toollinepoint/vtoolcurveintersectaxis.h | 16 +++----- .../vtoolpointofintersectioncurves.cpp | 37 ++++++++++++++++--- .../vtoolpointofintersectioncurves.h | 22 +++++------ .../toolsinglepoint/vtoolsinglepoint.cpp | 18 +++++---- .../toolsinglepoint/vtoolsinglepoint.h | 10 +++-- 10 files changed, 108 insertions(+), 42 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 440092ec2..9e9890525 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -9,7 +9,8 @@ - [smart-pattern/valentina#123] Error inside Save layout dialog. - Improve error handling for the dxf export. - Fix correct handle a final measurement formula error when exporting a pattern recipe. -- Fix regression. Incorrect data caching. +- Fix regression. Incorrect data caching. +- Improve tool tooltip. Show segment names and aliases. # Version 0.7.46 Mar 31, 2021 - Fix incorrect calculation of value for multisize measurements in Valentina. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp index 7104a6d23..e59ee7e37 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp @@ -298,8 +298,12 @@ QString VToolCutArc::MakeToolTip() const VArc ar1; VArc ar2; arc->CutArc(VAbstractValApplication::VApp()->toPixel(length), ar1, ar2); + ar1.setId(m_id + 1); + ar1.SetAliasSuffix(m_aliasSuffix1); + ar2.setId(m_id + 2); + ar2.SetAliasSuffix(m_aliasSuffix2); auto ArcToolTip = [arcStr, lengthStr, startAngleStr, endAngleStr, radiusStr](QString toolTip, const VArc &arc, const QString &arcNumber) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp index 6a0e332c8..b290ea1a1 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp @@ -290,7 +290,10 @@ QString VToolCutSpline::MakeToolTip() const QPointF point = spl->CutSpline(VAbstractValApplication::VApp()->toPixel(length), spl1p2, spl1p3, spl2p2, spl2p3); VSpline spline1 = VSpline(spl->GetP1(), spl1p2, spl1p3, VPointF(point)); + spline1.SetAliasSuffix(m_aliasSuffix1); + VSpline spline2 = VSpline(VPointF(point), spl2p2, spl2p3, spl->GetP4()); + spline2.SetAliasSuffix(m_aliasSuffix2); const QString curveStr = tr("Curve"); const QString lengthStr = tr("length"); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp index d7747b075..927e1a804 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp @@ -388,6 +388,9 @@ QString VToolCutSplinePath::MakeToolTip() const VAbstractValApplication::VApp()->toPixel(length), splPath, "X", &splPath1, &splPath2); delete p; // Don't need this point + splPath1->SetAliasSuffix(m_aliasSuffix1); + splPath2->SetAliasSuffix(m_aliasSuffix2); + const QString curveStr = tr("Curve"); const QString lengthStr = tr("length"); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp index b1260c3dc..bf9325a70 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -76,7 +76,8 @@ VToolCurveIntersectAxis::VToolCurveIntersectAxis(const VToolCurveIntersectAxisIn :VToolLinePoint(initData.doc, initData.data, initData.id, initData.typeLine, initData.lineColor, QString(), initData.basePointId, 0, initData.notes, parent), formulaAngle(initData.formulaAngle), - curveId(initData.curveId) + curveId(initData.curveId), + m_segments(initData.segments) { ToolCreation(initData.typeCreation); } @@ -160,14 +161,16 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(VToolCurveIntersectAxis initData.data->getNextId(); initData.data->getNextId(); - VToolSinglePoint::InitSegments(curve->getType(), segLength, p, initData.curveId, initData.data); + initData.segments = VToolSinglePoint::InitSegments(curve->getType(), segLength, p, initData.curveId, + initData.data); } else { initData.data->UpdateGObject(initData.id, p); initData.data->AddLine(initData.basePointId, initData.id); - VToolSinglePoint::InitSegments(curve->getType(), segLength, p, initData.curveId, initData.data); + initData.segments = VToolSinglePoint::InitSegments(curve->getType(), segLength, p, initData.curveId, + initData.data); if (initData.parse != Document::FullParse) { @@ -308,3 +311,28 @@ void VToolCurveIntersectAxis::SetVisualization() visual->RefreshGeometry(); } } + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolCurveIntersectAxis::MakeToolTip() const +{ + const QSharedPointer first = VAbstractTool::data.GeometricObject(basePointId); + const QSharedPointer second = VAbstractTool::data.GeometricObject(m_id); + + const QLineF line(static_cast(*first), static_cast(*second)); + + const QString toolTip = QString("" + "" + "" + "" + "" + "" + "
%6: %7
%1: %2 %3
%4: %5°
%8: %9
%10: %11
") + .arg(tr("Length")) // 1 + .arg(VAbstractValApplication::VApp()->fromPixel(line.length())) // 2 + .arg(UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true), tr("Angle")) // 3, 4 + .arg(line.angle()) // 5 + .arg(tr("Label"), second->name(), /* 6, 7 */ + tr("Segment 1"), m_segments.first, /* 8, 9 */ + tr("Segment 2"), m_segments.second); /* 10, 11 */ + return toolTip; +} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h index 4bf4f7acd..8c24031db 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h @@ -48,16 +48,10 @@ template class QSharedPointer; struct VToolCurveIntersectAxisInitData : VToolLinePointInitData { - VToolCurveIntersectAxisInitData() - : VToolLinePointInitData(), - formulaAngle('0'), - basePointId(NULL_ID), - curveId(NULL_ID) - {} - - QString formulaAngle; - quint32 basePointId; - quint32 curveId; + QString formulaAngle{'0'}; + quint32 basePointId{NULL_ID}; + quint32 curveId{NULL_ID}; + QPair segments{}; }; class VToolCurveIntersectAxis : public VToolLinePoint @@ -92,10 +86,12 @@ protected: virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj) override; virtual void ReadToolAttributes(const QDomElement &domElement) override; virtual void SetVisualization() override; + virtual auto MakeToolTip() const -> QString override; private: Q_DISABLE_COPY(VToolCurveIntersectAxis) QString formulaAngle; quint32 curveId; + QPair m_segments{}; VToolCurveIntersectAxis(const VToolCurveIntersectAxisInitData &initData, QGraphicsItem *parent = nullptr); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index 113c467b3..3d030241f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -62,7 +62,9 @@ VToolPointOfIntersectionCurves::VToolPointOfIntersectionCurves(const VToolPointO firstCurveId(initData.firstCurveId), secondCurveId(initData.secondCurveId), vCrossPoint(initData.vCrossPoint), - hCrossPoint(initData.hCrossPoint) + hCrossPoint(initData.hCrossPoint), + m_curve1Segments(initData.curve1Segments), + m_curve2Segments(initData.curve2Segments) { ToolCreation(initData.typeCreation); } @@ -141,15 +143,19 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(VToolPoin { initData.id = initData.data->AddGObject(p); - VToolSinglePoint::InitSegments(curve1->getType(), segLength1, p, initData.firstCurveId, initData.data); - VToolSinglePoint::InitSegments(curve2->getType(), segLength2, p, initData.secondCurveId, initData.data); + initData.curve1Segments = VToolSinglePoint::InitSegments(curve1->getType(), segLength1, p, + initData.firstCurveId, initData.data); + initData.curve2Segments = VToolSinglePoint::InitSegments(curve2->getType(), segLength2, p, + initData.secondCurveId, initData.data); } else { initData.data->UpdateGObject(initData.id, p); - VToolSinglePoint::InitSegments(curve1->getType(), segLength1, p, initData.firstCurveId, initData.data); - VToolSinglePoint::InitSegments(curve2->getType(), segLength2, p, initData.secondCurveId, initData.data); + initData.curve1Segments = VToolSinglePoint::InitSegments(curve1->getType(), segLength1, p, + initData.firstCurveId, initData.data); + initData.curve2Segments = VToolSinglePoint::InitSegments(curve2->getType(), segLength2, p, + initData.secondCurveId, initData.data); if (initData.parse != Document::FullParse) { @@ -423,3 +429,24 @@ void VToolPointOfIntersectionCurves::SetVisualization() visual->RefreshGeometry(); } } + +//--------------------------------------------------------------------------------------------------------------------- +auto VToolPointOfIntersectionCurves::MakeToolTip() const -> QString +{ + const QSharedPointer p = VAbstractTool::data.GeometricObject(m_id); + + const QString toolTip = QString("" + "" + "" + "" + "" + "" + "
%1: %2
%3: %4
%5: %6
%7: %8
%9: %10
") + .arg(tr("Label"), p->name(), /* 1, 2 */ + tr("Curve 1 segment 1"), m_curve1Segments.first, /* 3, 4 */ + tr("Curve 1 segment 2"), m_curve1Segments.second) /* 5, 6 */ + .arg(tr("Curve 2 segment 1"), m_curve2Segments.first, /* 7, 8 */ + tr("Curve 2 segment 2"), m_curve2Segments.second); /* 9, 10 */ + + return toolTip; +} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h index 245399c2e..ca76efeac 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h @@ -47,18 +47,12 @@ template class QSharedPointer; struct VToolPointOfIntersectionCurvesInitData : VToolSinglePointInitData { - VToolPointOfIntersectionCurvesInitData() - : VToolSinglePointInitData(), - firstCurveId(NULL_ID), - secondCurveId(NULL_ID), - vCrossPoint(VCrossCurvesPoint::HighestPoint), - hCrossPoint(HCrossCurvesPoint::LeftmostPoint) - {} - - quint32 firstCurveId; - quint32 secondCurveId; - VCrossCurvesPoint vCrossPoint; - HCrossCurvesPoint hCrossPoint; + quint32 firstCurveId{NULL_ID}; + quint32 secondCurveId{NULL_ID}; + VCrossCurvesPoint vCrossPoint{VCrossCurvesPoint::HighestPoint}; + HCrossCurvesPoint hCrossPoint{HCrossCurvesPoint::LeftmostPoint}; + QPair curve1Segments{}; + QPair curve2Segments{}; }; class VToolPointOfIntersectionCurves : public VToolSinglePoint @@ -94,6 +88,7 @@ protected: virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj) override; virtual void ReadToolAttributes(const QDomElement &domElement) override; virtual void SetVisualization() override; + virtual auto MakeToolTip() const -> QString override; private: Q_DISABLE_COPY(VToolPointOfIntersectionCurves) @@ -103,6 +98,9 @@ private: VCrossCurvesPoint vCrossPoint; HCrossCurvesPoint hCrossPoint; + QPair m_curve1Segments{}; + QPair m_curve2Segments{}; + explicit VToolPointOfIntersectionCurves(const VToolPointOfIntersectionCurvesInitData &initData, QGraphicsItem *parent = nullptr); }; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index 96d2fbab9..a0cffaf69 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -395,17 +395,15 @@ void VToolSinglePoint::ToolSelectionType(const SelectionType &type) //--------------------------------------------------------------------------------------------------------------------- QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wswitch-default") -void VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId, - VContainer *data) +auto VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId, + VContainer *data) -> QPair { switch(curveType) { case GOType::EllipticalArc: - InitArc(data, segLength, p, curveId); - break; + return InitArc(data, segLength, p, curveId); case GOType::Arc: - InitArc(data, segLength, p, curveId); - break; + return InitArc(data, segLength, p, curveId); case GOType::CubicBezier: case GOType::Spline: { @@ -449,7 +447,8 @@ void VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPo data->RegisterUniqueName(spline2); data->AddSpline(spline2, NULL_ID, p->id()); - break; + + return qMakePair(spline1->ObjectName(), spline2->ObjectName()); } case GOType::CubicBezierPath: case GOType::SplinePath: @@ -497,7 +496,8 @@ void VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPo data->RegisterUniqueName(splP2); data->AddSpline(splP2, NULL_ID, p->id()); - break; + + return qMakePair(splP1->ObjectName(), splP2->ObjectName()); } case GOType::Point: case GOType::PlaceLabel: @@ -505,6 +505,8 @@ void VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPo Q_UNREACHABLE(); break; } + + return {}; } QT_WARNING_POP diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h index 6fae77723..aa8cf3f27 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h @@ -108,15 +108,17 @@ protected: virtual void ChangeLabelVisibility(quint32 id, bool visible) override; template - static void InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId); - static void InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId, VContainer *data); + static QPair InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId); + static QPair InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId, + VContainer *data); private: Q_DISABLE_COPY(VToolSinglePoint) }; //--------------------------------------------------------------------------------------------------------------------- template -inline void VToolSinglePoint::InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId) +inline auto VToolSinglePoint::InitArc(VContainer *data, qreal segLength, const VPointF *p, + quint32 curveId) -> QPair { QSharedPointer a1; QSharedPointer a2; @@ -155,6 +157,8 @@ inline void VToolSinglePoint::InitArc(VContainer *data, qreal segLength, const V data->AddArc(a1, arc1.id(), p->id()); data->AddArc(a2, arc2.id(), p->id()); + + return qMakePair(arc1.ObjectName(), arc2.ObjectName()); } #endif // VTOOLSINGLEPOINT_H From 6bfc5065bd7743552b4a52363a03dc3163004364 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 8 May 2021 10:54:14 +0300 Subject: [PATCH 05/29] Alias support for tools Point of intersection curve and axis and Point of intersection curves. --- ChangeLog.txt | 1 + src/app/valentina/xml/vpattern.cpp | 6 + src/libs/ifc/ifcdef.cpp | 4 + src/libs/ifc/ifcdef.h | 4 + src/libs/ifc/schema.qrc | 1 + src/libs/ifc/schema/pattern/v0.8.11.xsd | 1126 +++++++++++++++++ src/libs/ifc/xml/vpatternconverter.cpp | 23 +- src/libs/ifc/xml/vpatternconverter.h | 3 +- src/libs/vtools/dialogs/dialogtoolbox.cpp | 49 + src/libs/vtools/dialogs/dialogtoolbox.h | 2 + .../tools/dialogcurveintersectaxis.cpp | 72 ++ .../dialogs/tools/dialogcurveintersectaxis.h | 15 +- .../dialogs/tools/dialogcurveintersectaxis.ui | 32 +- .../vtools/dialogs/tools/dialogcutarc.cpp | 2 +- .../vtools/dialogs/tools/dialogcutspline.cpp | 2 +- .../dialogs/tools/dialogcutsplinepath.cpp | 2 +- .../tools/dialogpointofintersectioncurves.cpp | 123 +- .../tools/dialogpointofintersectioncurves.h | 24 +- .../tools/dialogpointofintersectioncurves.ui | 247 ++-- .../toolsinglepoint/toolcut/vtoolcut.cpp | 4 +- .../toollinepoint/vtoolcurveintersectaxis.cpp | 42 +- .../toollinepoint/vtoolcurveintersectaxis.h | 8 +- .../vtoolpointofintersectioncurves.cpp | 76 +- .../vtoolpointofintersectioncurves.h | 12 + .../toolsinglepoint/vtoolsinglepoint.cpp | 21 +- .../toolsinglepoint/vtoolsinglepoint.h | 15 +- 26 files changed, 1789 insertions(+), 127 deletions(-) create mode 100644 src/libs/ifc/schema/pattern/v0.8.11.xsd diff --git a/ChangeLog.txt b/ChangeLog.txt index 9e9890525..760b1a585 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -11,6 +11,7 @@ - Fix correct handle a final measurement formula error when exporting a pattern recipe. - Fix regression. Incorrect data caching. - Improve tool tooltip. Show segment names and aliases. +- Alias support for tools Point of intersection curve and axis and Point of intersection curves. # Version 0.7.46 Mar 31, 2021 - Fix incorrect calculation of value for multisize measurements in Valentina. diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index b59489571..89f590e97 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -2282,6 +2282,8 @@ void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElemen initData.curveId = GetParametrUInt(domElement, AttrCurve, NULL_ID_STR); initData.formulaAngle = GetParametrString(domElement, AttrAngle, QStringLiteral("0.0")); const QString angleFix = initData.formulaAngle; + initData.aliasSuffix1 = GetParametrEmptyString(domElement, AttrAlias1); + initData.aliasSuffix2 = GetParametrEmptyString(domElement, AttrAlias2); VToolCurveIntersectAxis::Create(initData); //Rewrite attribute formula. Need for situation when we have wrong formula. @@ -2403,6 +2405,10 @@ void VPattern::ParseToolPointOfIntersectionCurves(VMainGraphicsScene *scene, QDo initData.secondCurveId = GetParametrUInt(domElement, AttrCurve2, NULL_ID_STR); initData.vCrossPoint = static_cast(GetParametrUInt(domElement, AttrVCrossPoint, QChar('1'))); initData.hCrossPoint = static_cast(GetParametrUInt(domElement, AttrHCrossPoint, QChar('1'))); + initData.curve1AliasSuffix1 = GetParametrEmptyString(domElement, AttrCurve1Alias1); + initData.curve1AliasSuffix2 = GetParametrEmptyString(domElement, AttrCurve1Alias2); + initData.curve2AliasSuffix1 = GetParametrEmptyString(domElement, AttrCurve2Alias1); + initData.curve2AliasSuffix2 = GetParametrEmptyString(domElement, AttrCurve2Alias2); VToolPointOfIntersectionCurves::Create(initData); } diff --git a/src/libs/ifc/ifcdef.cpp b/src/libs/ifc/ifcdef.cpp index db035f16e..bf2c32bd6 100644 --- a/src/libs/ifc/ifcdef.cpp +++ b/src/libs/ifc/ifcdef.cpp @@ -137,6 +137,10 @@ const QString AttrNotes = QStringLiteral("notes"); const QString AttrAlias = QStringLiteral("alias"); const QString AttrAlias1 = QStringLiteral("alias1"); const QString AttrAlias2 = QStringLiteral("alias2"); +const QString AttrCurve1Alias1 = QStringLiteral("curve1Alias1"); +const QString AttrCurve1Alias2 = QStringLiteral("curve1Alias2"); +const QString AttrCurve2Alias1 = QStringLiteral("curve2Alias1"); +const QString AttrCurve2Alias2 = QStringLiteral("curve2Alias2"); const QString TypeLineDefault = QStringLiteral("default"); const QString TypeLineNone = QStringLiteral("none"); diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 3173145cd..d74fbdb69 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -155,6 +155,10 @@ extern const QString AttrNotes; extern const QString AttrAlias; extern const QString AttrAlias1; extern const QString AttrAlias2; +extern const QString AttrCurve1Alias1; +extern const QString AttrCurve1Alias2; +extern const QString AttrCurve2Alias1; +extern const QString AttrCurve2Alias2; extern const QString TypeLineDefault; extern const QString TypeLineNone; diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index 7d322dbb9..f804d75c8 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -62,6 +62,7 @@ schema/pattern/v0.8.8.xsd schema/pattern/v0.8.9.xsd schema/pattern/v0.8.10.xsd + schema/pattern/v0.8.11.xsd schema/multisize_measurements/v0.3.0.xsd schema/multisize_measurements/v0.4.0.xsd schema/multisize_measurements/v0.4.1.xsd diff --git a/src/libs/ifc/schema/pattern/v0.8.11.xsd b/src/libs/ifc/schema/pattern/v0.8.11.xsd new file mode 100644 index 000000000..b82690505 --- /dev/null +++ b/src/libs/ifc/schema/pattern/v0.8.11.xsd @@ -0,0 +1,1126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 7316ab6dc..6d2474940 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -59,8 +59,8 @@ class QDomElement; */ const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.4"); -const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.8.10"); -const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.8.10.xsd"); +const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.8.11"); +const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.8.11.xsd"); //VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!! //VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!! @@ -240,7 +240,8 @@ QString VPatternConverter::XSDSchema(int ver) const std::make_pair(FORMAT_VERSION(0, 8, 7), QStringLiteral("://schema/pattern/v0.8.7.xsd")), std::make_pair(FORMAT_VERSION(0, 8, 8), QStringLiteral("://schema/pattern/v0.8.8.xsd")), std::make_pair(FORMAT_VERSION(0, 8, 9), QStringLiteral("://schema/pattern/v0.8.9.xsd")), - std::make_pair(FORMAT_VERSION(0, 8, 10), CurrentSchema) + std::make_pair(FORMAT_VERSION(0, 8, 10), QStringLiteral("://schema/pattern/v0.8.10.xsd")), + std::make_pair(FORMAT_VERSION(0, 8, 11), CurrentSchema) }; if (schemas.contains(ver)) @@ -501,6 +502,10 @@ void VPatternConverter::ApplyPatches() ValidateXML(XSDSchema(FORMAT_VERSION(0, 8, 10))); Q_FALLTHROUGH(); case (FORMAT_VERSION(0, 8, 10)): + ToV0_8_11(); + ValidateXML(XSDSchema(FORMAT_VERSION(0, 8, 11))); + Q_FALLTHROUGH(); + case (FORMAT_VERSION(0, 8, 11)): break; default: InvalidVersion(m_ver); @@ -518,7 +523,7 @@ void VPatternConverter::DowngradeToCurrentMaxVersion() bool VPatternConverter::IsReadOnly() const { // Check if attribute readOnly was not changed in file format - Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 8, 10), + Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 8, 11), "Check attribute readOnly."); // Possibly in future attribute readOnly will change position etc. @@ -1189,6 +1194,16 @@ void VPatternConverter::ToV0_8_10() Save(); } +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ToV0_8_11() +{ + // TODO. Delete if minimal supported version is 0.8.11 + Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FORMAT_VERSION(0, 8, 11), + "Time to refactor the code."); + SetVersion(QStringLiteral("0.8.11")); + Save(); +} + //--------------------------------------------------------------------------------------------------------------------- void VPatternConverter::TagUnitToV0_2_0() { diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index 6fea9583b..6bd1d9913 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -53,7 +53,7 @@ public: static const QString PatternMaxVerStr; static const QString CurrentSchema; static Q_DECL_CONSTEXPR const int PatternMinVer = FORMAT_VERSION(0, 1, 4); - static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 8, 10); + static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 8, 11); protected: virtual int MinVer() const override; @@ -133,6 +133,7 @@ private: void ToV0_8_8(); void ToV0_8_9(); void ToV0_8_10(); + void ToV0_8_11(); void TagUnitToV0_2_0(); void TagIncrementToV0_2_0(); diff --git a/src/libs/vtools/dialogs/dialogtoolbox.cpp b/src/libs/vtools/dialogs/dialogtoolbox.cpp index a2ce91c1d..8e74f2bb5 100644 --- a/src/libs/vtools/dialogs/dialogtoolbox.cpp +++ b/src/libs/vtools/dialogs/dialogtoolbox.cpp @@ -36,6 +36,12 @@ #include "../vpatterndb/variables/vcurvelength.h" #include "../ifc/exception/vexceptionbadid.h" #include "../vpatterndb/vcontainer.h" +#include "../vgeometry/vellipticalarc.h" +#include "../vgeometry/varc.h" +#include "../vgeometry/vcubicbezier.h" +#include "../vgeometry/vcubicbezierpath.h" +#include "../vgeometry/vspline.h" +#include "../vgeometry/vsplinepath.h" #include #include @@ -106,7 +112,20 @@ bool DoubleCurve(const VPieceNode &firstNode, const VPieceNode &secondNode) return false; } + +//--------------------------------------------------------------------------------------------------------------------- +template +auto CurveAliases(const QString &alias1, const QString &alias2) -> QPair +{ + T curve1; + curve1.SetAliasSuffix(alias1); + + T curve2; + curve2.SetAliasSuffix(alias2); + + return qMakePair(curve1.GetAlias(), curve2.GetAlias()); } +} // namespace //--------------------------------------------------------------------------------------------------------------------- VPieceNode RowNode(QListWidget *listWidget, int i) @@ -527,3 +546,33 @@ QIcon LineColor(int size, const QString &color) pix.fill(QColor(color)); return QIcon(pix); } + +//--------------------------------------------------------------------------------------------------------------------- +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wswitch-default") +auto SegmentAliases(GOType curveType, const QString &alias1, const QString &alias2) -> QPair +{ + switch(curveType) + { + case GOType::EllipticalArc: + return CurveAliases(alias1, alias2); + case GOType::Arc: + return CurveAliases(alias1, alias2); + case GOType::CubicBezier: + return CurveAliases(alias1, alias2); + case GOType::Spline: + return CurveAliases(alias1, alias2); + case GOType::CubicBezierPath: + return CurveAliases(alias1, alias2); + case GOType::SplinePath: + return CurveAliases(alias1, alias2); + case GOType::Point: + case GOType::PlaceLabel: + case GOType::Unknown: + Q_UNREACHABLE(); + break; + } + + return {}; +} +QT_WARNING_POP diff --git a/src/libs/vtools/dialogs/dialogtoolbox.h b/src/libs/vtools/dialogs/dialogtoolbox.h index ec7b1ee4b..bba25526b 100644 --- a/src/libs/vtools/dialogs/dialogtoolbox.h +++ b/src/libs/vtools/dialogs/dialogtoolbox.h @@ -34,6 +34,7 @@ #include "../vpatterndb/variables/vinternalvariable.h" #include "../vmisc/typedef.h" +#include "../vgeometry/vgeometrydef.h" class QPlainTextEdit; class QPushButton; @@ -88,5 +89,6 @@ QFont NodeFont(QFont font, bool nodeExcluded = false); void CurrentCurveLength(vidtype curveId, VContainer *data); void SetTabStopDistance(QPlainTextEdit *edit, int tabWidthChar=4); QIcon LineColor(int size, const QString &color); +auto SegmentAliases(GOType curveType, const QString &alias1, const QString &alias2) -> QPair; #endif // DIALOGTOOLBOX_H diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp index c7facc36a..d3dc6ecc0 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.cpp @@ -51,6 +51,8 @@ #include "../support/dialogeditwrongformula.h" #include "../vmisc/vabstractapplication.h" #include "../vmisc/vcommonsettings.h" +#include "../qmuparser/qmudef.h" +#include "../dialogtoolbox.h" #include "ui_dialogcurveintersectaxis.h" //--------------------------------------------------------------------------------------------------------------------- @@ -95,6 +97,8 @@ DialogCurveIntersectAxis::DialogCurveIntersectAxis(const VContainer *data, quint }); connect(ui->pushButtonGrowLengthAngle, &QPushButton::clicked, this, &DialogCurveIntersectAxis::DeployAngleTextEdit); connect(timerFormula, &QTimer::timeout, this, &DialogCurveIntersectAxis::EvalAngle); + connect(ui->lineEditAlias1, &QLineEdit::textEdited, this, &DialogCurveIntersectAxis::ValidateAlias); + connect(ui->lineEditAlias2, &QLineEdit::textEdited, this, &DialogCurveIntersectAxis::ValidateAlias); vis = new VisToolCurveIntersectAxis(data); @@ -352,6 +356,46 @@ void DialogCurveIntersectAxis::closeEvent(QCloseEvent *event) DialogTool::closeEvent(event); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogCurveIntersectAxis::ValidateAlias() +{ + QRegularExpression rx(NameRegExp()); + + const QSharedPointer curve = data->GeometricObject(getCurveId()); + QPair alias = SegmentAliases(curve->getType(), GetAliasSuffix1(), GetAliasSuffix2()); + + + if (not GetAliasSuffix1().isEmpty() && + (not rx.match(alias.first).hasMatch() || + (originAliasSuffix1 != GetAliasSuffix1() && not data->IsUnique(alias.first)) || + alias.first == alias.second)) + { + flagAlias1 = false; + ChangeColor(ui->labelAlias1, errorColor); + } + else + { + flagAlias1 = true; + ChangeColor(ui->labelAlias1, OkColor(this)); + } + + if (not GetAliasSuffix2().isEmpty() && + (not rx.match(alias.second).hasMatch() || + (originAliasSuffix2 != GetAliasSuffix2() && not data->IsUnique(alias.second)) || + alias.first == alias.second)) + { + flagAlias2 = false; + ChangeColor(ui->labelAlias2, errorColor); + } + else + { + flagAlias2 = true; + ChangeColor(ui->labelAlias2, OkColor(this)); + } + + CheckState(); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogCurveIntersectAxis::SetNotes(const QString ¬es) { @@ -363,3 +407,31 @@ QString DialogCurveIntersectAxis::GetNotes() const { return ui->plainTextEditToolNotes->toPlainText(); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCurveIntersectAxis::SetAliasSuffix1(const QString &alias) +{ + originAliasSuffix1 = alias; + ui->lineEditAlias1->setText(originAliasSuffix1); + ValidateAlias(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCurveIntersectAxis::GetAliasSuffix1() const +{ + return ui->lineEditAlias1->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogCurveIntersectAxis::SetAliasSuffix2(const QString &alias) +{ + originAliasSuffix2 = alias; + ui->lineEditAlias2->setText(originAliasSuffix2); + ValidateAlias(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogCurveIntersectAxis::GetAliasSuffix2() const +{ + return ui->lineEditAlias2->text(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h index 6bb117784..d79fb93e1 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.h @@ -72,6 +72,12 @@ public: void SetNotes(const QString ¬es); QString GetNotes() const; + void SetAliasSuffix1(const QString &alias); + QString GetAliasSuffix1() const; + + void SetAliasSuffix2(const QString &alias); + QString GetAliasSuffix2() const; + virtual void ShowDialog(bool click) override; public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; @@ -86,6 +92,8 @@ protected: virtual void SaveData() override; virtual void closeEvent(QCloseEvent *event) override; virtual bool IsValid() const final; +private slots: + void ValidateAlias(); private: Q_DISABLE_COPY(DialogCurveIntersectAxis) Ui::DialogCurveIntersectAxis *ui; @@ -101,12 +109,17 @@ private: bool flagFormula; bool flagName; + bool flagAlias1{true}; + bool flagAlias2{true}; + + QString originAliasSuffix1{}; + QString originAliasSuffix2{}; }; //--------------------------------------------------------------------------------------------------------------------- inline bool DialogCurveIntersectAxis::IsValid() const { - return flagFormula && flagName; + return flagFormula && flagName && flagAlias1 && flagAlias2; } #endif // DIALOGCURVEINTERSECTAXIS_H diff --git a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui index 42d222f6c..0d6038518 100644 --- a/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui +++ b/src/libs/vtools/dialogs/tools/dialogcurveintersectaxis.ui @@ -6,8 +6,8 @@ 0 0 - 335 - 331 + 324 + 394 @@ -320,6 +320,34 @@ + + + + Alias1: + + + + + + + true + + + + + + + Alias2: + + + + + + + true + + + diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp index ec0bbb4d9..2a484473b 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp @@ -219,7 +219,7 @@ void DialogCutArc::ValidateAlias() if (not GetAliasSuffix1().isEmpty() && (not rx.match(arc1.GetAlias()).hasMatch() || - (originAliasSuffix2 != GetAliasSuffix1() && not data->IsUnique(arc1.GetAlias())) || + (originAliasSuffix1 != GetAliasSuffix1() && not data->IsUnique(arc1.GetAlias())) || arc1.GetAlias() == arc2.GetAlias())) { flagAlias1 = false; diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp index 30dd1a12e..fc1795152 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp @@ -227,7 +227,7 @@ void DialogCutSpline::ValidateAlias() if (not GetAliasSuffix1().isEmpty() && (not rx.match(spl1.GetAlias()).hasMatch() || - (originAliasSuffix2 != GetAliasSuffix1() && not data->IsUnique(spl1.GetAlias())) || + (originAliasSuffix1 != GetAliasSuffix1() && not data->IsUnique(spl1.GetAlias())) || spl1.GetAlias() == spl2.GetAlias())) { flagAlias1 = false; diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp index 44e5c6175..90f5305cb 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp @@ -227,7 +227,7 @@ void DialogCutSplinePath::ValidateAlias() if (not GetAliasSuffix1().isEmpty() && (not rx.match(path1.GetAlias()).hasMatch() || - (originAliasSuffix2 != GetAliasSuffix1() && not data->IsUnique(path1.GetAlias())) || + (originAliasSuffix1 != GetAliasSuffix1() && not data->IsUnique(path1.GetAlias())) || path1.GetAlias() == path2.GetAlias())) { flagAlias1 = false; diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp index 653aa4bd0..b16ce1858 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.cpp @@ -38,7 +38,9 @@ #include "../../visualization/path/vistoolpointofintersectioncurves.h" #include "../../visualization/visualization.h" #include "../vmisc/vabstractapplication.h" -#include "dialogtool.h" +#include "../qmuparser/qmudef.h" +#include "../dialogtoolbox.h" +#include "../vpatterndb/vcontainer.h" #include "ui_dialogpointofintersectioncurves.h" //--------------------------------------------------------------------------------------------------------------------- @@ -72,6 +74,10 @@ DialogPointOfIntersectionCurves::DialogPointOfIntersectionCurves(const VContaine this, &DialogPointOfIntersectionCurves::CurveChanged); connect(ui->comboBoxCurve2, &QComboBox::currentTextChanged, this, &DialogPointOfIntersectionCurves::CurveChanged); + connect(ui->lineEditCurve1Alias1, &QLineEdit::textEdited, this, &DialogPointOfIntersectionCurves::ValidateAlias); + connect(ui->lineEditCurve1Alias2, &QLineEdit::textEdited, this, &DialogPointOfIntersectionCurves::ValidateAlias); + connect(ui->lineEditCurve2Alias1, &QLineEdit::textEdited, this, &DialogPointOfIntersectionCurves::ValidateAlias); + connect(ui->lineEditCurve2Alias2, &QLineEdit::textEdited, this, &DialogPointOfIntersectionCurves::ValidateAlias); vis = new VisToolPointOfIntersectionCurves(data); @@ -252,6 +258,65 @@ void DialogPointOfIntersectionCurves::CurveChanged() CheckState(); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfIntersectionCurves::ValidateAlias() +{ + QRegularExpression rx(NameRegExp()); + + const QSharedPointer curve1 = data->GeometricObject(GetFirstCurveId()); + QPair curve1Alias = SegmentAliases(curve1->getType(), GetCurve1AliasSuffix1(), + GetCurve1AliasSuffix2()); + + const QSharedPointer curve2 = data->GeometricObject(GetSecondCurveId()); + QPair curve2Alias = SegmentAliases(curve2->getType(), GetCurve2AliasSuffix1(), + GetCurve2AliasSuffix2()); + + QSet uniqueAliases; + int countAliases = 0; + + auto CountUniqueAliases = [&countAliases, &uniqueAliases](const QString &alias) + { + if (not alias.isEmpty()) + { + uniqueAliases.insert(alias); + ++countAliases; + } + }; + + CountUniqueAliases(curve1Alias.first); + CountUniqueAliases(curve1Alias.second); + CountUniqueAliases(curve2Alias.first); + CountUniqueAliases(curve2Alias.second); + + auto Validate = [countAliases, uniqueAliases, rx, this](const QString &originalSuffix, const QString &suffix, + const QString &alias, bool &flagAlias, QLabel *label) + { + if (not suffix.isEmpty() && + (not rx.match(alias).hasMatch() || (originalSuffix != suffix && not data->IsUnique(alias)) || + countAliases != uniqueAliases.size())) + { + flagAlias = false; + ChangeColor(label, errorColor); + } + else + { + flagAlias = true; + ChangeColor(label, OkColor(this)); + } + }; + + Validate(originCurve1AliasSuffix1, GetCurve1AliasSuffix1(), curve1Alias.first, flagCurve1Alias1, + ui->labelCurve1Alias1); + Validate(originCurve1AliasSuffix2, GetCurve1AliasSuffix2(), curve1Alias.second, flagCurve1Alias2, + ui->labelCurve1Alias2); + Validate(originCurve2AliasSuffix1, GetCurve2AliasSuffix1(), curve2Alias.first, flagCurve2Alias1, + ui->labelCurve2Alias1); + Validate(originCurve2AliasSuffix2, GetCurve2AliasSuffix2(), curve2Alias.second, flagCurve2Alias2, + ui->labelCurve2Alias2); + + CheckState(); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogPointOfIntersectionCurves::SetNotes(const QString ¬es) { @@ -263,3 +328,59 @@ QString DialogPointOfIntersectionCurves::GetNotes() const { return ui->plainTextEditToolNotes->toPlainText(); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfIntersectionCurves::SetCurve1AliasSuffix1(const QString &alias) +{ + originCurve1AliasSuffix1 = alias; + ui->lineEditCurve1Alias1->setText(originCurve1AliasSuffix1); + ValidateAlias(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointOfIntersectionCurves::GetCurve1AliasSuffix1() const +{ + return ui->lineEditCurve1Alias1->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfIntersectionCurves::SetCurve1AliasSuffix2(const QString &alias) +{ + originCurve1AliasSuffix2 = alias; + ui->lineEditCurve1Alias2->setText(originCurve1AliasSuffix2); + ValidateAlias(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointOfIntersectionCurves::GetCurve1AliasSuffix2() const +{ + return ui->lineEditCurve1Alias2->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfIntersectionCurves::SetCurve2AliasSuffix1(const QString &alias) +{ + originCurve2AliasSuffix1 = alias; + ui->lineEditCurve2Alias1->setText(originCurve2AliasSuffix1); + ValidateAlias(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointOfIntersectionCurves::GetCurve2AliasSuffix1() const +{ + return ui->lineEditCurve2Alias1->text(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPointOfIntersectionCurves::SetCurve2AliasSuffix2(const QString &alias) +{ + originCurve2AliasSuffix2 = alias; + ui->lineEditCurve2Alias2->setText(originCurve2AliasSuffix2); + ValidateAlias(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogPointOfIntersectionCurves::GetCurve2AliasSuffix2() const +{ + return ui->lineEditCurve2Alias2->text(); +} diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.h b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.h index 734a4a35f..f8b07aa62 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.h +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.h @@ -69,6 +69,18 @@ public: void SetNotes(const QString ¬es); QString GetNotes() const; + void SetCurve1AliasSuffix1(const QString &alias); + QString GetCurve1AliasSuffix1() const; + + void SetCurve1AliasSuffix2(const QString &alias); + QString GetCurve1AliasSuffix2() const; + + void SetCurve2AliasSuffix1(const QString &alias); + QString GetCurve2AliasSuffix1() const; + + void SetCurve2AliasSuffix2(const QString &alias); + QString GetCurve2AliasSuffix2() const; + public slots: virtual void ChosenObject(quint32 id, const SceneObject &type) override; @@ -83,6 +95,7 @@ protected: private slots: void CurveChanged(); + void ValidateAlias(); private: Q_DISABLE_COPY(DialogPointOfIntersectionCurves) @@ -93,12 +106,21 @@ private: bool flagName; bool flagError; + bool flagCurve1Alias1{true}; + bool flagCurve1Alias2{true}; + bool flagCurve2Alias1{true}; + bool flagCurve2Alias2{true}; + + QString originCurve1AliasSuffix1{}; + QString originCurve1AliasSuffix2{}; + QString originCurve2AliasSuffix1{}; + QString originCurve2AliasSuffix2{}; }; //--------------------------------------------------------------------------------------------------------------------- inline bool DialogPointOfIntersectionCurves::IsValid() const { - return flagName && flagError; + return flagName && flagError && flagCurve1Alias1 && flagCurve1Alias2 && flagCurve2Alias1 && flagCurve2Alias2; } #endif // DIALOGPOINTOFINTERSECTIONCURVES_H diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.ui b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.ui index 202dce314..b49926786 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.ui +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncurves.ui @@ -6,8 +6,8 @@ 0 0 - 304 - 242 + 324 + 463 @@ -17,7 +17,7 @@ :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - + @@ -27,95 +27,170 @@ Tool - - - QFormLayout::ExpandingFieldsGrow - - - - - - 0 - 0 - - - - First curve: + + + + + + + + 0 + 0 + + + + First curve: + + + + + + + + + + + + + + + 0 + 0 + + + + Second curve: + + + + + + + + + + + 0 + 0 + + + + Point label: + + + + + + + + 0 + 0 + + + + Unique label + + + Choose unique label. + + + + + + + Vertical correction: + + + + + + + + + + Horizontal correction: + + + + + + + + + + + + Curve 1 + + + + + Alias1: + + + + + + + true + + + + + + + Alias2: + + + + + + + true + + + + - - - - + + + + Curve 2 + + + + + Alias1: + + + + + + + true + + + + + + + Alias2: + + + + + + + true + + + + - - - - - 0 - 0 - - - - Second curve: - - - - - - - - - - - 0 - 0 - - - - Point label: - - - - - - - - 0 - 0 - - - - Unique label - - - Choose unique label. - - - - - - - Vertical correction: - - - - - - - - - - Horizontal correction: - - - - - - diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp index c64823d52..d95ce21a7 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp @@ -200,6 +200,6 @@ void VToolCut::ReadToolAttributes(const QDomElement &domElement) { VToolSinglePoint::ReadToolAttributes(domElement); - m_aliasSuffix1 = doc->GetParametrEmptyString(domElement, AttrAlias1); - m_aliasSuffix2 = doc->GetParametrEmptyString(domElement, AttrAlias2); + m_aliasSuffix1 = VAbstractPattern::GetParametrEmptyString(domElement, AttrAlias1); + m_aliasSuffix2 = VAbstractPattern::GetParametrEmptyString(domElement, AttrAlias2); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp index bf9325a70..e988feda5 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -77,7 +77,9 @@ VToolCurveIntersectAxis::VToolCurveIntersectAxis(const VToolCurveIntersectAxisIn initData.basePointId, 0, initData.notes, parent), formulaAngle(initData.formulaAngle), curveId(initData.curveId), - m_segments(initData.segments) + m_segments(initData.segments), + m_aliasSuffix1(initData.aliasSuffix1), + m_aliasSuffix2(initData.aliasSuffix2) { ToolCreation(initData.typeCreation); } @@ -97,6 +99,8 @@ void VToolCurveIntersectAxis::setDialog() dialogTool->setCurveId(curveId); dialogTool->SetPointName(p->name()); dialogTool->SetNotes(m_notes); + dialogTool->SetAliasSuffix1(m_aliasSuffix1); + dialogTool->SetAliasSuffix2(m_aliasSuffix2); } //--------------------------------------------------------------------------------------------------------------------- @@ -121,6 +125,8 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(const QPointerGetNotes(); + initData.aliasSuffix1 = dialogTool->GetAliasSuffix1(); + initData.aliasSuffix2 = dialogTool->GetAliasSuffix2(); VToolCurveIntersectAxis *point = Create(initData); if (point != nullptr) @@ -162,7 +168,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(VToolCurveIntersectAxis initData.data->getNextId(); initData.data->getNextId(); initData.segments = VToolSinglePoint::InitSegments(curve->getType(), segLength, p, initData.curveId, - initData.data); + initData.data, initData.aliasSuffix1, initData.aliasSuffix2); } else { @@ -170,7 +176,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(VToolCurveIntersectAxis initData.data->AddLine(initData.basePointId, initData.id); initData.segments = VToolSinglePoint::InitSegments(curve->getType(), segLength, p, initData.curveId, - initData.data); + initData.data, initData.aliasSuffix1, initData.aliasSuffix2); if (initData.parse != Document::FullParse) { @@ -189,6 +195,10 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(VToolCurveIntersectAxis initData.doc->IncrementReferens(curve->getIdTool()); return point; } + + auto *tool = qobject_cast(VAbstractPattern::getTool(initData.id)); + tool->SetSegments(initData.segments); + return nullptr; } @@ -267,6 +277,10 @@ void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement, QList doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle()); doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId())); doc->SetAttribute(domElement, AttrCurve, QString().setNum(dialogTool->getCurveId())); + doc->SetAttributeOrRemoveIf(domElement, AttrAlias1, dialogTool->GetAliasSuffix1(), + dialogTool->GetAliasSuffix1().isEmpty()); + doc->SetAttributeOrRemoveIf(domElement, AttrAlias2, dialogTool->GetAliasSuffix2(), + dialogTool->GetAliasSuffix2().isEmpty()); const QString notes = dialogTool->GetNotes(); doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); @@ -281,6 +295,8 @@ void VToolCurveIntersectAxis::SaveOptions(QDomElement &tag, QSharedPointerSetAttribute(tag, AttrAngle, formulaAngle); doc->SetAttribute(tag, AttrBasePoint, basePointId); doc->SetAttribute(tag, AttrCurve, curveId); + doc->SetAttributeOrRemoveIf(tag, AttrAlias1, m_aliasSuffix1, m_aliasSuffix1.isEmpty()); + doc->SetAttributeOrRemoveIf(tag, AttrAlias2, m_aliasSuffix2, m_aliasSuffix2.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -288,11 +304,13 @@ void VToolCurveIntersectAxis::ReadToolAttributes(const QDomElement &domElement) { VToolLinePoint::ReadToolAttributes(domElement); - m_lineType = doc->GetParametrString(domElement, AttrTypeLine, TypeLineLine); - lineColor = doc->GetParametrString(domElement, AttrLineColor, ColorBlack); - basePointId = doc->GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); - curveId = doc->GetParametrUInt(domElement, AttrCurve, NULL_ID_STR); - formulaAngle = doc->GetParametrString(domElement, AttrAngle, QString()); + m_lineType = VAbstractPattern::GetParametrString(domElement, AttrTypeLine, TypeLineLine); + lineColor = VAbstractPattern::GetParametrString(domElement, AttrLineColor, ColorBlack); + basePointId = VAbstractPattern::GetParametrUInt(domElement, AttrBasePoint, NULL_ID_STR); + curveId = VAbstractPattern::GetParametrUInt(domElement, AttrCurve, NULL_ID_STR); + formulaAngle = VAbstractPattern::GetParametrString(domElement, AttrAngle, QString()); + m_aliasSuffix1 = VAbstractPattern::GetParametrEmptyString(domElement, AttrAlias1); + m_aliasSuffix2 = VAbstractPattern::GetParametrEmptyString(domElement, AttrAlias2); } //--------------------------------------------------------------------------------------------------------------------- @@ -300,7 +318,7 @@ void VToolCurveIntersectAxis::SetVisualization() { if (not vis.isNull()) { - VisToolCurveIntersectAxis *visual = qobject_cast(vis); + auto *visual = qobject_cast(vis); SCASSERT(visual != nullptr) visual->setObject1Id(curveId); @@ -336,3 +354,9 @@ QString VToolCurveIntersectAxis::MakeToolTip() const tr("Segment 2"), m_segments.second); /* 10, 11 */ return toolTip; } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolCurveIntersectAxis::SetSegments(const QPair &segments) +{ + m_segments = segments; +} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h index 8c24031db..8f0f5a02c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h @@ -52,6 +52,8 @@ struct VToolCurveIntersectAxisInitData : VToolLinePointInitData quint32 basePointId{NULL_ID}; quint32 curveId{NULL_ID}; QPair segments{}; + QString aliasSuffix1{}; + QString aliasSuffix2{}; }; class VToolCurveIntersectAxis : public VToolLinePoint @@ -87,13 +89,17 @@ protected: virtual void ReadToolAttributes(const QDomElement &domElement) override; virtual void SetVisualization() override; virtual auto MakeToolTip() const -> QString override; + + void SetSegments(const QPair &segments); private: Q_DISABLE_COPY(VToolCurveIntersectAxis) QString formulaAngle; quint32 curveId; QPair m_segments{}; + QString m_aliasSuffix1{}; + QString m_aliasSuffix2{}; - VToolCurveIntersectAxis(const VToolCurveIntersectAxisInitData &initData, QGraphicsItem *parent = nullptr); + explicit VToolCurveIntersectAxis(const VToolCurveIntersectAxisInitData &initData, QGraphicsItem *parent = nullptr); template static void InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index 3d030241f..e859fc58a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -64,7 +64,11 @@ VToolPointOfIntersectionCurves::VToolPointOfIntersectionCurves(const VToolPointO vCrossPoint(initData.vCrossPoint), hCrossPoint(initData.hCrossPoint), m_curve1Segments(initData.curve1Segments), - m_curve2Segments(initData.curve2Segments) + m_curve2Segments(initData.curve2Segments), + m_curve1AliasSuffix1(initData.curve1AliasSuffix1), + m_curve1AliasSuffix2(initData.curve1AliasSuffix2), + m_curve2AliasSuffix1(initData.curve2AliasSuffix1), + m_curve2AliasSuffix2(initData.curve2AliasSuffix2) { ToolCreation(initData.typeCreation); } @@ -82,6 +86,10 @@ void VToolPointOfIntersectionCurves::setDialog() dialogTool->SetHCrossPoint(hCrossPoint); dialogTool->SetPointName(p->name()); dialogTool->SetNotes(m_notes); + dialogTool->SetCurve1AliasSuffix1(m_curve1AliasSuffix1); + dialogTool->SetCurve1AliasSuffix2(m_curve1AliasSuffix2); + dialogTool->SetCurve2AliasSuffix1(m_curve2AliasSuffix1); + dialogTool->SetCurve2AliasSuffix2(m_curve2AliasSuffix2); } //--------------------------------------------------------------------------------------------------------------------- @@ -106,6 +114,10 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(const QPo initData.parse = Document::FullParse; initData.typeCreation = Source::FromGui; initData.notes = dialogTool->GetNotes(); + initData.curve1AliasSuffix1 = dialogTool->GetCurve1AliasSuffix1(); + initData.curve1AliasSuffix2 = dialogTool->GetCurve1AliasSuffix2(); + initData.curve2AliasSuffix1 = dialogTool->GetCurve2AliasSuffix1(); + initData.curve2AliasSuffix2 = dialogTool->GetCurve2AliasSuffix2(); VToolPointOfIntersectionCurves *point = Create(initData); if (point != nullptr) @@ -144,22 +156,31 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(VToolPoin initData.id = initData.data->AddGObject(p); initData.curve1Segments = VToolSinglePoint::InitSegments(curve1->getType(), segLength1, p, - initData.firstCurveId, initData.data); + initData.firstCurveId, initData.data, + initData.curve1AliasSuffix1, + initData.curve1AliasSuffix2); initData.curve2Segments = VToolSinglePoint::InitSegments(curve2->getType(), segLength2, p, - initData.secondCurveId, initData.data); + initData.secondCurveId, initData.data, + initData.curve2AliasSuffix1, + initData.curve2AliasSuffix2); } else { initData.data->UpdateGObject(initData.id, p); initData.curve1Segments = VToolSinglePoint::InitSegments(curve1->getType(), segLength1, p, - initData.firstCurveId, initData.data); + initData.firstCurveId, initData.data, + initData.curve1AliasSuffix1, + initData.curve1AliasSuffix2); initData.curve2Segments = VToolSinglePoint::InitSegments(curve2->getType(), segLength2, p, - initData.secondCurveId, initData.data); + initData.secondCurveId, initData.data, + initData.curve2AliasSuffix1, + initData.curve2AliasSuffix2); if (initData.parse != Document::FullParse) { initData.doc->UpdateToolData(initData.id, initData.data); + } } @@ -174,6 +195,11 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(VToolPoin initData.doc->IncrementReferens(curve2->getIdTool()); return point; } + + auto *tool = qobject_cast(VAbstractPattern::getTool(initData.id)); + tool->SetCurve1Segments(initData.curve1Segments); + tool->SetCurve2Segments(initData.curve2Segments); + return nullptr; } @@ -373,7 +399,7 @@ void VToolPointOfIntersectionCurves::SaveDialog(QDomElement &domElement, QList &newDependencies) { SCASSERT(not m_dialog.isNull()) - auto dialogTool = qobject_cast(m_dialog); + auto *dialogTool = qobject_cast(m_dialog); SCASSERT(dialogTool != nullptr) AddDependence(oldDependencies, firstCurveId); @@ -386,6 +412,14 @@ void VToolPointOfIntersectionCurves::SaveDialog(QDomElement &domElement, QListSetAttribute(domElement, AttrCurve2, QString().setNum(dialogTool->GetSecondCurveId())); doc->SetAttribute(domElement, AttrVCrossPoint, QString().setNum(static_cast(dialogTool->GetVCrossPoint()))); doc->SetAttribute(domElement, AttrHCrossPoint, QString().setNum(static_cast(dialogTool->GetHCrossPoint()))); + doc->SetAttributeOrRemoveIf(domElement, AttrCurve1Alias1, dialogTool->GetCurve1AliasSuffix1(), + dialogTool->GetCurve1AliasSuffix1().isEmpty()); + doc->SetAttributeOrRemoveIf(domElement, AttrCurve1Alias2, dialogTool->GetCurve1AliasSuffix2(), + dialogTool->GetCurve1AliasSuffix2().isEmpty()); + doc->SetAttributeOrRemoveIf(domElement, AttrCurve2Alias1, dialogTool->GetCurve2AliasSuffix1(), + dialogTool->GetCurve2AliasSuffix1().isEmpty()); + doc->SetAttributeOrRemoveIf(domElement, AttrCurve2Alias2, dialogTool->GetCurve2AliasSuffix2(), + dialogTool->GetCurve2AliasSuffix2().isEmpty()); const QString notes = dialogTool->GetNotes(); doc->SetAttributeOrRemoveIf(domElement, AttrNotes, notes, notes.isEmpty()); @@ -401,6 +435,10 @@ void VToolPointOfIntersectionCurves::SaveOptions(QDomElement &tag, QSharedPointe doc->SetAttribute(tag, AttrCurve2, secondCurveId); doc->SetAttribute(tag, AttrVCrossPoint, static_cast(vCrossPoint)); doc->SetAttribute(tag, AttrHCrossPoint, static_cast(hCrossPoint)); + doc->SetAttributeOrRemoveIf(tag, AttrCurve1Alias1, m_curve1AliasSuffix1, m_curve1AliasSuffix1.isEmpty()); + doc->SetAttributeOrRemoveIf(tag, AttrCurve1Alias2, m_curve1AliasSuffix2, m_curve1AliasSuffix2.isEmpty()); + doc->SetAttributeOrRemoveIf(tag, AttrCurve2Alias1, m_curve2AliasSuffix1, m_curve2AliasSuffix1.isEmpty()); + doc->SetAttributeOrRemoveIf(tag, AttrCurve2Alias2, m_curve2AliasSuffix2, m_curve2AliasSuffix2.isEmpty()); } //--------------------------------------------------------------------------------------------------------------------- @@ -408,10 +446,16 @@ void VToolPointOfIntersectionCurves::ReadToolAttributes(const QDomElement &domEl { VToolSinglePoint::ReadToolAttributes(domElement); - firstCurveId = doc->GetParametrUInt(domElement, AttrCurve1, NULL_ID_STR); - secondCurveId = doc->GetParametrUInt(domElement, AttrCurve2, NULL_ID_STR); - vCrossPoint = static_cast(doc->GetParametrUInt(domElement, AttrVCrossPoint, QChar('1'))); - hCrossPoint = static_cast(doc->GetParametrUInt(domElement, AttrHCrossPoint, QChar('1'))); + firstCurveId = VAbstractPattern::GetParametrUInt(domElement, AttrCurve1, NULL_ID_STR); + secondCurveId = VAbstractPattern::GetParametrUInt(domElement, AttrCurve2, NULL_ID_STR); + vCrossPoint = static_cast(VAbstractPattern::GetParametrUInt(domElement, AttrVCrossPoint, + QChar('1'))); + hCrossPoint = static_cast(VAbstractPattern::GetParametrUInt(domElement, AttrHCrossPoint, + QChar('1'))); + m_curve1AliasSuffix1 = VAbstractPattern::GetParametrEmptyString(domElement, AttrCurve1Alias1); + m_curve1AliasSuffix2 = VAbstractPattern::GetParametrEmptyString(domElement, AttrCurve1Alias2); + m_curve2AliasSuffix1 = VAbstractPattern::GetParametrEmptyString(domElement, AttrCurve2Alias1); + m_curve2AliasSuffix2 = VAbstractPattern::GetParametrEmptyString(domElement, AttrCurve2Alias2); } //--------------------------------------------------------------------------------------------------------------------- @@ -450,3 +494,15 @@ auto VToolPointOfIntersectionCurves::MakeToolTip() const -> QString return toolTip; } + +//--------------------------------------------------------------------------------------------------------------------- +void VToolPointOfIntersectionCurves::SetCurve1Segments(const QPair &segments) +{ + m_curve1Segments = segments; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VToolPointOfIntersectionCurves::SetCurve2Segments(const QPair &segments) +{ + m_curve2Segments = segments; +} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h index ca76efeac..f316f5ca4 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h @@ -53,6 +53,10 @@ struct VToolPointOfIntersectionCurvesInitData : VToolSinglePointInitData HCrossCurvesPoint hCrossPoint{HCrossCurvesPoint::LeftmostPoint}; QPair curve1Segments{}; QPair curve2Segments{}; + QString curve1AliasSuffix1{}; + QString curve1AliasSuffix2{}; + QString curve2AliasSuffix1{}; + QString curve2AliasSuffix2{}; }; class VToolPointOfIntersectionCurves : public VToolSinglePoint @@ -89,6 +93,9 @@ protected: virtual void ReadToolAttributes(const QDomElement &domElement) override; virtual void SetVisualization() override; virtual auto MakeToolTip() const -> QString override; + + void SetCurve1Segments(const QPair &segments); + void SetCurve2Segments(const QPair &segments); private: Q_DISABLE_COPY(VToolPointOfIntersectionCurves) @@ -101,6 +108,11 @@ private: QPair m_curve1Segments{}; QPair m_curve2Segments{}; + QString m_curve1AliasSuffix1{}; + QString m_curve1AliasSuffix2{}; + QString m_curve2AliasSuffix1{}; + QString m_curve2AliasSuffix2{}; + explicit VToolPointOfIntersectionCurves(const VToolPointOfIntersectionCurvesInitData &initData, QGraphicsItem *parent = nullptr); }; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index a0cffaf69..a91245fbe 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -396,14 +396,15 @@ void VToolSinglePoint::ToolSelectionType(const SelectionType &type) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wswitch-default") auto VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId, - VContainer *data) -> QPair + VContainer *data, const QString &alias1, + const QString &alias2) -> QPair { switch(curveType) { case GOType::EllipticalArc: - return InitArc(data, segLength, p, curveId); + return InitArc(data, segLength, p, curveId, alias1, alias2); case GOType::Arc: - return InitArc(data, segLength, p, curveId); + return InitArc(data, segLength, p, curveId, alias1, alias2); case GOType::CubicBezier: case GOType::Spline: { @@ -442,12 +443,19 @@ auto VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPo delete spl2; } + spline1->SetAliasSuffix(alias1); + spline2->SetAliasSuffix(alias2); + data->RegisterUniqueName(spline1); data->AddSpline(spline1, NULL_ID, p->id()); data->RegisterUniqueName(spline2); data->AddSpline(spline2, NULL_ID, p->id()); + // Because we don't store segments, but only data about them we must register the names manually + data->RegisterUniqueName(spline1); + data->RegisterUniqueName(spline2); + return qMakePair(spline1->ObjectName(), spline2->ObjectName()); } case GOType::CubicBezierPath: @@ -491,12 +499,19 @@ auto VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPo delete splPath2; } + splP1->SetAliasSuffix(alias1); + splP2->SetAliasSuffix(alias2); + data->RegisterUniqueName(splP1); data->AddSpline(splP1, NULL_ID, p->id()); data->RegisterUniqueName(splP2); data->AddSpline(splP2, NULL_ID, p->id()); + // Because we don't store segments, but only data about them we must register the names manually + data->RegisterUniqueName(splP1); + data->RegisterUniqueName(splP2); + return qMakePair(splP1->ObjectName(), splP2->ObjectName()); } case GOType::Point: diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h index aa8cf3f27..93a86a224 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h @@ -108,9 +108,10 @@ protected: virtual void ChangeLabelVisibility(quint32 id, bool visible) override; template - static QPair InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId); + static QPair InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId, + const QString &alias1, const QString &alias2); static QPair InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId, - VContainer *data); + VContainer *data, const QString &alias1, const QString &alias2); private: Q_DISABLE_COPY(VToolSinglePoint) }; @@ -118,7 +119,8 @@ private: //--------------------------------------------------------------------------------------------------------------------- template inline auto VToolSinglePoint::InitArc(VContainer *data, qreal segLength, const VPointF *p, - quint32 curveId) -> QPair + quint32 curveId, const QString &alias1, + const QString &alias2) -> QPair { QSharedPointer a1; QSharedPointer a2; @@ -140,6 +142,9 @@ inline auto VToolSinglePoint::InitArc(VContainer *data, qreal segLength, const V arc1.setId(p->id() + 1); arc2.setId(p->id() + 2); + arc1.SetAliasSuffix(alias1); + arc2.SetAliasSuffix(alias2); + if (not VFuzzyComparePossibleNulls(segLength, -1)) { a1 = QSharedPointer(new Item(arc1)); @@ -158,6 +163,10 @@ inline auto VToolSinglePoint::InitArc(VContainer *data, qreal segLength, const V data->AddArc(a1, arc1.id(), p->id()); data->AddArc(a2, arc2.id(), p->id()); + // Because we don't store segments, but only data about them we must register the names manually + data->RegisterUniqueName(a1); + data->RegisterUniqueName(a2); + return qMakePair(arc1.ObjectName(), arc2.ObjectName()); } From 6abddfd24052ca31523810b9f90e725f3689374c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 10 May 2021 16:39:17 +0300 Subject: [PATCH 06/29] Standard passmarks length for all pieces. Closes #124 --- ChangeLog.txt | 1 + .../dialogs/dialogpatternproperties.cpp | 84 ++++++++++-- .../dialogs/dialogpatternproperties.h | 27 ++-- .../dialogs/dialogpatternproperties.ui | 34 ++--- src/app/valentina/mainwindow.cpp | 2 + src/app/valentina/xml/vpattern.cpp | 8 +- src/app/valentina/xml/vpattern.h | 5 +- src/libs/ifc/schema/pattern/v0.8.11.xsd | 1 + src/libs/ifc/xml/vabstractpattern.cpp | 25 ++++ src/libs/ifc/xml/vabstractpattern.h | 3 + src/libs/vlayout/vabstractpiece.cpp | 6 +- src/libs/vpatterndb/vpassmark.cpp | 120 ++++++++++-------- src/libs/vpatterndb/vpassmark.h | 2 +- src/libs/vpatterndb/vpatterndb.pro | 2 +- src/libs/vpatterndb/vpiece.cpp | 35 +++++ src/libs/vpatterndb/vpiece.h | 2 + src/libs/vtest/abstracttest.cpp | 5 + src/libs/vtools/tools/vtoolseamallowance.cpp | 8 ++ src/libs/vtools/tools/vtoolseamallowance.h | 1 + src/libs/vwidgets/vmaingraphicsscene.cpp | 6 + src/libs/vwidgets/vmaingraphicsscene.h | 2 + src/test/CollectionTest/CollectionTest.pro | 2 +- .../TranslationsTest/TranslationsTest.pro | 2 +- 23 files changed, 281 insertions(+), 102 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 760b1a585..e194e4812 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -12,6 +12,7 @@ - Fix regression. Incorrect data caching. - Improve tool tooltip. Show segment names and aliases. - Alias support for tools Point of intersection curve and axis and Point of intersection curves. +- [smart-pattern/valentina#124] Standard passmarks length for all pieces. # Version 0.7.46 Mar 31, 2021 - Fix incorrect calculation of value for multisize measurements in Valentina. diff --git a/src/app/valentina/dialogs/dialogpatternproperties.cpp b/src/app/valentina/dialogs/dialogpatternproperties.cpp index 30e261af4..df7eabf17 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.cpp +++ b/src/app/valentina/dialogs/dialogpatternproperties.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "../xml/vpattern.h" #include "../vpatterndb/vcontainer.h" @@ -42,22 +43,14 @@ #include "../vtools/dialogs/support/dialogeditlabel.h" #include "dialogknownmaterials.h" #include "../vmisc/vsettings.h" +#include "../qmuparser/qmudef.h" //--------------------------------------------------------------------------------------------------------------------- DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pattern, QWidget *parent) : QDialog(parent), ui(new Ui::DialogPatternProperties), doc(doc), - pattern(pattern), - data(QMap()), - descriptionChanged(false), - gradationChanged(false), - defaultChanged(false), - securityChanged(false), - deleteAction(nullptr), - changeImageAction(nullptr), - saveImageAction(nullptr), - showImageAction(nullptr) + pattern(pattern) { ui->setupUi(this); @@ -137,8 +130,27 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pat ui->checkBoxPatternReadOnly->setDisabled(true); } + //----------------------- Passmark length + m_variables = pattern->DataMeasurements().keys() + pattern->DataIncrements().keys(); + m_completer = new QCompleter(m_variables, this); + m_completer->setCompletionMode(QCompleter::PopupCompletion); + m_completer->setModelSorting(QCompleter::UnsortedModel); + m_completer->setFilterMode(Qt::MatchStartsWith); + m_completer->setCaseSensitivity(Qt::CaseSensitive); + + ui->lineEditPassmarkLength->setCompleter(m_completer); + connect(ui->lineEditPassmarkLength, &QLineEdit::textEdited, this, [this]() + { + ValidatePassmarkLength(); + DescEdited(); + }); + + ui->lineEditPassmarkLength->installEventFilter(this); + m_oldPassmarkLength = doc->GetPassmarkLengthVariable(); + ui->lineEditPassmarkLength->setText(m_oldPassmarkLength); + ValidatePassmarkLength(); + //Initialization change value. Set to default value after initialization - gradationChanged = false; defaultChanged = false; securityChanged = false; } @@ -149,6 +161,27 @@ DialogPatternProperties::~DialogPatternProperties() delete ui; } +//--------------------------------------------------------------------------------------------------------------------- +auto DialogPatternProperties::eventFilter(QObject *object, QEvent *event) -> bool +{ + if (ui->lineEditPassmarkLength == qobject_cast(object)) + { + if (event->type() == QEvent::KeyPress) + { + auto *keyEvent = static_cast(event); + if ((keyEvent->key() == Qt::Key_Space) && ((keyEvent->modifiers() & Qt::ControlModifier) != 0U)) + { + m_completer->complete(); + return true; + } + } + + return false; + } + + return QDialog::eventFilter(object, event); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogPatternProperties::Apply() { @@ -188,8 +221,16 @@ void DialogPatternProperties::SaveDescription() doc->SetNotes(ui->plainTextEditTechNotes->document()->toPlainText()); doc->SetDescription(ui->plainTextEditDescription->document()->toPlainText()); doc->SetLabelPrefix(qvariant_cast(ui->comboBoxLabelLanguage->currentData())); + doc->SetPassmarkLengthVariable(ui->lineEditPassmarkLength->text()); + + if (m_oldPassmarkLength != ui->lineEditPassmarkLength->text()) + { + emit UpddatePieces(); + m_oldPassmarkLength = ui->lineEditPassmarkLength->text(); + } descriptionChanged = false; + emit doc->patternChanged(false); } } @@ -219,6 +260,27 @@ QImage DialogPatternProperties::GetImage() return image; } +//--------------------------------------------------------------------------------------------------------------------- +void DialogPatternProperties::ValidatePassmarkLength() const +{ + const QString text = ui->lineEditPassmarkLength->text(); + QPalette palette = ui->lineEditPassmarkLength->palette(); + const QPalette::ColorRole foregroundRole = ui->lineEditPassmarkLength->foregroundRole(); + + QRegularExpression rx(NameRegExp()); + if (not text.isEmpty()) + { + palette.setColor(foregroundRole, + rx.match(text).hasMatch() && m_variables.contains(text) ? Qt::black : Qt::red); + } + else + { + palette.setColor(foregroundRole, Qt::black); + } + + ui->lineEditPassmarkLength->setPalette(palette); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogPatternProperties::InitImage() { diff --git a/src/app/valentina/dialogs/dialogpatternproperties.h b/src/app/valentina/dialogs/dialogpatternproperties.h index 188d3008d..ac756ef16 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.h +++ b/src/app/valentina/dialogs/dialogpatternproperties.h @@ -38,6 +38,7 @@ class VPattern; class VContainer; class QCheckBox; +class QCompleter; namespace Ui { @@ -50,6 +51,10 @@ class DialogPatternProperties : public QDialog public: explicit DialogPatternProperties(VPattern *doc, VContainer *pattern, QWidget *parent = nullptr); virtual ~DialogPatternProperties() override; +signals: + void UpddatePieces(); +protected: + virtual bool eventFilter(QObject *object, QEvent *event) override; private slots: void Apply(); void Ok(); @@ -61,21 +66,25 @@ private: Ui::DialogPatternProperties *ui; VPattern *doc; VContainer *pattern; - QMap data; - bool descriptionChanged; - bool gradationChanged; - bool defaultChanged; - bool securityChanged; - QAction *deleteAction; - QAction *changeImageAction; - QAction *saveImageAction; - QAction *showImageAction; + QMap data{}; + bool descriptionChanged{false}; + bool defaultChanged{false}; + bool securityChanged{false}; + QAction *deleteAction{nullptr}; + QAction *changeImageAction{nullptr}; + QAction *saveImageAction{nullptr}; + QAction *showImageAction{nullptr}; + QCompleter *m_completer{nullptr}; + QStringList m_variables{}; + QString m_oldPassmarkLength{}; void SaveDescription(); void SaveReadOnlyState(); void InitImage(); QImage GetImage(); + + void ValidatePassmarkLength() const; }; #endif // DIALOGPATTERNPROPERTIES_H diff --git a/src/app/valentina/dialogs/dialogpatternproperties.ui b/src/app/valentina/dialogs/dialogpatternproperties.ui index d28f9a1aa..e282095e7 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.ui +++ b/src/app/valentina/dialogs/dialogpatternproperties.ui @@ -6,8 +6,8 @@ 0 0 - 571 - 491 + 493 + 582 @@ -81,8 +81,11 @@ - - + + + QFormLayout::ExpandingFieldsGrow + + @@ -95,7 +98,7 @@ - + @@ -105,18 +108,19 @@ - - - - Qt::Horizontal + + + + Passmark length: - - - 40 - 20 - + + + + + + true - + diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 943114667..cd1595834 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -4923,6 +4923,8 @@ void MainWindow::CreateActions() connect(ui->actionPattern_properties, &QAction::triggered, this, [this]() { DialogPatternProperties proper(doc, pattern, this); + connect(&proper, &DialogPatternProperties::UpddatePieces, sceneDetails, + &VMainGraphicsScene::UpdatePiecePassmarks); proper.exec(); }); diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 89f590e97..550bbc3ba 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -3700,21 +3700,21 @@ void VPattern::RefreshPieceGeometry() VMainGraphicsView::NewSceneRect(sceneDetail, VAbstractValApplication::VApp()->getSceneView()); }); - if (VApplication::VApp()->IsGUIMode() && m_parsing) + if (VApplication::IsGUIMode() && m_parsing) { return; } for(auto pieceId : qAsConst(updatePieces)) { - if (VApplication::VApp()->IsGUIMode() && m_parsing) + if (VApplication::IsGUIMode() && m_parsing) { return; } try { - if (VToolSeamAllowance *piece = qobject_cast(VAbstractPattern::getTool(pieceId))) + if (auto *piece = qobject_cast(VAbstractPattern::getTool(pieceId))) { piece->RefreshGeometry(); } @@ -3726,7 +3726,7 @@ void VPattern::RefreshPieceGeometry() QApplication::processEvents(); - if (VApplication::VApp()->IsGUIMode() && m_parsing) + if (VApplication::IsGUIMode() && m_parsing) { return; } diff --git a/src/app/valentina/xml/vpattern.h b/src/app/valentina/xml/vpattern.h index 97c182852..c99c393f0 100644 --- a/src/app/valentina/xml/vpattern.h +++ b/src/app/valentina/xml/vpattern.h @@ -119,12 +119,11 @@ signals: public slots: virtual void LiteParseTree(const Document &parse) override; + void RefreshPieceGeometry(); + protected: virtual void customEvent(QEvent * event) override; -private slots: - void RefreshPieceGeometry(); - private: Q_DISABLE_COPY(VPattern) diff --git a/src/libs/ifc/schema/pattern/v0.8.11.xsd b/src/libs/ifc/schema/pattern/v0.8.11.xsd index b82690505..ea5ac8902 100644 --- a/src/libs/ifc/schema/pattern/v0.8.11.xsd +++ b/src/libs/ifc/schema/pattern/v0.8.11.xsd @@ -762,6 +762,7 @@ + diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 1507381da..68688fffb 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -1200,6 +1200,31 @@ bool VAbstractPattern::GetPatternWasChanged() const return patternLabelWasChanged; } +//--------------------------------------------------------------------------------------------------------------------- +QString VAbstractPattern::GetPassmarkLengthVariable() const +{ + const QDomElement pattern = documentElement(); + + if (pattern.isNull()) + { + return {}; + } + + return GetParametrEmptyString(pattern, AttrPassmarkLength); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::SetPassmarkLengthVariable(const QString &name) +{ + QDomElement pattern = documentElement(); + + if (not pattern.isNull()) + { + SetAttribute(pattern, AttrPassmarkLength, name); + modified = true; + } +} + //--------------------------------------------------------------------------------------------------------------------- QString VAbstractPattern::GetImage() const { diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 5b580d732..581407873 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -192,6 +192,9 @@ public: void SetPatternWasChanged(bool changed); bool GetPatternWasChanged() const; + QString GetPassmarkLengthVariable() const; + void SetPassmarkLengthVariable(const QString &name); + QString GetImage() const; QString GetImageExtension() const; void SetImage(const QString &text, const QString &extension); diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index d90df91a8..462dfeac4 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -1646,10 +1646,8 @@ qreal VSAPoint::PassmarkLength(qreal width) const passmarkLength = qMin(passmarkLength, maxPassmarkLength); return passmarkLength; } - else - { - return m_passmarkLength; - } + + return m_passmarkLength; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vpatterndb/vpassmark.cpp b/src/libs/vpatterndb/vpassmark.cpp index 7e552e790..f7135acde 100644 --- a/src/libs/vpatterndb/vpassmark.cpp +++ b/src/libs/vpatterndb/vpassmark.cpp @@ -537,6 +537,43 @@ QVector CreatePassmarkLines(PassmarkLineType lineType, PassmarkAngleType return passmarksLines; } +//--------------------------------------------------------------------------------------------------------------------- +auto PassmarkLength(const VPiecePassmarkData &passmarkData, qreal width, bool &ok) -> qreal +{ + qreal length = 0; + if (not passmarkData.passmarkSAPoint.IsManualPasskmarkLength()) + { + if (passmarkData.globalPassmarkLength > accuracyPointOnLine) + { + ok = true; + return passmarkData.globalPassmarkLength; + } + + length = qMin(width * VSAPoint::passmarkFactor, VSAPoint::maxPassmarkLength); + + if (length <= accuracyPointOnLine) + { + const QString errorMsg = QObject::tr("Found null notch for point '%1' in piece '%2'. Length is less " + "than minimal allowed.") + .arg(passmarkData.nodeName, passmarkData.pieceName); + VAbstractApplication::VApp()->IsPedantic() + ? throw VException(errorMsg) + : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; + + ok = false; + return length; + } + + ok = true; + return length; + } + + length = passmarkData.passmarkSAPoint.GetPasskmarkLength(); + + ok = true; + return length; +} + //--------------------------------------------------------------------------------------------------------------------- QVector PassmarkBisectorBaseLine(PassmarkStatus seamPassmarkType, const VPiecePassmarkData &passmarkData, const QPointF &seamPassmarkSAPoint, const QVector &seamAllowance) @@ -572,14 +609,11 @@ QVector PassmarkBisectorBaseLine(PassmarkStatus seamPassmarkType, const return QVector(); } - const qreal length = passmarkData.passmarkSAPoint.PassmarkLength(passmarkData.saWidth); - if (not passmarkData.passmarkSAPoint.IsManualPasskmarkLength() && length <= accuracyPointOnLine) + bool ok = false; + const qreal length = PassmarkLength(passmarkData, passmarkData.passmarkSAPoint.MaxLocalSA(passmarkData.saWidth), + ok); + if (not ok) { - const QString errorMsg = QObject::tr("Found null notch for point '%1' in piece '%2'. Length is less " - "than minimal allowed.") - .arg(passmarkData.nodeName, passmarkData.pieceName); - VAbstractApplication::VApp()->IsPedantic() ? throw VException(errorMsg) : - qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; return QVector(); } @@ -624,6 +658,7 @@ QJsonObject VPiecePassmarkData::toJson() const {"isShowSecondPassmark", isShowSecondPassmark}, {"passmarkIndex", passmarkIndex}, {"id", static_cast(id)}, + {"globalPassmarkLength", static_cast(globalPassmarkLength)}, }; return dataObject; @@ -781,15 +816,11 @@ QVector VPassmark::BuiltInSAPassmarkBaseLine(const VPiece &piece) const qreal length = 0; if (not piece.IsSeamAllowanceBuiltIn()) { - length = m_data.passmarkSAPoint.PassmarkLength(m_data.saWidth); - if (not m_data.passmarkSAPoint.IsManualPasskmarkLength() && length <= accuracyPointOnLine) + bool ok = false; + length = PassmarkLength(m_data, m_data.passmarkSAPoint.MaxLocalSA(m_data.saWidth), ok); + if (not ok) { - const QString errorMsg = QObject::tr("Found null notch for point '%1' in piece '%2'. Length is less " - "than minimal allowed.") - .arg(m_data.nodeName, m_data.pieceName); - VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionInvalidNotch(errorMsg) : - qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; - return QVector(); + return {}; } } else @@ -888,34 +919,23 @@ QVector VPassmark::SAPassmarkBaseLine(const QVector &seamAllowa if (intersections.last() != m_data.passmarkSAPoint) { line = QLineF(intersections.last(), m_data.passmarkSAPoint); - if (not m_data.passmarkSAPoint.IsManualPasskmarkLength()) + + bool ok = false; + const qreal length = PassmarkLength(m_data, width, ok); + if (not ok) { - const qreal length = qMin(width * VSAPoint::passmarkFactor, VSAPoint::maxPassmarkLength); - if (length <= accuracyPointOnLine) - { - const QString errorMsg = QObject::tr("Found null notch for point '%1' in piece '%2'. Length is " - "less than minimal allowed.") - .arg(m_data.nodeName, m_data.pieceName); - VAbstractApplication::VApp()->IsPedantic() ? throw VException(errorMsg) : - qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; - return QLineF(); - } - line.setLength(length); - } - else - { - line.setLength(m_data.passmarkSAPoint.GetPasskmarkLength()); + return QLineF(); } + line.setLength(length); + return line; } - else - { - const QString errorMsg = QObject::tr("Cannot calculate a notch for point '%1' in piece '%2'. Notch " - "collapse.") - .arg(m_data.nodeName, m_data.pieceName); - VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionInvalidNotch(errorMsg) : - qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; - } + + const QString errorMsg = QObject::tr("Cannot calculate a notch for point '%1' in piece '%2'. Notch " + "collapse.") + .arg(m_data.nodeName, m_data.pieceName); + VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionInvalidNotch(errorMsg) : + qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; } else { @@ -931,21 +951,17 @@ QVector VPassmark::SAPassmarkBaseLine(const QVector &seamAllowa if (m_data.passmarkAngleType == PassmarkAngleType::Straightforward) { - const qreal length = m_data.passmarkSAPoint.PassmarkLength(m_data.saWidth); - if (not m_data.passmarkSAPoint.IsManualPasskmarkLength() && length <= accuracyPointOnLine) + bool ok = false; + const qreal length = PassmarkLength(m_data, m_data.passmarkSAPoint.MaxLocalSA(m_data.saWidth), ok); + + if (not ok) { - const QString errorMsg = QObject::tr("Found null notch for point '%1' in piece '%2'. Length is less " - "than minimal allowed.") - .arg(m_data.nodeName, m_data.pieceName); - VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionInvalidNotch(errorMsg) : - qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; - } - else - { - QLineF line = QLineF(seamPassmarkSAPoint, m_data.passmarkSAPoint); - line.setLength(length); - return QVector({line}); + return {}; } + + QLineF line = QLineF(seamPassmarkSAPoint, m_data.passmarkSAPoint); + line.setLength(length); + return {line}; } else if (m_data.passmarkAngleType == PassmarkAngleType::Bisector) { diff --git a/src/libs/vpatterndb/vpassmark.h b/src/libs/vpatterndb/vpassmark.h index f4cf693e2..648b7e34f 100644 --- a/src/libs/vpatterndb/vpassmark.h +++ b/src/libs/vpatterndb/vpassmark.h @@ -61,6 +61,7 @@ struct VPiecePassmarkData bool isShowSecondPassmark{true}; int passmarkIndex{-1}; vidtype id{NULL_ID}; + qreal globalPassmarkLength{0}; QJsonObject toJson() const; }; @@ -102,7 +103,6 @@ private: bool m_null{true}; QVector MakeSAPassmark(const QVector &seamAllowance, PassmarkSide side) const; - }; #endif // VPASSMARK_H diff --git a/src/libs/vpatterndb/vpatterndb.pro b/src/libs/vpatterndb/vpatterndb.pro index 49c48e227..d6bc37df4 100644 --- a/src/libs/vpatterndb/vpatterndb.pro +++ b/src/libs/vpatterndb/vpatterndb.pro @@ -7,7 +7,7 @@ # File with common stuff for whole project include(../../../common.pri) -QT += core widgets printsupport +QT += core widgets printsupport xmlpatterns concurrent # Name of the library TARGET = vpatterndb diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 959cca32f..8d1eba71a 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -38,6 +38,7 @@ #include "../vmisc/compatibility.h" #include "../ifc/exception/vexceptioninvalidnotch.h" #include "../vlayout/testpath.h" +#include "../ifc/xml/vabstractpattern.h" #include #include @@ -1106,6 +1107,7 @@ VPassmark VPiece::CreatePassmark(const QVector &path, int previousIn passmarkData.isShowSecondPassmark = path.at(passmarkIndex).IsShowSecondPassmark(); passmarkData.passmarkIndex = passmarkIndex; passmarkData.id = path.at(passmarkIndex).GetId(); + passmarkData.globalPassmarkLength = ToPixel(GlobalPassmarkLength(data), *data->GetPatternUnit()); return VPassmark(passmarkData); } @@ -1170,6 +1172,39 @@ QJsonObject VPiece::DBToJson(const VContainer *data) const return dbObject; } +//--------------------------------------------------------------------------------------------------------------------- +auto VPiece::GlobalPassmarkLength(const VContainer *data) const -> qreal +{ + qreal length = 0; + QString passmarkLengthVariable = VAbstractValApplication::VApp()->getCurrentDocument()->GetPassmarkLengthVariable(); + if (passmarkLengthVariable.isEmpty()) + { + return 0; + } + + try + { + QSharedPointer var = data->GetVariable(passmarkLengthVariable); + length = *var->GetValue(); + + if (length <= accuracyPointOnLine) + { + const QString errorMsg = QObject::tr("Invalid global value for a passmark length. Piece '%1'. Length is " + "less than minimal allowed.") + .arg(GetName()); + VAbstractApplication::VApp()->IsPedantic() + ? throw VException(errorMsg) + : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; + } + } + catch (const VExceptionBadId &) + { + length = 0; + } + + return length; +} + //--------------------------------------------------------------------------------------------------------------------- void VPiece::DumpPiece(const VPiece &piece, const VContainer *data) { diff --git a/src/libs/vpatterndb/vpiece.h b/src/libs/vpatterndb/vpiece.h index 9edb23976..674baecb0 100644 --- a/src/libs/vpatterndb/vpiece.h +++ b/src/libs/vpatterndb/vpiece.h @@ -158,6 +158,8 @@ private: QJsonObject MainPathToJson() const; QJsonObject DBToJson(const VContainer *data) const; + + qreal GlobalPassmarkLength(const VContainer *data) const; }; Q_DECLARE_TYPEINFO(VPiece, Q_MOVABLE_TYPE); diff --git a/src/libs/vtest/abstracttest.cpp b/src/libs/vtest/abstracttest.cpp index 4e814f445..13cf270b0 100644 --- a/src/libs/vtest/abstracttest.cpp +++ b/src/libs/vtest/abstracttest.cpp @@ -266,6 +266,11 @@ void AbstractTest::PassmarkDataFromJson(const QString &json, VPiecePassmarkData vidtype id; AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("id"), id, QString::number(NULL_ID)); data.id = id; + + qreal globalPassmarkLength; + AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("globalPassmarkLength"), globalPassmarkLength, + QString::number(NULL_ID)); + data.globalPassmarkLength = globalPassmarkLength; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index feed82212..25aedee20 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -710,6 +710,13 @@ void VToolSeamAllowance::UpdatePatternInfo() } } +//--------------------------------------------------------------------------------------------------------------------- +void VToolSeamAllowance::UpdatePassmarks() +{ + const VPiece detail = VAbstractTool::data.GetPiece(m_id); + m_passmarks->setPath(detail.PassmarksPath(getData())); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief VToolDetail::UpdateGrainline updates the grain line item @@ -1293,6 +1300,7 @@ VToolSeamAllowance::VToolSeamAllowance(const VToolSeamAllowanceInitData &initDat connect(this, &VToolSeamAllowance::ChoosedTool, m_sceneDetails, &VMainGraphicsScene::ChoosedItem); connect(m_sceneDetails, &VMainGraphicsScene::EnableToolMove, this, &VToolSeamAllowance::EnableToolMove); connect(m_sceneDetails, &VMainGraphicsScene::ItemSelection, this, &VToolSeamAllowance::ToolSelectionType); + connect(m_sceneDetails, &VMainGraphicsScene::UpdatePassmarks, this, &VToolSeamAllowance::UpdatePassmarks); ConnectOutsideSignals(); } diff --git a/src/libs/vtools/tools/vtoolseamallowance.h b/src/libs/vtools/tools/vtoolseamallowance.h index 4c0fd8219..a481c40b6 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.h +++ b/src/libs/vtools/tools/vtoolseamallowance.h @@ -133,6 +133,7 @@ public slots: void Highlight(quint32 id); void UpdateDetailLabel(); void UpdatePatternInfo(); + void UpdatePassmarks(); void ShowOptions(); void DeleteFromMenu(); protected slots: diff --git a/src/libs/vwidgets/vmaingraphicsscene.cpp b/src/libs/vwidgets/vmaingraphicsscene.cpp index 4e0dbf058..8e43d0c26 100644 --- a/src/libs/vwidgets/vmaingraphicsscene.cpp +++ b/src/libs/vwidgets/vmaingraphicsscene.cpp @@ -319,6 +319,12 @@ void VMainGraphicsScene::HighlightItem(quint32 id) emit HighlightDetail(id); } +//--------------------------------------------------------------------------------------------------------------------- +void VMainGraphicsScene::UpdatePiecePassmarks() +{ + emit UpdatePassmarks(); +} + //--------------------------------------------------------------------------------------------------------------------- void VMainGraphicsScene::ToggleLabelSelection(bool enabled) { diff --git a/src/libs/vwidgets/vmaingraphicsscene.h b/src/libs/vwidgets/vmaingraphicsscene.h index 8179cacbd..aced01546 100644 --- a/src/libs/vwidgets/vmaingraphicsscene.h +++ b/src/libs/vwidgets/vmaingraphicsscene.h @@ -74,6 +74,7 @@ public slots: void EnableDetailsMode(bool mode); void ItemsSelection(const SelectionType &type); void HighlightItem(quint32 id); + void UpdatePiecePassmarks(); void ToggleLabelSelection(bool enabled); void TogglePointSelection(bool enabled); @@ -123,6 +124,7 @@ signals: void CurveDetailsMode(bool mode); void ItemSelection(const SelectionType &type); void HighlightDetail(quint32 id); + void UpdatePassmarks(); void EnableLabelItemSelection(bool enable); void EnablePointItemSelection(bool enable); diff --git a/src/test/CollectionTest/CollectionTest.pro b/src/test/CollectionTest/CollectionTest.pro index dbde17e42..109207bd0 100644 --- a/src/test/CollectionTest/CollectionTest.pro +++ b/src/test/CollectionTest/CollectionTest.pro @@ -4,7 +4,7 @@ # #------------------------------------------------- -QT += testlib widgets printsupport concurrent xml +QT += testlib widgets printsupport concurrent xml xmlpatterns QT -= gui diff --git a/src/test/TranslationsTest/TranslationsTest.pro b/src/test/TranslationsTest/TranslationsTest.pro index 919ae2f77..d3c4b34ee 100644 --- a/src/test/TranslationsTest/TranslationsTest.pro +++ b/src/test/TranslationsTest/TranslationsTest.pro @@ -4,7 +4,7 @@ # #------------------------------------------------- -QT += testlib widgets xml printsupport +QT += testlib widgets xml printsupport concurrent xmlpatterns QT -= gui From 2a4082c5a8083e11e8b922b139c35212eadeeec5 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 11 May 2021 10:53:18 +0300 Subject: [PATCH 07/29] Fix build on Windows. --- src/libs/vpatterndb/vpatterndb.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/vpatterndb/vpatterndb.pro b/src/libs/vpatterndb/vpatterndb.pro index d6bc37df4..ecaab14f1 100644 --- a/src/libs/vpatterndb/vpatterndb.pro +++ b/src/libs/vpatterndb/vpatterndb.pro @@ -7,7 +7,7 @@ # File with common stuff for whole project include(../../../common.pri) -QT += core widgets printsupport xmlpatterns concurrent +QT += core widgets printsupport xmlpatterns concurrent xml # Name of the library TARGET = vpatterndb From fd2a69451fce027e57b2d1e7527de16d604e3997 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 11 May 2021 11:19:05 +0300 Subject: [PATCH 08/29] Attempt to fix build on FreeBSD. #126 --- common.pri | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/common.pri b/common.pri index 6662944ef..cbc8df716 100644 --- a/common.pri +++ b/common.pri @@ -279,12 +279,6 @@ defineReplace(FindBuildRevision){ return(\\\"unknown\\\") }else{ # Release mode - macx{ - GIT = /usr/local/bin/git # Can't defeat PATH variable on Mac OS. - }else { - GIT = git # All other platforms are OK. - } - DVCS_HESH=$$system("git rev-parse --short HEAD") isEmpty(DVCS_HESH){ DVCS_HESH = \\\"unknown\\\" # if we can't find build revision left unknown. @@ -298,15 +292,9 @@ defineReplace(FindBuildRevision){ defineReplace(FindLatestTagDistance){ CONFIG(debug, debug|release){ # Debug mode - return(0) + return(\\\"0\\\") }else{ # Release mode - #get latest git tag and it's distance from HEAD - macx{ - GIT = /usr/local/bin/git # Can't defeat PATH variable on Mac OS. - }else { - GIT = GIT # All other platforms all OK. - } # tag is formatted as TAG-N-gSHA: # 1. latest stable version is TAG, or vX.Y.Z @@ -314,10 +302,10 @@ defineReplace(FindLatestTagDistance){ # 3. latest commit is gSHA tag_all = $$system(git describe --tags) tag_split = $$split(tag_all, "-") #split at the dashes - GIT_DISTANCE = $$member(tag_split,1) #get 2nd element of results + GIT_DISTANCE = \\\"$$member(tag_split,1)\\\" #get 2nd element of results isEmpty(GIT_DISTANCE){ - GIT_DISTANCE = 0 # if we can't find local revision left 0. + GIT_DISTANCE = \\\"0\\\" # if we can't find local revision left 0. } message("Latest tag distance:" $${GIT_DISTANCE}) From 8245aa907c700a5a9ac6e72ad0c1221ece7f318c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 11 May 2021 13:16:21 +0300 Subject: [PATCH 09/29] Lupdate. --- share/translations/valentina.ts | 92 +++++ share/translations/valentina_cs_CZ.ts | 92 +++++ share/translations/valentina_de_DE.ts | 92 +++++ share/translations/valentina_el_GR.ts | 92 +++++ share/translations/valentina_en_CA.ts | 92 +++++ share/translations/valentina_en_IN.ts | 92 +++++ share/translations/valentina_en_US.ts | 92 +++++ share/translations/valentina_es_ES.ts | 92 +++++ share/translations/valentina_fi_FI.ts | 92 +++++ share/translations/valentina_fr_FR.ts | 92 +++++ share/translations/valentina_he_IL.ts | 92 +++++ share/translations/valentina_id_ID.ts | 92 +++++ share/translations/valentina_it_IT.ts | 108 ++++- share/translations/valentina_nl_NL.ts | 92 +++++ share/translations/valentina_pl_PL.ts | 92 +++++ share/translations/valentina_pt_BR.ts | 567 ++++++++++++++++---------- share/translations/valentina_ro_RO.ts | 92 +++++ share/translations/valentina_ru_RU.ts | 92 +++++ share/translations/valentina_uk_UA.ts | 92 +++++ share/translations/valentina_zh_CN.ts | 92 +++++ 20 files changed, 2104 insertions(+), 227 deletions(-) diff --git a/share/translations/valentina.ts b/share/translations/valentina.ts index 726655813..5047f99dc 100644 --- a/share/translations/valentina.ts +++ b/share/translations/valentina.ts @@ -1212,6 +1212,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4901,6 +4909,10 @@ Apply settings anyway? yyyy-MM-dd yyyy-MM-dd + + Passmark length: + + DialogPatternXmlEdit @@ -6098,6 +6110,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9561,6 +9589,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10718,6 +10750,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -14229,6 +14265,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14717,6 +14765,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14963,6 +15015,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Length + + + Angle + Angle + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCut @@ -15845,6 +15917,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_cs_CZ.ts b/share/translations/valentina_cs_CZ.ts index 177b93edd..7613f9e47 100644 --- a/share/translations/valentina_cs_CZ.ts +++ b/share/translations/valentina_cs_CZ.ts @@ -1212,6 +1212,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4863,6 +4871,10 @@ Přesto použít nastavení? Label language: Jazyk popisu: + + Passmark length: + + DialogPatternXmlEdit @@ -6048,6 +6060,22 @@ Přesto použít nastavení? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9349,6 +9377,10 @@ Chcete uložit své změny? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10467,6 +10499,10 @@ Tato volba se projeví po opětovném spuštění. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13786,6 +13822,18 @@ Chcete uložit změny? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14270,6 +14318,10 @@ Chcete uložit změny? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14520,6 +14572,26 @@ Chcete uložit změny? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° Chyba při výpočtu bodu '%1'. Není tu žádný průsečík s křivkou '%2' a osou skrze bod '%3' s úhlem %4° + + Length + Délka + + + Angle + Úhel + + + Label + Popis + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15395,6 +15467,26 @@ Chcete uložit změny? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection Chyba při výpočtu bodu '%1'. Křivky '%2' a '%3' nemají žádný průsečík + + Label + Popis + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_de_DE.ts b/share/translations/valentina_de_DE.ts index 87605daaf..3262d064b 100644 --- a/share/translations/valentina_de_DE.ts +++ b/share/translations/valentina_de_DE.ts @@ -1212,6 +1212,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4862,6 +4870,10 @@ Einstellungen trotzdem anwenden? Label language: Bezeichnungs Sprache: + + Passmark length: + + DialogPatternXmlEdit @@ -6047,6 +6059,22 @@ Einstellungen trotzdem anwenden? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9346,6 +9374,10 @@ Sollen die Änderungen gespeichert werden? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10464,6 +10496,10 @@ Diese Option wird nach einem Neustart aktiv. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13780,6 +13816,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14264,6 +14312,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14510,6 +14562,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Länge + + + Angle + Winkel + + + Label + Bezeichnung + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15353,6 +15425,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + Bezeichnung + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_el_GR.ts b/share/translations/valentina_el_GR.ts index 4858e9121..827e01d3b 100644 --- a/share/translations/valentina_el_GR.ts +++ b/share/translations/valentina_el_GR.ts @@ -1192,6 +1192,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4786,6 +4794,10 @@ Apply settings anyway? Label language: Γλώσσα ετικέτας: + + Passmark length: + + DialogPatternXmlEdit @@ -5963,6 +5975,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9198,6 +9226,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10232,6 +10264,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QmuParser @@ -13305,6 +13341,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -13789,6 +13837,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14023,6 +14075,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Μήκος + + + Angle + Γωνία + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -14890,6 +14962,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_en_CA.ts b/share/translations/valentina_en_CA.ts index f4a8867d9..09ce9dd80 100644 --- a/share/translations/valentina_en_CA.ts +++ b/share/translations/valentina_en_CA.ts @@ -1212,6 +1212,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4861,6 +4869,10 @@ Apply settings anyway? Label language: Label language: + + Passmark length: + + DialogPatternXmlEdit @@ -6046,6 +6058,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9345,6 +9373,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10462,6 +10494,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13781,6 +13817,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14265,6 +14313,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14511,6 +14563,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Length + + + Angle + Angle + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15386,6 +15458,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_en_IN.ts b/share/translations/valentina_en_IN.ts index abfbf3aab..977bcd6a7 100644 --- a/share/translations/valentina_en_IN.ts +++ b/share/translations/valentina_en_IN.ts @@ -1212,6 +1212,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4861,6 +4869,10 @@ Apply settings anyway? Label language: Label language: + + Passmark length: + + DialogPatternXmlEdit @@ -6046,6 +6058,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9345,6 +9373,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10462,6 +10494,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13781,6 +13817,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14265,6 +14313,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14511,6 +14563,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Length + + + Angle + Angle + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15386,6 +15458,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_en_US.ts b/share/translations/valentina_en_US.ts index fb6764e85..bb0243947 100644 --- a/share/translations/valentina_en_US.ts +++ b/share/translations/valentina_en_US.ts @@ -1212,6 +1212,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4861,6 +4869,10 @@ Apply settings anyway? Label language: Label language: + + Passmark length: + + DialogPatternXmlEdit @@ -6046,6 +6058,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9345,6 +9373,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10462,6 +10494,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13781,6 +13817,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14265,6 +14313,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14511,6 +14563,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Length + + + Angle + Angle + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15386,6 +15458,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_es_ES.ts b/share/translations/valentina_es_ES.ts index bb1a519bc..90de2e595 100644 --- a/share/translations/valentina_es_ES.ts +++ b/share/translations/valentina_es_ES.ts @@ -1212,6 +1212,14 @@ Notes Notas + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4862,6 +4870,10 @@ Aplicar características de todos modos? Label language: Idioma de etiquetas: + + Passmark length: + + DialogPatternXmlEdit @@ -6047,6 +6059,22 @@ Aplicar características de todos modos? Notes Notas + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9347,6 +9375,10 @@ el patrón. Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10465,6 +10497,10 @@ Esta opción surtirá efecto después de reiniciar. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13784,6 +13820,18 @@ Quieres guardar los cambios? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14268,6 +14316,10 @@ Quieres guardar los cambios? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. Valor para medida final '%1' es infinito o no es un numero. Por favor, revise sus cálculos. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14518,6 +14570,26 @@ Quieres guardar los cambios? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° Error calculando el punto '%1'. No hay intersección con la curva '%2' y el eje a través del punto '%3' con el angulo %4° + + Length + Longitud + + + Angle + + + + Label + Etiqueta + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15393,6 +15465,26 @@ Quieres guardar los cambios? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection Error calculando el punto '%1'. Las curvas '%2' y '%3' no tienen punto de intersección + + Label + Etiqueta + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_fi_FI.ts b/share/translations/valentina_fi_FI.ts index 2f233a33f..78bb53536 100644 --- a/share/translations/valentina_fi_FI.ts +++ b/share/translations/valentina_fi_FI.ts @@ -1072,6 +1072,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4278,6 +4286,10 @@ Apply settings anyway? Label language: + + Passmark length: + + DialogPatternXmlEdit @@ -5387,6 +5399,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -8353,6 +8381,10 @@ Haluatko tallentaa muutokset? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -9300,6 +9332,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QmuParser @@ -12246,6 +12282,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -12730,6 +12778,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -12949,6 +13001,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Pituus + + + Angle + Kulma + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -13724,6 +13796,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_fr_FR.ts b/share/translations/valentina_fr_FR.ts index e25951449..6e7a2b0e1 100644 --- a/share/translations/valentina_fr_FR.ts +++ b/share/translations/valentina_fr_FR.ts @@ -1212,6 +1212,14 @@ Notes Remarques + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4858,6 +4866,10 @@ Apply settings anyway? Label language: Langue: + + Passmark length: + + DialogPatternXmlEdit @@ -6043,6 +6055,22 @@ Apply settings anyway? Notes Remarques + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9342,6 +9370,10 @@ Voulez-vous sauvegarder les changements? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10451,6 +10483,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13760,6 +13796,18 @@ Voulez-vous enregistrer les changements? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14244,6 +14292,10 @@ Voulez-vous enregistrer les changements? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14490,6 +14542,26 @@ Voulez-vous enregistrer les changements? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Longueur + + + Angle + Angle + + + Label + Étiquette + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15353,6 +15425,26 @@ Voulez-vous enregistrer les changements? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + Étiquette + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_he_IL.ts b/share/translations/valentina_he_IL.ts index b55f74e91..85a49d929 100644 --- a/share/translations/valentina_he_IL.ts +++ b/share/translations/valentina_he_IL.ts @@ -805,6 +805,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -3731,6 +3739,10 @@ Apply settings anyway? Label language: + + Passmark length: + + DialogPiecePath @@ -4661,6 +4673,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -7378,6 +7406,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -8239,6 +8271,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QmuParser @@ -10967,6 +11003,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -11432,6 +11480,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -11647,6 +11699,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + אורך + + + Angle + + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -12382,6 +12454,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_id_ID.ts b/share/translations/valentina_id_ID.ts index a430ecbe2..93a7f6348 100644 --- a/share/translations/valentina_id_ID.ts +++ b/share/translations/valentina_id_ID.ts @@ -1016,6 +1016,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4030,6 +4038,10 @@ Apply settings anyway? Label language: + + Passmark length: + + DialogPiecePath @@ -4984,6 +4996,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -7716,6 +7744,10 @@ Apakah anda ingin menyimpan perubahan anda? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -8577,6 +8609,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QmuParser @@ -11351,6 +11387,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -11816,6 +11864,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -12031,6 +12083,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + panjang + + + Angle + sudut + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -12778,6 +12850,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_it_IT.ts b/share/translations/valentina_it_IT.ts index 6385ebadc..0559fcfdb 100644 --- a/share/translations/valentina_it_IT.ts +++ b/share/translations/valentina_it_IT.ts @@ -1208,6 +1208,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4855,6 +4863,10 @@ Applicare la configurazione comunque? Label language: Lingua etichetta: + + Passmark length: + + DialogPatternXmlEdit @@ -6040,6 +6052,22 @@ Applicare la configurazione comunque? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9335,6 +9363,10 @@ Vuoi salvare i cambiamenti? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10307,7 +10339,7 @@ Questa opzione sarà effettiva dopo il riavvio del programma. Cannot get tokens from formula '%1'. Parser error: %2. - + Impossibile ottenere risultato dalla formula '%1'. Errore analizzato: %2. Error @@ -10453,6 +10485,10 @@ Questa opzione sarà effettiva dopo il riavvio del programma. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -12775,31 +12811,31 @@ Vuoi salvare le tue modifiche? VAbstractTool black - nero + Nero green - verde + Verde blue - blu + Blu dark red - rosso scuro + Rosso scuro dark green - verde scuro + Verde scuro dark blue - blu scuro + Blu scuro yellow - giallo + Giallo Confirm deletion @@ -13697,6 +13733,18 @@ Vuoi salvare le tue modifiche? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14181,6 +14229,10 @@ Vuoi salvare le tue modifiche? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14423,6 +14475,26 @@ Vuoi salvare le tue modifiche? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Lunghezza + + + Angle + + + + Label + Etichetta + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15290,6 +15362,26 @@ Vuoi salvare le tue modifiche? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection Errore di calcolazione del punto '%1'. Curve '%2' e '%3' non hanno alcun punto d'intersezione + + Label + Etichetta + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_nl_NL.ts b/share/translations/valentina_nl_NL.ts index cf7cfcc51..f9406300e 100644 --- a/share/translations/valentina_nl_NL.ts +++ b/share/translations/valentina_nl_NL.ts @@ -1212,6 +1212,14 @@ Notes Notities + + Alias1: + Alias1: + + + Alias2: + Alias2: + DialogCutArc @@ -4863,6 +4871,10 @@ Toch de instellingen aanpassen? Label language: Taal label: + + Passmark length: + + DialogPatternXmlEdit @@ -6048,6 +6060,22 @@ Toch de instellingen aanpassen? Notes Notities + + Curve 1 + + + + Alias1: + Alias1: + + + Alias2: + Alias2: + + + Curve 2 + + DialogPreferences @@ -9346,6 +9374,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. Kan dimensie C niet instellen. Bestand was niet geopend. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10464,6 +10496,10 @@ Deze optie wordt actief na een herstart.. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13783,6 +13819,18 @@ Wil je deze veranderingen opslaan? Can't save file '%1'. Error: %2. Kan bestand '%1' niet opslaan. Fout %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14267,6 +14315,10 @@ Wil je deze veranderingen opslaan? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. Waarde voor de definitieve maten '%1' is oneindig of NaN. Controlleer uw berekeningen. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14517,6 +14569,26 @@ Wil je deze veranderingen opslaan? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° Fout berekenen punt '%1'. Er is geen kruispunt met de kromme '%2' en de aslijn door punt '%3' met hoek %4° + + Length + Lengte + + + Angle + Hoek + + + Label + Label + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15392,6 +15464,26 @@ Wil je deze veranderingen opslaan? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection Fout bij berekenen van punt '%1'. Krommen '%2' en '%3' hebben geen kruispunt + + Label + Label + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_pl_PL.ts b/share/translations/valentina_pl_PL.ts index f6ec88bde..a30896b09 100644 --- a/share/translations/valentina_pl_PL.ts +++ b/share/translations/valentina_pl_PL.ts @@ -1212,6 +1212,14 @@ Notes + + Alias1: + Odnośnik1: + + + Alias2: + Odnośnik2: + DialogCutArc @@ -4534,6 +4542,10 @@ Apply settings anyway? Label language: Język etykiet: + + Passmark length: + + DialogPatternXmlEdit @@ -5567,6 +5579,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + Odnośnik1: + + + Alias2: + Odnośnik2: + + + Curve 2 + + DialogPreferences @@ -8490,6 +8518,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -9467,6 +9499,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QmuParser @@ -12472,6 +12508,18 @@ Czy chcesz zapisać zmiany? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -12948,6 +12996,10 @@ Czy chcesz zapisać zmiany? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -13170,6 +13222,26 @@ Czy chcesz zapisać zmiany? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Długość + + + Angle + Kąt + + + Label + Etykieta + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -13941,6 +14013,26 @@ Czy chcesz zapisać zmiany? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + Etykieta + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_pt_BR.ts b/share/translations/valentina_pt_BR.ts index 5e0772884..0a8a72056 100644 --- a/share/translations/valentina_pt_BR.ts +++ b/share/translations/valentina_pt_BR.ts @@ -1212,6 +1212,14 @@ Notes Anotações + + Alias1: + Pseudônimo1: + + + Alias2: + Pseudônimo2: + DialogCutArc @@ -2012,11 +2020,11 @@ Material: Interlining - + Material: Entretela Interlining - + Entretela Word: Cut @@ -2060,7 +2068,7 @@ Measurements units - + Unidade de Medida Pattern units @@ -2072,15 +2080,15 @@ Customer birth date - + Data de Nascimento Cliente Customer email - + email Cliente Measurement: %1 - + Medida: %1 Height @@ -2095,52 +2103,52 @@ Hip dimension - + Quadril Waist dimension - + Cintura No data for the height dimension. - + Sem dados para dimensão altura. No data for the size dimension. - + Sem dados para dimensão tamanho. No data for the hip dimension. - + Sem dados para dimensão quadril. No data for the waist dimension. - + Sem dados para dimensão cintura. Final measurement: %1 - + Medida final: %1 Height label dimension - + etiqueta Altura Size label dimension - + etiqueta Tamanho Hip label dimension - + etiqueta Quadril Waist label dimension - + etiqueta Cintura @@ -2691,11 +2699,11 @@ Enable to create a visibility gropup from original objects - + Habilite para criar um grupo de visibilidade com os objetos originais Visibility Group - + Grupo de Visibilidade Name: @@ -2707,15 +2715,15 @@ Tags: - + Rótulos: Separate each tag with comma. - + Separe cada rótulo com vírgula. Add tags - + Adicionar rótulos Tool @@ -2739,19 +2747,19 @@ Ready - + Pronto Invalid suffix - + Sufixo Inválido Invalid group name - + Nome do grupo inválido Label: - + Etiqueta: Default @@ -2759,11 +2767,11 @@ Invalid point - + Ponto inválido Invalid label - + Etiqueta inválida Invalid alias @@ -2810,11 +2818,11 @@ Enable to create a visibility gropup from original objects - + Habilite para criar um grupo de visibilidade com os objetos originais Visibility Group - + Grupo de Visibilidade Name: @@ -2826,15 +2834,15 @@ Tags: - + Rótulos: Separate each tag with comma. - + Separe cada rótulo com vírgula. Add tags - + Adicionar rótulos Tool @@ -2858,19 +2866,19 @@ Ready - + Pronto Invalid suffix - + Sufixo Inválido Invalid group name - + Nome do grupo inválido Label: - + Etiqueta: Default @@ -2890,7 +2898,7 @@ Invalid label - + Etiqueta inválida Invalid alias @@ -2921,15 +2929,15 @@ Tags: - + Rótulos: Separate each tag with comma. - + Separe cada rótulo com vírgula. Add tags - + Adicionar rótulos @@ -3183,7 +3191,7 @@ Rotate objects around point %1. Suffix '%2' - + Gire objetos ao redor do ponto %1. Sufixo '%2' Flipping by line %1_%2. Suffix '%3' @@ -3195,7 +3203,7 @@ Move objects. Suffix '%1' - + Mover objetos. Sufixo '%1' @@ -3390,7 +3398,7 @@ Increment - + Incremento Separator @@ -3405,7 +3413,7 @@ The list of pieces is empty. Please, first create at least one piece for current pattern piece. - + A lista de peças está vazia. Por favor, primeiro crie ao menos uma peça para o molde atual. Insert nodes @@ -3417,7 +3425,7 @@ Number: - + Número: @@ -3463,26 +3471,26 @@ Nesting. Please, wait. - + Agrupando. Por favor, aguarde. Time left: - + Tempo restante: Time left: %1 - + Tempo restante: %1 Efficiency coefficient: %1% - + Coeficiente de eficiência: %1% DialogLayoutScale Layout scale - + Escala do layout Margins @@ -3510,15 +3518,15 @@ Scale - + Escala Horizontal: - + Horizontal: Vertical: - + Vertical: @@ -3709,6 +3717,10 @@ Aplicar configurações assim mesmo? Layout options Opções de layout + + Shift/Offset length: + Comprimento de Deslocamento + Rule for choosing the next workpiece Regra para escolha da próxima peça @@ -3776,7 +3788,7 @@ Aplicar configurações de qualquer forma? Follow grainline - + Seguir sentido do fio Time: @@ -3784,11 +3796,11 @@ Aplicar configurações de qualquer forma? Time given for the algorithm to find best layout. - + Tempo para o algoritmo encontrar o melhor layout. Efficiency: - + Eficiência: Set layout efficiency coefficient. Layout efficiency coefficientt is the ratio of the area occupied by the pieces to the bounding rect of all pieces. If nesting reaches required level the process stops. If value is 0 no check will be made. @@ -3796,23 +3808,23 @@ Aplicar configurações de qualquer forma? Manual priority - + Prioridade manual Nest quantity of copies according to piece settings. - + Agrupar quantidade de cópias de acordo com as definições da peça. Nest quantity - + Agrupar quantidade Auto crop unused width - + Cortar automaticamente largura não utilizada Prefer one sheet solution - + Preferir solução de uma folha min @@ -3821,7 +3833,7 @@ Aplicar configurações de qualquer forma? Enable this option to prefer getting one sheet solutions. - + Habilite essa opção para preferir a solução de uma página. @@ -4213,11 +4225,11 @@ Aplicar configurações de qualquer forma? Import - + Importar Columns - + Colunas Full name: @@ -4229,7 +4241,7 @@ Aplicar configurações de qualquer forma? Ready - + Pronto Name @@ -4245,7 +4257,7 @@ Aplicar configurações de qualquer forma? Skip - + Pular Shift (%1)*: @@ -4362,11 +4374,11 @@ Aplicar configurações de qualquer forma? Enable to create a visibility gropup from original objects - + Habilite para criar um grupo de visibilidade com os objetos originais Visibility Group - + Grupo de Visibilidade Name: @@ -4378,15 +4390,15 @@ Aplicar configurações de qualquer forma? Tags: - + Rótulos: Separate each tag with comma. - + Separe cada rótulo com vírgula. Add tags - + Adicionar rótulos Tool @@ -4410,19 +4422,19 @@ Aplicar configurações de qualquer forma? Ready - + Pronto Invalid suffix - + Sufixo Inválido Invalid group name - + Nome do grupo inválido Label: - + Etiqueta: Default @@ -4442,7 +4454,7 @@ Aplicar configurações de qualquer forma? Invalid label - + Etiqueta inválida Invalid alias @@ -4859,6 +4871,10 @@ Aplicar configurações de qualquer forma? Label language: Idioma: + + Passmark length: + + DialogPatternXmlEdit @@ -5291,7 +5307,7 @@ Aplicar configurações de qualquer forma? The list of pieces is empty. Please, first create at least one piece for current pattern piece. - + A lista de peças está vazia. Por favor, primeiro crie ao menos uma peça para o molde atual. This option has effect only if the second passmark on seam line enabled in global preferences. The option helps disable the second passmark for this passmark only. @@ -5307,7 +5323,7 @@ Aplicar configurações de qualquer forma? The same curve repeats twice! - + A mesma curva repete duas vezes! <Empty> @@ -5374,7 +5390,7 @@ Aplicar configurações de qualquer forma? The list of pieces is empty. Please, first create at least one piece for current pattern piece. - + A lista de peças está vazia. Por favor, primeiro crie ao menos uma peça para o molde atual. @@ -5489,7 +5505,7 @@ Aplicar configurações de qualquer forma? The list of pieces is empty. Please, first create at least one piece for current pattern piece. - + A lista de peças está vazia. Por favor, primeiro crie ao menos uma peça para o molde atual. Control visibility @@ -5497,7 +5513,7 @@ Aplicar configurações de qualquer forma? Circle - + Círculo @@ -6044,6 +6060,22 @@ Aplicar configurações de qualquer forma? Notes Anotações + + Curve 1 + + + + Alias1: + Pseudônimo1: + + + Alias2: + Pseudônimo2: + + + Curve 2 + + DialogPreferences @@ -6087,11 +6119,11 @@ Aplicar configurações de qualquer forma? Min: - + Mín: Max: - + Máx: Exclude @@ -6099,7 +6131,7 @@ Aplicar configurações de qualquer forma? Include - + Incluir @@ -6154,15 +6186,15 @@ Aplicar configurações de qualquer forma? This point cannot be origin point. Please, select another origin point - + Este ponto não pode ser o ponto de origem. Por favor, selecione outro ponto de origem Enable to create a visibility gropup from original objects - + Habilite para criar um grupo de visibilidade com os objetos originais Visibility Group - + Grupo de Visibilidade Name: @@ -6170,15 +6202,15 @@ Aplicar configurações de qualquer forma? Tags: - + Rótulos: Separate each tag with comma. - + Separe cada rótulo com vírgula. Add tags - + Adicionar rótulos Tool @@ -6202,23 +6234,23 @@ Aplicar configurações de qualquer forma? Ready - + Pronto Invalid suffix - + Sufixo Inválido Invalid group name - + Nome do grupo inválido Invalid rotation point - + Ponto de rotação inválido Invalid label - + Etiqueta inválida Invalid alias @@ -6230,7 +6262,7 @@ Aplicar configurações de qualquer forma? Label: - + Etiqueta: Alias: @@ -6345,15 +6377,15 @@ Aplicar configurações de qualquer forma? Scale - + Escala Horizontal: - + Horizontal: Vertical: - + Vertical: @@ -6651,7 +6683,7 @@ Aplicar configurações de qualquer forma? The same curve repeats twice! - + A mesma curva repete duas vezes! <Empty> @@ -6663,7 +6695,7 @@ Aplicar configurações de qualquer forma? Circle - + Círculo Edit passmark length @@ -6675,11 +6707,11 @@ Aplicar configurações de qualquer forma? The customer email from individual measurements - + O email do clientes das medidas individuais The customer birth date from individual measurements - + Data de nascimento do cliente das medidas individuais Save label data. @@ -6694,27 +6726,27 @@ Aplicar configurações de qualquer forma? DialogSetupMultisize Setup multisize measurements - + Configurar tabela multi-tamanhos Use full circumference - + Usar circunferência completa Min value: - + Valor mínimo: Minimal value described in the column - + Valor mínimo descrito na coluna Max value: - + Valor Máximo: Maximal value described in the column - + Valor máximo descrito na coluna Step: @@ -6726,31 +6758,31 @@ Aplicar configurações de qualquer forma? Base: - + Base: The base value for the column - + Valor de base para a coluna Circumference - + Circunferência Please, provide correct data for dimensions - + Por favor, forneça dados corretos para as dimensões Please, select at least one dimension - + Por favor, selecione ao menos uma dimensão No more than 3 dimensions allowed - + Não são permitidas mais de 3 dimensões Ready - + Pronto Height @@ -6765,12 +6797,12 @@ Aplicar configurações de qualquer forma? Waist dimension - + Cintura Hip dimension - + Quadril @@ -7811,11 +7843,11 @@ Aplicar configurações de qualquer forma? Set pattern file units: cm, mm, inch. - + Configurar unidade de medida do arquivo do molde: cm, mm, pol. The pattern units - + Unidades de medida do molde Invalid dimension A base value. @@ -9157,7 +9189,7 @@ Você quer salvar suas mudanças? Cannot save settings. Access denied. - + Acesso negado. Configuração não pode ser salva. Ctrl+O @@ -9181,27 +9213,27 @@ Você quer salvar suas mudanças? Point of intersection circle and segment - + Ponto de interseção circulo e segmento Increase label font - + Aumentar fonte da etiqueta Decrease label font - + Diminuir fonte da etiqueta Original label font - + Fonte original da etiqueta Hide labels - + Esconder etiquetas Groups of visibility - + Grupos de visibilidade Export recipe @@ -9221,15 +9253,15 @@ Você quer salvar suas mudanças? Curved path tool which uses point as control handle - + Ferramenta de caminho curvo que usa o ponto como alça de controle Point of intersection arc and axis - + Ponto de interseção arco e eixo Show main path - + Mostrar caminho principal Globally show pieces main path @@ -9237,15 +9269,15 @@ Você quer salvar suas mudanças? Pattern messages - + Mensagens Modelagem Clear all messages - + Limpar todas as mensagens Filter - + Filtrar DEBUG @@ -9273,11 +9305,11 @@ Você quer salvar suas mudanças? Watermark - + Marca d'água Load - + Carregar Remove @@ -9285,23 +9317,23 @@ Você quer salvar suas mudanças? Edit current - + Editar atual Editor - + Editor Create or edit a watermark - + Criar ou editar marca d'água Watermark files - + Arquivos de marca d'água Do you want to change the premissions? - + Você quer alterar as permissões? Not supported dimension A value '%1' for this pattern file. @@ -9339,6 +9371,10 @@ Você quer salvar suas mudanças? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -9346,6 +9382,14 @@ Você quer salvar suas mudanças? For saving multypage document all sheet should have the same size. Use export function instead. Para salvar o documento multypage, todas as folhas devem ter o mesmo tamanho. Use a função de exportação. + + For previewing multypage document all sheet should have the same size. + Para visualizar documentos de várias páginas, todas as folhas devem ter o mesmo tamanho. + + + For printing multypages document all sheet should have the same size. + Para imprimir documentos de várias páginas, todas as folhas devem ter o mesmo tamanho. + Creating file '%1' failed! %2 Criação do arquivo '%1' falhou! %2 @@ -9398,6 +9442,18 @@ Você quer salvar suas mudanças? Export error. Erro de exportação. + + For saving multipage document all sheet should have the same size. Use export function instead. + Para salvar documentos de várias páginas, todas as folhas devem ter o mesmo tamanho. Em vez disso, use a função de exportação. + + + For previewing multipage document all sheet should have the same size. + Para visualizar documentos de várias páginas, todas as folhas devem ter o mesmo tamanho. + + + For printing multipages document all sheet should have the same size. + Para imprimir documentos de várias páginas, todas as folhas devem ter o mesmo tamanho. + Pages will be cropped because they do not fit printer paper size. As páginas serão cortadas porque não correspondem ao tamanho do papel da impressora. @@ -9472,7 +9528,7 @@ Você quer salvar suas mudanças? Preparing details for layout - + Preparando detalhes para o layout Timeout. @@ -9750,7 +9806,7 @@ Você quer salvar suas mudanças? Double click calls Zoom fit best for current pattern piece - + Duplo clique para ajustar para a melhor visualização para peça atual Scrolling @@ -9813,19 +9869,19 @@ Você quer salvar suas mudanças? Activate dark mode - + Ativar modo escuro dark mode - + modo escuro Change the position of the tool panel to optimize for big screen resolutions. By default, the tool panel will take all available space. - + Altere a posição do painel de ferramentas para otimizar para resoluções de tela grande. Por padrão, o painel de ferramentas ocupará todo o espaço disponível. Tool panel scaling - + Dimensionamento do painel de ferramentas Don't use the native file dialog @@ -10243,7 +10299,7 @@ Esta opção terá um efeito após o reinício. Interlining - + Entretela Cut @@ -10271,11 +10327,11 @@ Esta opção terá um efeito após o reinício. Cannot calculate a notch for point '%1' in piece '%2'. Seam allowance is empty. - + Não foi possível calcular pique para ponto '%1' na peça '%2'. Margem de costura vazia. Cannot calculate a notch for point '%1' in piece '%2'. Cannot find position for a notch. - + Não foi possível calcular pique para ponto '%1' na peça '%2'. Posição do pique não encontrada. Cannot calculate a notch for point '%1' in piece '%2'. Unable to fix a notch position. @@ -10299,7 +10355,7 @@ Esta opção terá um efeito após o reinício. Empty formula - + Fórmula vazia Invalid result. Value is infinite or NaN. Please, check your calculations. @@ -10323,7 +10379,7 @@ Esta opção terá um efeito após o reinício. Piece '%1'. Seam allowance is not valid. - + Peça '%1'. Margem de costura inválida. Found null notch for point '%1' in piece '%2'. Length is less than minimal allowed. @@ -10335,11 +10391,11 @@ Esta opção terá um efeito após o reinício. Cannot calculate seam allowance before for point '%1'. Reason: %2. - + Não foi possível calcular margem de costura antes do ponto '%1'. Motivo: %2. Cannot calculate seam allowance after for point '%1'. Reason: %2. - + Não foi possível calcular margem de costura depois do ponto '%1'. Motivo: %2. Cannot calculate seam allowance after for point '%1'. Reason: @@ -10379,7 +10435,7 @@ Esta opção terá um efeito após o reinício. Segment is too short. - + Segmento é muito curto. Error calculating segment for curve '%1'. %2 @@ -10415,28 +10471,32 @@ Esta opção terá um efeito após o reinício. No data for the height dimension. - + Sem dados para dimensão altura. No data for the size dimension. - + Sem dados para dimensão tamanho. No data for the hip dimension. - + Sem dados para dimensão quadril. No data for the waist dimension. - + Sem dados para dimensão cintura. Piece '%1'. Grainline is not valid. - + Peça '%1'. Sentido do fio é inválido. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -10653,7 +10713,7 @@ Esta opção terá um efeito após o reinício. RemoveItemFromGroup Remove item from group - + Remover item do grupo @@ -11367,7 +11427,7 @@ Deseja salvar suas mudanças? Export from multisize measurements is not supported. - + Exportar medidas multi-tamanho não é suportado. Customer name: @@ -11375,7 +11435,7 @@ Deseja salvar suas mudanças? Open multisize … - + Abrir multi-tamanhos … Create from existing … @@ -11415,7 +11475,7 @@ Deseja salvar suas mudanças? Multisize measurements require at least 4 columns. - + Medidas multi-tamanhos requerem ao menos 4 colunas. Imported file must not contain the same name twice. @@ -11427,7 +11487,7 @@ Deseja salvar suas mudanças? Cannot save settings. Access denied. - + Acesso negado. Configuração não pode ser salva. &File @@ -11435,7 +11495,7 @@ Deseja salvar suas mudanças? &Window - + &Janela &Help @@ -11443,11 +11503,11 @@ Deseja salvar suas mudanças? &Measurements - + &Medidas &Open individual … - + &Abrir Individual … &Save @@ -11455,15 +11515,15 @@ Deseja salvar suas mudanças? Save &As … - + Salvar Como … &Quit - + &Encerrar &About Tape - + &Sobre Tape &New @@ -11475,7 +11535,7 @@ Deseja salvar suas mudanças? Do you want to change the premissions? - + Você quer alterar as permissões? Cannot read settings from a malformed .INI file. @@ -11495,7 +11555,7 @@ Deseja salvar suas mudanças? Correction: - + Correção: Dimension: @@ -11507,19 +11567,19 @@ Deseja salvar suas mudanças? Base Values: - + Valores Base: Export to individual - + Exportar para individual Export to individual measurements - + Exportar para medidas individuais Use full circumference - + Usar circunferência completa Restrict second dimension @@ -11559,7 +11619,7 @@ Deseja salvar suas mudanças? measurements.vit - + medidas.vit Shift (%1): @@ -11579,7 +11639,7 @@ Deseja salvar suas mudanças? Millimeters - + Milímetros Inches @@ -11591,7 +11651,7 @@ Deseja salvar suas mudanças? Degrees - + Graus Name @@ -11621,7 +11681,7 @@ Deseja salvar suas mudanças? Correction measurement column - + Correção Restrict first dimension @@ -11831,7 +11891,7 @@ Deseja salvar suas mudanças? Customer birth date: - + Data de nascimento do cliente: yyyy-MM-dd @@ -11839,7 +11899,7 @@ Deseja salvar suas mudanças? Customer email: - + Email do cliente: Materials @@ -11859,7 +11919,7 @@ Deseja salvar suas mudanças? Piece label visible - + Etiqueta da peça visível @@ -12141,7 +12201,7 @@ Deseja salvar suas mudanças? Priority: - + Prioridade: Controls priority in layout. 0 - no priority. @@ -12342,11 +12402,11 @@ Deseja salvar suas mudanças? Activate dark mode - + Ativar modo escuro dark mode - + modo escuro Don't use the native file dialog @@ -12463,12 +12523,12 @@ Deseja salvar suas mudanças? Waist dimension - + Cintura Hip dimension - + Quadril Chest full circumference @@ -12663,7 +12723,7 @@ Deseja salvar suas mudanças? This file is using previous format version v%1. The current is v%2. Saving the file with this app version will update the format version for this file. This may prevent you from be able to open the file with older app versions. Do you really want to continue? - + Este arquivo está usando formato de versão anterior v%1. A atual é v%2. Salvar o arquivo com esta versão do aplicativo atualizará a versão do formato deste arquivo. Isso pode impedir que você consiga abrir o arquivo com versões mais antigas do aplicativo. Você realmente deseja continuar? Comma-Separated Values @@ -12735,7 +12795,7 @@ Deseja salvar suas mudanças? VAbstractPiece Piece '%1'. Not enough points to build seam allowance. - + Peça '%1'. Sem pontos suficientes para criar margem de costura. @@ -12879,7 +12939,7 @@ Deseja salvar suas mudanças? Invalid notch. - + Pique inválido. Formula warning: %1. Program will be terminated. @@ -13204,7 +13264,7 @@ Deseja salvar suas mudanças? Export to csv with header. By default disabled. - + Exportar para csv com cabeçalho. Desabilitado por padrão. Specify codec that will be used to save data. List of supported codecs provided by Qt. Default value depend from system. On Windows, the codec will be based on a system locale. On Unix systems, the codec will might fall back to using the iconv library if no builtin codec for the locale can be found. Valid values for this installation: @@ -13376,7 +13436,7 @@ Deseja salvar suas mudanças? Horizontal scale - + Escala horizontal Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode). @@ -13384,7 +13444,7 @@ Deseja salvar suas mudanças? Vertical scale - + Escala vertical Prefer one sheet layout solution (export mode). @@ -13595,11 +13655,11 @@ Deseja salvar suas mudanças? Add to group - + Adicionar ao grupo Remove from group - + Remover do grupo Show label @@ -13607,7 +13667,7 @@ Deseja salvar suas mudanças? Restore label position - + Restaurar posição da etiqueta @@ -13704,6 +13764,18 @@ Deseja salvar suas mudanças? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -13736,11 +13808,11 @@ Deseja salvar suas mudanças? Hip - + Quadril Waist - + Cintura @@ -14188,6 +14260,10 @@ Deseja salvar suas mudanças? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14241,11 +14317,11 @@ Deseja salvar suas mudanças? VPrintLayout For printing multipages document all sheet should have the same size. - + Para imprimir documentos de várias páginas, todas as folhas devem ter o mesmo tamanho. For previewing multipage document all sheet should have the same size. - + Para visualizar documentos de várias páginas, todas as folhas devem ter o mesmo tamanho. Pages will be cropped because they do not fit printer paper size. @@ -14434,6 +14510,26 @@ Deseja salvar suas mudanças? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Comprimento + + + Angle + Ângulo + + + Label + Rótulo + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15253,7 +15349,7 @@ Deseja salvar suas mudanças? Point of intersection circle and segment - + Ponto de interseção circulo e segmento @@ -15309,6 +15405,26 @@ Deseja salvar suas mudanças? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + Rótulo + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation @@ -16933,31 +17049,31 @@ Deseja salvar suas mudanças? Hide - + Ocultar Show - + Exibir Hide All - + Ocultar Todos Show All - + Exibir Todos Tags: - + Rótulos: Separate each tag with comma. - + Separe cada rótulo com vírgula. Filter by tags - + Filtrar por rótulos Preferences @@ -16965,7 +17081,7 @@ Deseja salvar suas mudanças? Categories: %1. - + Categorias: %1. @@ -16984,18 +17100,30 @@ Deseja salvar suas mudanças? <b>Curved path</b>: select seven or more points, <b>%1</b> - finish creation - + <b>Caminho curvo</b>: selecione sete ou mais pontos, <b>%1</b> - finaliza criação VisToolCurveIntersectAxis + + <b>Intersection curve and axis</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation + <b>Interseção curva e eixo</b>: ângulo = %1°; <b>Shift</b> - fixa ângulo, <b>Enter</b> - finaliza + <b>Intersection curve and axis</b>: angle = %1°; <b>%2</b> - sticking angle, <b>%3</b> - finish creation - + <b>Interseção curva e eixo</b>: ângulo = %1°; <b>%2</b> - fixa ângulo, <b>%3</b> - finaliza VisToolEndLine + + <b>Point at distance and angle</b>: angle = %1°; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation + <b>Ponto a distância e ângulo</b>: ângulo = %1°; <b>Shift</b> - fixa ângulo, <b>Enter</b> - finaliza + + + <b>Point at distance and angle</b>: angle = %1°, length = %2%3; <b>Shift</b> - sticking angle, <b>Enter</b> - finish creation + <b>Ponto em distância e ângulo</b>: ângulo = %1°, comprimento = %2%3; <b>Shift</b> - fixa ângulo, <b>Enter</b> - finaliza + <b>Point at distance and angle</b>: angle = %1°, length = %2%3; <b>%4</b> - sticking angle, <b>%5</b> - finish creation @@ -17068,7 +17196,7 @@ Deseja salvar suas mudanças? WatermarkWindow Watermark - + Marca d'água Opacity: @@ -17165,7 +17293,7 @@ Deseja salvar suas mudanças? Watermark files - + Arquivos de marca d'água Save as @@ -17173,7 +17301,7 @@ Deseja salvar suas mudanças? watermark - + marca d'água Failed to lock. This file already opened in another window. @@ -17214,7 +17342,8 @@ Deseja salvar suas mudanças? The watermark has been modified. Do you want to save your changes? - + A marca d'água foi modificada. +Deseja salvar as alterações? Don't Save @@ -17234,7 +17363,7 @@ Do you want to save your changes? This file is using previous format version v%1. The current is v%2. Saving the file with this app version will update the format version for this file. This may prevent you from be able to open the file with older app versions. Do you really want to continue? - + Este arquivo está usando formato de versão anterior v%1. A atual é v%2. Salvar o arquivo com esta versão do aplicativo atualizará a versão do formato deste arquivo. Isso pode impedir que você consiga abrir o arquivo com versões mais antigas do aplicativo. Você realmente deseja continuar? File saved @@ -17258,7 +17387,7 @@ Do you want to save your changes? Do you want to change the premissions? - + Você quer alterar as permissões? diff --git a/share/translations/valentina_ro_RO.ts b/share/translations/valentina_ro_RO.ts index f84ae292a..41f58ef20 100644 --- a/share/translations/valentina_ro_RO.ts +++ b/share/translations/valentina_ro_RO.ts @@ -1177,6 +1177,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4451,6 +4459,10 @@ Apply settings anyway? Label language: Limbă etichetă: + + Passmark length: + + DialogPatternXmlEdit @@ -5464,6 +5476,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -8387,6 +8415,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -9259,6 +9291,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QmuParser @@ -12120,6 +12156,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -12585,6 +12633,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -12800,6 +12852,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Lungime + + + Angle + Unghi + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -13559,6 +13631,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_ru_RU.ts b/share/translations/valentina_ru_RU.ts index d8eb22ebb..b62e15950 100644 --- a/share/translations/valentina_ru_RU.ts +++ b/share/translations/valentina_ru_RU.ts @@ -1212,6 +1212,14 @@ Notes Заметки + + Alias1: + Псевдоним 1: + + + Alias2: + Псевдоним 2: + DialogCutArc @@ -4863,6 +4871,10 @@ Apply settings anyway? Label language: Язык метки точки: + + Passmark length: + + DialogPatternXmlEdit @@ -6048,6 +6060,22 @@ Apply settings anyway? Notes Заметки + + Curve 1 + + + + Alias1: + Псевдоним 1: + + + Alias2: + Псевдоним 2: + + + Curve 2 + + DialogPreferences @@ -9348,6 +9376,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. Не удалось установить измерение C. Файл не открыт. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10466,6 +10498,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. Не удалось подготовить заполнитель для финального измерения. Ошибка синтаксического анализатора в строке %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13785,6 +13821,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. Не удается сохранить файл '%1'. Ошибка: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14269,6 +14317,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. Значение для финальной мерки "%1" бесконечно или NaN. Пожалуйста, проверьте свои расчеты. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14519,6 +14571,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° Ошибка при вычислении точки '%1'. Между кривой '%2' и осью через точку '%3' с углом %4° нет пересечений + + Length + Длина + + + Angle + Угол + + + Label + Метка + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15394,6 +15466,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection Ошибка при вычислении точки '%1'. Кривые '%2' и '%3' не имеют точек пересечения + + Label + Метка + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_uk_UA.ts b/share/translations/valentina_uk_UA.ts index 52c744517..5ffb5ab8c 100644 --- a/share/translations/valentina_uk_UA.ts +++ b/share/translations/valentina_uk_UA.ts @@ -1212,6 +1212,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -4861,6 +4869,10 @@ Apply settings anyway? Label language: Мова назви точки: + + Passmark length: + + DialogPatternXmlEdit @@ -6046,6 +6058,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -9346,6 +9374,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -10463,6 +10495,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QSaveFile @@ -13780,6 +13816,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -14264,6 +14312,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -14510,6 +14562,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + Довжина + + + Angle + Кут + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -15385,6 +15457,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation diff --git a/share/translations/valentina_zh_CN.ts b/share/translations/valentina_zh_CN.ts index 5f0959422..58b27f92b 100644 --- a/share/translations/valentina_zh_CN.ts +++ b/share/translations/valentina_zh_CN.ts @@ -969,6 +969,14 @@ Notes + + Alias1: + + + + Alias2: + + DialogCutArc @@ -3879,6 +3887,10 @@ Apply settings anyway? yyyy-MM-dd 年年年年-月月-日日 + + Passmark length: + + DialogPiecePath @@ -4773,6 +4785,22 @@ Apply settings anyway? Notes + + Curve 1 + + + + Alias1: + + + + Alias2: + + + + Curve 2 + + DialogPreferences @@ -7504,6 +7532,10 @@ Do you want to save your changes? Couldn't set dimension C. File wasn't opened. + + Could not create recipe file. %1 + + MainWindowsNoGUI @@ -8383,6 +8415,10 @@ This option will take an affect after restart. Failed to prepare final measurement placeholder. Parser error at line %1: %2. + + Invalid global value for a passmark length. Piece '%1'. Length is less than minimal allowed. + + QmuParser @@ -11184,6 +11220,18 @@ Do you want to save your changes? Can't save file '%1'. Error: %2. + + Can't create an flat dxf file. + + + + Can't create an AAMA dxf file. + + + + Can't create an ASTM dxf file. + + VLayoutPiece @@ -11649,6 +11697,10 @@ Do you want to save your changes? Value for final measurtement '%1' is infinite or NaN. Please, check your calculations. + + Unable to create record for final measurement '%1'. Error: %2 + + VPiece @@ -11864,6 +11916,26 @@ Do you want to save your changes? Error calculating point '%1'. There is no intersection with curve '%2' and axis through point '%3' with angle %4° + + Length + 长度 + + + Angle + + + + Label + + + + Segment 1 + + + + Segment 2 + + VToolCutArc @@ -12595,6 +12667,26 @@ Do you want to save your changes? Error calculating point '%1'. Curves '%2' and '%3' have no point of intersection + + Label + + + + Curve 1 segment 1 + + + + Curve 1 segment 2 + + + + Curve 2 segment 1 + + + + Curve 2 segment 2 + + VToolRotation From 8e94e4f0dce09c20507a0b3f65f9391d780e0900 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 13 May 2021 11:13:20 +0300 Subject: [PATCH 10/29] Update debugbreak to the latest version. Since Clang 10 Clang doesn't like `gnu_inline` attribute. --- src/libs/vmisc/debugbreak.h | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/libs/vmisc/debugbreak.h b/src/libs/vmisc/debugbreak.h index c40850901..89a4aebf8 100644 --- a/src/libs/vmisc/debugbreak.h +++ b/src/libs/vmisc/debugbreak.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2018, Scott Tsai +/* Copyright (c) 2011-2021, Scott Tsai * * All rights reserved. * @@ -23,7 +23,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ - #ifndef DEBUG_BREAK_H #define DEBUG_BREAK_H @@ -50,7 +49,7 @@ __inline__ static void trap_instruction(void) #elif defined(__thumb__) #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_TRAP_INSTRUCTION /* FIXME: handle __THUMB_INTERWORK__ */ -__attribute__((gnu_inline, always_inline)) +__attribute__((always_inline)) __inline__ static void trap_instruction(void) { /* See 'arm-linux-tdep.c' in GDB source. @@ -82,7 +81,7 @@ __inline__ static void trap_instruction(void) } #elif defined(__arm__) && !defined(__thumb__) #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_TRAP_INSTRUCTION -__attribute__((gnu_inline, always_inline)) +__attribute__((always_inline)) __inline__ static void trap_instruction(void) { /* See 'arm-linux-tdep.c' in GDB source, @@ -95,7 +94,7 @@ __inline__ static void trap_instruction(void) #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_BULTIN_TRAP #elif defined(__aarch64__) #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_TRAP_INSTRUCTION -__attribute__((gnu_inline, always_inline)) +__attribute__((always_inline)) __inline__ static void trap_instruction(void) { /* See 'aarch64-tdep.c' in GDB source, @@ -105,7 +104,7 @@ __inline__ static void trap_instruction(void) #elif defined(__powerpc__) /* PPC 32 or 64-bit, big or little endian */ #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_TRAP_INSTRUCTION -__attribute__((gnu_inline, always_inline)) +__attribute__((always_inline)) __inline__ static void trap_instruction(void) { /* See 'rs6000-tdep.c' in GDB source, @@ -119,6 +118,17 @@ __inline__ static void trap_instruction(void) * The workaround is the same as ARM Thumb mode: use debugbreak-gdb.py * or manually jump over the instruction. */ } +#elif defined(__riscv) + /* RISC-V 32 or 64-bit, whether the "C" extension + * for compressed, 16-bit instructions are supported or not */ + #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_TRAP_INSTRUCTION +__attribute__((always_inline)) +__inline__ static void trap_instruction(void) +{ + /* See 'riscv-tdep.c' in GDB source, + * 'riscv_sw_breakpoint_from_kind' */ + __asm__ volatile(".4byte 0x00100073"); +} #else #define DEBUG_BREAK_IMPL DEBUG_BREAK_USE_SIGTRAP #endif @@ -127,20 +137,20 @@ __inline__ static void trap_instruction(void) #ifndef DEBUG_BREAK_IMPL #error "debugbreak.h is not supported on this target" #elif DEBUG_BREAK_IMPL == DEBUG_BREAK_USE_TRAP_INSTRUCTION -__attribute__((gnu_inline, always_inline)) +__attribute__((always_inline)) __inline__ static void debug_break(void) { trap_instruction(); } #elif DEBUG_BREAK_IMPL == DEBUG_BREAK_USE_BULTIN_TRAP -__attribute__((gnu_inline, always_inline)) +__attribute__((always_inline)) __inline__ static void debug_break(void) { __builtin_trap(); } #elif DEBUG_BREAK_IMPL == DEBUG_BREAK_USE_SIGTRAP #include -__attribute__((gnu_inline, always_inline)) +__attribute__((always_inline)) __inline__ static void debug_break(void) { raise(SIGTRAP); From 1ea8e1baaae9b06a4d290ddb654c076bb762ceac Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 13 May 2021 14:24:05 +0300 Subject: [PATCH 11/29] Bump version. --- ChangeLog.txt | 2 +- dist/OBS_debian/debian.changelog | 4 ++-- dist/debian/changelog | 4 ++-- dist/macx/tape/Info.plist | 4 ++-- dist/macx/valentina/Info.plist | 4 ++-- dist/rpm/_service | 2 +- dist/rpm/valentina.spec | 2 +- dist/valentina.dsc | 8 ++++---- src/libs/vmisc/projectversion.cpp | 2 +- src/libs/vmisc/projectversion.h | 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index e194e4812..544c9fd27 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,4 @@ -# Version 0.7.47 (unreleased) +# Version 0.7.47 May 13, 2021 - [smart-pattern/valentina#118] Incorrect seam allowance. - [smart-pattern/valentina#119] Improve tool Point of intersection curves. - [smart-pattern/valentina#120] Incorrect seam allowance. diff --git a/dist/OBS_debian/debian.changelog b/dist/OBS_debian/debian.changelog index 1d3a4d70b..f1be558f7 100644 --- a/dist/OBS_debian/debian.changelog +++ b/dist/OBS_debian/debian.changelog @@ -1,5 +1,5 @@ -valentina (0.7.46) trusty; urgency=low +valentina (0.7.47) trusty; urgency=low * Auto build. - -- dismine Wed, 31 Mar 2021 17:20:00 +0300 + -- dismine Fri, 13 May 2021 14:17:00 +0300 diff --git a/dist/debian/changelog b/dist/debian/changelog index 1d3a4d70b..f1be558f7 100644 --- a/dist/debian/changelog +++ b/dist/debian/changelog @@ -1,5 +1,5 @@ -valentina (0.7.46) trusty; urgency=low +valentina (0.7.47) trusty; urgency=low * Auto build. - -- dismine Wed, 31 Mar 2021 17:20:00 +0300 + -- dismine Fri, 13 May 2021 14:17:00 +0300 diff --git a/dist/macx/tape/Info.plist b/dist/macx/tape/Info.plist index 412745612..31a1037a9 100755 --- a/dist/macx/tape/Info.plist +++ b/dist/macx/tape/Info.plist @@ -19,9 +19,9 @@ CFBundleIdentifier io.bitbucket.valentinaproject.@EXECUTABLE@ CFBundleShortVersionString - 0.7.46 + 0.7.47 CFBundleVersion - 0.7.46.0 + 0.7.47.0 CFBundleInfoDictionaryVersion 6.0 CFBundleDocumentTypes diff --git a/dist/macx/valentina/Info.plist b/dist/macx/valentina/Info.plist index 29516c1e8..a5401e0ff 100755 --- a/dist/macx/valentina/Info.plist +++ b/dist/macx/valentina/Info.plist @@ -19,9 +19,9 @@ CFBundleIdentifier io.bitbucket.valentinaproject.@EXECUTABLE@ CFBundleShortVersionString - 0.7.46 + 0.7.47 CFBundleVersion - 0.7.46.0 + 0.7.47.0 CFBundleInfoDictionaryVersion 6.0 CFBundleDocumentTypes diff --git a/dist/rpm/_service b/dist/rpm/_service index c11edecb4..54db39f1b 100644 --- a/dist/rpm/_service +++ b/dist/rpm/_service @@ -1,7 +1,7 @@ git://github.com/dismine/Valentina_git.git - 0.7.46 + 0.7.47 valentina git .git diff --git a/dist/rpm/valentina.spec b/dist/rpm/valentina.spec index 08263cbc9..328c78c10 100644 --- a/dist/rpm/valentina.spec +++ b/dist/rpm/valentina.spec @@ -95,7 +95,7 @@ Requires: poppler-tools Requires: poppler-utils %endif -Version: 0.7.46 +Version: 0.7.47 Release: 0 URL: https://gitlab.com/smart-pattern/valentina License: GPL-3.0+ diff --git a/dist/valentina.dsc b/dist/valentina.dsc index 33a6e09c2..887fce73c 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -2,7 +2,7 @@ Format: 3.0 (native) Source: valentina Binary: valentina Architecture: i386 amd64 -Version: 0.7.46 +Version: 0.7.47 Maintainer: Roman Telezhynskyi Homepage: https://valentinaproject.bitbucket.io Standards-Version: 3.9.5 @@ -18,8 +18,8 @@ Build-Depends: debhelper (>= 8.0.0), Package-List: valentina deb graphics optional Checksums-Sha1: - 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.46.tar + 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.47.tar Checksums-Sha256: - 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.46.tar + 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.47.tar Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.46.tar + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.tar diff --git a/src/libs/vmisc/projectversion.cpp b/src/libs/vmisc/projectversion.cpp index 7595071a6..05ed47232 100644 --- a/src/libs/vmisc/projectversion.cpp +++ b/src/libs/vmisc/projectversion.cpp @@ -42,7 +42,7 @@ extern const int MAJOR_VERSION = 0; extern const int MINOR_VERSION = 7; -extern const int DEBUG_VERSION = 46; +extern const int DEBUG_VERSION = 47; extern const QString APP_VERSION_STR(QStringLiteral("%1.%2.%3.%4").arg(MAJOR_VERSION).arg(MINOR_VERSION) .arg(DEBUG_VERSION).arg(LATEST_TAG_DISTANCE)); diff --git a/src/libs/vmisc/projectversion.h b/src/libs/vmisc/projectversion.h index be2f7a35c..690534416 100644 --- a/src/libs/vmisc/projectversion.h +++ b/src/libs/vmisc/projectversion.h @@ -49,8 +49,8 @@ extern const QString APP_VERSION_STR; // Change version number in projectversion.cpp too. // Synchronize valentina.nsi -#define VER_FILEVERSION 0,7,46 -#define VER_FILEVERSION_STR "0.7.46\0" +#define VER_FILEVERSION 0,7,47 +#define VER_FILEVERSION_STR "0.7.47\0" #define V_PRERELEASE // Mark prerelease builds From 5c8fbbcc59bd77f0165f593ebc200eaf129815fd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 13 May 2021 21:38:24 +0300 Subject: [PATCH 12/29] Fix getting the latest tag distance. #126 --- common.pri | 6 +++--- src/libs/vmisc/vmisc.pro | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common.pri b/common.pri index cbc8df716..88e7738b8 100644 --- a/common.pri +++ b/common.pri @@ -292,7 +292,7 @@ defineReplace(FindBuildRevision){ defineReplace(FindLatestTagDistance){ CONFIG(debug, debug|release){ # Debug mode - return(\\\"0\\\") + return(0) }else{ # Release mode @@ -302,10 +302,10 @@ defineReplace(FindLatestTagDistance){ # 3. latest commit is gSHA tag_all = $$system(git describe --tags) tag_split = $$split(tag_all, "-") #split at the dashes - GIT_DISTANCE = \\\"$$member(tag_split,1)\\\" #get 2nd element of results + GIT_DISTANCE = $$member(tag_split,1) #get 2nd element of results isEmpty(GIT_DISTANCE){ - GIT_DISTANCE = \\\"0\\\" # if we can't find local revision left 0. + GIT_DISTANCE = 0 # if we can't find local revision left 0. } message("Latest tag distance:" $${GIT_DISTANCE}) diff --git a/src/libs/vmisc/vmisc.pro b/src/libs/vmisc/vmisc.pro index 38e39515b..eb0333d8e 100644 --- a/src/libs/vmisc/vmisc.pro +++ b/src/libs/vmisc/vmisc.pro @@ -90,6 +90,6 @@ CONFIG(debug, debug|release){ } } -DEFINES += "LATEST_TAG_DISTANCE=$$FindLatestTagDistance()" # Make available latest tag distance number in sources. +DEFINES += LATEST_TAG_DISTANCE=\\\"$$FindLatestTagDistance()\\\" # Make available latest tag distance number in sources. include (../libs.pri) From e904953bdf57860b8e2ac02cc43dc1b359c008fa Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 13 May 2021 21:41:19 +0300 Subject: [PATCH 13/29] Fix error ../scripts/travis-deploy.sh: Permission denied. --- scripts/travis-deploy.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/travis-deploy.sh diff --git a/scripts/travis-deploy.sh b/scripts/travis-deploy.sh old mode 100644 new mode 100755 From a90f184f909938ba706c072af20643e2030cb641 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 09:42:52 +0300 Subject: [PATCH 14/29] Fix variable assignment. --- scripts/travis-deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/travis-deploy.sh b/scripts/travis-deploy.sh index 39e297c0e..347aa94ff 100755 --- a/scripts/travis-deploy.sh +++ b/scripts/travis-deploy.sh @@ -24,9 +24,9 @@ if [[ "$DEPLOY" == "true" ]]; then check_failure "Unable to patch the app bundle."; if [[ "$LEGACY" = false ]]; then - legacy_suffix = "" + legacy_suffix="" else - legacy_suffix = "-legacy" + legacy_suffix="-legacy" fi print_info "Start compressing."; From d1da6eb553e186f2dec816262dba6adbcefc6272 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 10:42:06 +0300 Subject: [PATCH 15/29] Fix link to the repo archive. GitLab no longer supports the old format. --- dist/AppImage/appimage.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dist/AppImage/appimage.yml b/dist/AppImage/appimage.yml index cf85540af..4877efb96 100644 --- a/dist/AppImage/appimage.yml +++ b/dist/AppImage/appimage.yml @@ -40,7 +40,7 @@ build: # - .... # files: - - "https://gitlab.com/smart-pattern/valentina/repository/archive.tar.gz?ref=develop" + - "https://gitlab.com/smart-pattern/valentina/-/archive/develop/valentina-develop.tar.gz" # OPTIONAL: ingredient packages are packages which become part of the AppImage. # you may want to remove parts of their content in script section. @@ -53,7 +53,6 @@ script: # - $BUILD_SOURCE_DIR point to the source directory # - $BUILD_APPDIR point to the AppDir. This directory will become the content of the AppImage - cd $BUILD_SOURCE_DIR - - mv -v "archive.tar.gz?ref=develop" valentina-develop.tar.gz - tar zxvf $BUILD_SOURCE_DIR/valentina-develop.tar.gz - mv -v valentina-develop-* valentina - cd $BUILD_SOURCE_DIR/valentina From 1a52939d2aee6e0472ac4aeed8be641ed4ba5551 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 10:42:18 +0300 Subject: [PATCH 16/29] qt5-default is being dropped. --- dist/valentina.dsc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dist/valentina.dsc b/dist/valentina.dsc index 887fce73c..491036676 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -10,8 +10,7 @@ Vcs-Browser: https://gitlab.com/smart-pattern/valentina Build-Depends: debhelper (>= 8.0.0), qtbase5-dev (>= 5.4.0), libqt5svg5-dev (>= 5.4.0), - g++ (>= 4.8.0), - qt5-default (>= 5.4.0), + g++ (>= 4.8.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) From bf9f577f43a5459aafccbfd36afe3b06fc0e6978 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 11:07:02 +0300 Subject: [PATCH 17/29] OBS used incorrect old file. --- dist/OBS_debian/valentina.dsc | 30 ++++++++++++++---------------- scripts/obs_debian.sh | 2 ++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index f670d1e42..491036676 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -2,25 +2,23 @@ Format: 3.0 (native) Source: valentina Binary: valentina Architecture: i386 amd64 -Version: 0.6.0 +Version: 0.7.47 Maintainer: Roman Telezhynskyi -Homepage: https://valentinaproject.bitbucket.io/ +Homepage: https://valentinaproject.bitbucket.io Standards-Version: 3.9.5 -Vcs-Browser: https://bitbucket.org/dismine/valentina +Vcs-Browser: https://gitlab.com/smart-pattern/valentina Build-Depends: debhelper (>= 8.0.0), - qtbase5-dev (>= 5.2.0), - libqt5svg5-dev (>= 5.2.0), - g++ (>= 4.7.0), - qt5-default (>= 5.2.0), - qttools5-dev-tools (>= 5.2.0), - libqt5xmlpatterns5-dev (>= 5.2.0), - libqt5opengl5-dev (>= 5.2.0) + qtbase5-dev (>= 5.4.0), + libqt5svg5-dev (>= 5.4.0), + g++ (>= 4.8.0), + qttools5-dev-tools (>= 5.4.0), + libqt5xmlpatterns5-dev (>= 5.4.0), + libqt5opengl5-dev (>= 5.4.0) Package-List: valentina deb graphics optional +Checksums-Sha1: + 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.47.tar +Checksums-Sha256: + 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.47.tar Files: - d09673bcc475067139b88cf875e5dc0c 20954240 valentina_0.6.0.orig.tar.gz - 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.6.0.diff.tar.gz - -DEBTRANSFORM-TAR: valentina_0.6.0.orig.tar.gz -DEBTRANSFORM-FILES-TAR: debian.tar.gz -DEBTRANSFORM-RELEASE: 1 + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.tar diff --git a/scripts/obs_debian.sh b/scripts/obs_debian.sh index afaff0c97..8e8781f85 100755 --- a/scripts/obs_debian.sh +++ b/scripts/obs_debian.sh @@ -17,3 +17,5 @@ do basename=${file##*/} # remove the path from a path-string cp -v -f $file $OBSDEBIAN/debian.${basename} done + +cp -v -f ../dist/valentina.dsc $OBSDEBIAN/valentina.dsc From 307a2410c3a575f187273c6354171e357238e48a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 11:07:54 +0300 Subject: [PATCH 18/29] Instead of qt5-default use an environment variable. --- dist/OBS_debian/debian.rules | 2 +- dist/debian/rules | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/OBS_debian/debian.rules b/dist/OBS_debian/debian.rules index e36187ef7..ec0176f9b 100755 --- a/dist/OBS_debian/debian.rules +++ b/dist/OBS_debian/debian.rules @@ -18,7 +18,7 @@ mkdir -p builddir builddir/Makefile: builddir - cd builddir && qmake PREFIX=/usr PREFIX_LIB=$(PREFIX_LIB) "CONFIG += noTests noRunPath no_ccache noDebugSymbols" ../$(APPNAME).pro -r + cd builddir && QT_SELECT=qt5 qmake PREFIX=/usr PREFIX_LIB=$(PREFIX_LIB) "CONFIG += noTests noRunPath no_ccache noDebugSymbols" ../$(APPNAME).pro -r build: build-stamp build-stamp: builddir/Makefile dh_testdir diff --git a/dist/debian/rules b/dist/debian/rules index e36187ef7..ec0176f9b 100755 --- a/dist/debian/rules +++ b/dist/debian/rules @@ -18,7 +18,7 @@ mkdir -p builddir builddir/Makefile: builddir - cd builddir && qmake PREFIX=/usr PREFIX_LIB=$(PREFIX_LIB) "CONFIG += noTests noRunPath no_ccache noDebugSymbols" ../$(APPNAME).pro -r + cd builddir && QT_SELECT=qt5 qmake PREFIX=/usr PREFIX_LIB=$(PREFIX_LIB) "CONFIG += noTests noRunPath no_ccache noDebugSymbols" ../$(APPNAME).pro -r build: build-stamp build-stamp: builddir/Makefile dh_testdir From 622b58c0107ce6d36dbaa2bc612bd9ca77820dd3 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 11:08:42 +0300 Subject: [PATCH 19/29] Fix appimage.yml. --- dist/AppImage/appimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/AppImage/appimage.yml b/dist/AppImage/appimage.yml index 4877efb96..59ae86247 100644 --- a/dist/AppImage/appimage.yml +++ b/dist/AppImage/appimage.yml @@ -54,7 +54,7 @@ script: # - $BUILD_APPDIR point to the AppDir. This directory will become the content of the AppImage - cd $BUILD_SOURCE_DIR - tar zxvf $BUILD_SOURCE_DIR/valentina-develop.tar.gz - - mv -v valentina-develop-* valentina + - mv -v valentina-develop valentina - cd $BUILD_SOURCE_DIR/valentina - qmake-qt5 PREFIX=/usr PREFIX_LIB=/usr/lib LRELEASE=lrelease-qt5 Valentina.pro -r DEFINES+=APPIMAGE "CONFIG += noTests noRunPath no_ccache noDebugSymbols" - make -j$(nproc) From b1510f0951fda15b8479d6adf38c2e2e7f132fd6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 11:42:26 +0300 Subject: [PATCH 20/29] Help to determent right source tarball. --- dist/OBS_debian/valentina.dsc | 6 +++--- dist/valentina.dsc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index 491036676..5e9c24810 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -17,8 +17,8 @@ Build-Depends: debhelper (>= 8.0.0), Package-List: valentina deb graphics optional Checksums-Sha1: - 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.47.tar + 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.47.v0.7.47.tar Checksums-Sha256: - 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.47.tar + 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.47.v0.7.47.tar Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.tar + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.v0.7.47.tar diff --git a/dist/valentina.dsc b/dist/valentina.dsc index 491036676..5e9c24810 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -17,8 +17,8 @@ Build-Depends: debhelper (>= 8.0.0), Package-List: valentina deb graphics optional Checksums-Sha1: - 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.47.tar + 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.47.v0.7.47.tar Checksums-Sha256: - 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.47.tar + 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.47.v0.7.47.tar Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.tar + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.v0.7.47.tar From 4e13f18aed4d3547ad3fe750950d172d129b040e Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 11:56:16 +0300 Subject: [PATCH 21/29] Use Debtransform-Files-Tar to specify correct tarball for OBS. --- dist/OBS_debian/valentina.dsc | 1 + dist/valentina.dsc | 1 + 2 files changed, 2 insertions(+) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index 5e9c24810..739fd5201 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -14,6 +14,7 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) +Debtransform-Files-Tar: valentina_0.7.47.v0.7.47.tar.gz Package-List: valentina deb graphics optional Checksums-Sha1: diff --git a/dist/valentina.dsc b/dist/valentina.dsc index 5e9c24810..739fd5201 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -14,6 +14,7 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) +Debtransform-Files-Tar: valentina_0.7.47.v0.7.47.tar.gz Package-List: valentina deb graphics optional Checksums-Sha1: From b04009a9770e46f71643ab717208ac6ac61ad2e9 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 12:01:35 +0300 Subject: [PATCH 22/29] Try to use Debtransform-Tar instead of Debtransform-Files-Tar. --- dist/OBS_debian/valentina.dsc | 2 +- dist/valentina.dsc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index 739fd5201..c414b7ccd 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -14,7 +14,7 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) -Debtransform-Files-Tar: valentina_0.7.47.v0.7.47.tar.gz +Debtransform-Tar: valentina_0.7.47.v0.7.47.tar.gz Package-List: valentina deb graphics optional Checksums-Sha1: diff --git a/dist/valentina.dsc b/dist/valentina.dsc index 739fd5201..c414b7ccd 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -14,7 +14,7 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) -Debtransform-Files-Tar: valentina_0.7.47.v0.7.47.tar.gz +Debtransform-Tar: valentina_0.7.47.v0.7.47.tar.gz Package-List: valentina deb graphics optional Checksums-Sha1: From 30ef53cbed63190f4ae443598caf4c9d916206e1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 12:17:46 +0300 Subject: [PATCH 23/29] Try another approach. --- dist/OBS_debian/valentina.dsc | 12 ++++++------ dist/valentina.dsc | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index c414b7ccd..ee90be8c0 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -14,12 +14,12 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) -Debtransform-Tar: valentina_0.7.47.v0.7.47.tar.gz Package-List: valentina deb graphics optional -Checksums-Sha1: - 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.47.v0.7.47.tar -Checksums-Sha256: - 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.47.v0.7.47.tar Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.v0.7.47.tar + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.orig.tar.gz + 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.diff.tar.gz + +DEBTRANSFORM-TAR: valentina_0.7.47.orig.tar.gz +DEBTRANSFORM-FILES-TAR: debian.tar.gz +DEBTRANSFORM-RELEASE: 1 diff --git a/dist/valentina.dsc b/dist/valentina.dsc index c414b7ccd..ee90be8c0 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -14,12 +14,12 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) -Debtransform-Tar: valentina_0.7.47.v0.7.47.tar.gz Package-List: valentina deb graphics optional -Checksums-Sha1: - 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.47.v0.7.47.tar -Checksums-Sha256: - 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.47.v0.7.47.tar Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.v0.7.47.tar + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.orig.tar.gz + 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.diff.tar.gz + +DEBTRANSFORM-TAR: valentina_0.7.47.orig.tar.gz +DEBTRANSFORM-FILES-TAR: debian.tar.gz +DEBTRANSFORM-RELEASE: 1 From 42cb355fe2924053f532ac41a85fc4ae96ad1a6a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 12:30:20 +0300 Subject: [PATCH 24/29] Try another approach. --- dist/OBS_debian/valentina.dsc | 6 +++--- dist/valentina.dsc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index ee90be8c0..61353d058 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -20,6 +20,6 @@ Files: 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.orig.tar.gz 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.diff.tar.gz -DEBTRANSFORM-TAR: valentina_0.7.47.orig.tar.gz -DEBTRANSFORM-FILES-TAR: debian.tar.gz -DEBTRANSFORM-RELEASE: 1 +Debtransform-Tar: valentina_0.7.47.orig.tar.gz +Debtransform-Files-Tar: debian.tar.gz +Debtransform-Release: 1 diff --git a/dist/valentina.dsc b/dist/valentina.dsc index ee90be8c0..61353d058 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -20,6 +20,6 @@ Files: 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.orig.tar.gz 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.diff.tar.gz -DEBTRANSFORM-TAR: valentina_0.7.47.orig.tar.gz -DEBTRANSFORM-FILES-TAR: debian.tar.gz -DEBTRANSFORM-RELEASE: 1 +Debtransform-Tar: valentina_0.7.47.orig.tar.gz +Debtransform-Files-Tar: debian.tar.gz +Debtransform-Release: 1 From dce17fad085de6c33ab8468be291131e3506001b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 12:46:08 +0300 Subject: [PATCH 25/29] Define name of a file with tag. --- dist/OBS_debian/valentina.dsc | 6 +++--- dist/valentina.dsc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index 61353d058..1cd592096 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -17,9 +17,9 @@ Build-Depends: debhelper (>= 8.0.0), Package-List: valentina deb graphics optional Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.orig.tar.gz - 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.diff.tar.gz + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.v0.7.47.orig.tar.gz + 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.v0.7.47.diff.tar.gz -Debtransform-Tar: valentina_0.7.47.orig.tar.gz +Debtransform-Tar: valentina_0.7.47.v0.7.47.orig.tar.gz Debtransform-Files-Tar: debian.tar.gz Debtransform-Release: 1 diff --git a/dist/valentina.dsc b/dist/valentina.dsc index 61353d058..1cd592096 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -17,9 +17,9 @@ Build-Depends: debhelper (>= 8.0.0), Package-List: valentina deb graphics optional Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.orig.tar.gz - 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.diff.tar.gz + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.v0.7.47.orig.tar.gz + 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.v0.7.47.diff.tar.gz -Debtransform-Tar: valentina_0.7.47.orig.tar.gz +Debtransform-Tar: valentina_0.7.47.v0.7.47.orig.tar.gz Debtransform-Files-Tar: debian.tar.gz Debtransform-Release: 1 From 66bef28c93ab7657f427d9e68ac2bb5f2fa20b84 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 12:50:37 +0300 Subject: [PATCH 26/29] OBS searches for valentina-0.7.47.v0.7.47.tar.gz. --- dist/OBS_debian/valentina.dsc | 6 +++--- dist/rpm/_service | 2 +- dist/valentina.dsc | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index 1cd592096..bf1453a04 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -17,9 +17,9 @@ Build-Depends: debhelper (>= 8.0.0), Package-List: valentina deb graphics optional Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.v0.7.47.orig.tar.gz - 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.v0.7.47.diff.tar.gz + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina-0.7.47.v0.7.47.orig.tar.gz + 2fecf324a32123b08cefc0f047bca5ee 63176 valentina-0.7.47.v0.7.47.diff.tar.gz -Debtransform-Tar: valentina_0.7.47.v0.7.47.orig.tar.gz +Debtransform-Tar: valentina-0.7.47.v0.7.47.orig.tar.gz Debtransform-Files-Tar: debian.tar.gz Debtransform-Release: 1 diff --git a/dist/rpm/_service b/dist/rpm/_service index 54db39f1b..e5fbaf6db 100644 --- a/dist/rpm/_service +++ b/dist/rpm/_service @@ -5,7 +5,7 @@ valentina git .git - %at + @PARENT_TAG@ master diff --git a/dist/valentina.dsc b/dist/valentina.dsc index 1cd592096..bf1453a04 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -17,9 +17,9 @@ Build-Depends: debhelper (>= 8.0.0), Package-List: valentina deb graphics optional Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.47.v0.7.47.orig.tar.gz - 2fecf324a32123b08cefc0f047bca5ee 63176 valentina_0.7.47.v0.7.47.diff.tar.gz + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina-0.7.47.v0.7.47.orig.tar.gz + 2fecf324a32123b08cefc0f047bca5ee 63176 valentina-0.7.47.v0.7.47.diff.tar.gz -Debtransform-Tar: valentina_0.7.47.v0.7.47.orig.tar.gz +Debtransform-Tar: valentina-0.7.47.v0.7.47.orig.tar.gz Debtransform-Files-Tar: debian.tar.gz Debtransform-Release: 1 From 1425757bef7b57d935ecfe61555f42ed50ce777c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 14:17:39 +0300 Subject: [PATCH 27/29] Try to move tags up. --- dist/OBS_debian/valentina.dsc | 7 +++---- dist/valentina.dsc | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index bf1453a04..d6d751dd8 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -14,12 +14,11 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) +Debtransform-Tar: valentina-0.7.47.v0.7.47.orig.tar.gz +Debtransform-Files-Tar: debian.tar.gz +Debtransform-Release: 1 Package-List: valentina deb graphics optional Files: 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina-0.7.47.v0.7.47.orig.tar.gz 2fecf324a32123b08cefc0f047bca5ee 63176 valentina-0.7.47.v0.7.47.diff.tar.gz - -Debtransform-Tar: valentina-0.7.47.v0.7.47.orig.tar.gz -Debtransform-Files-Tar: debian.tar.gz -Debtransform-Release: 1 diff --git a/dist/valentina.dsc b/dist/valentina.dsc index bf1453a04..f02337830 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -14,12 +14,12 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) +Debtransform-Tar: valentina-0.7.47.v0.7.47.orig.tar.gz +Debtransform-Files-Tar: debian.tar.gz +Debtransform-Release: 1 Package-List: valentina deb graphics optional Files: 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina-0.7.47.v0.7.47.orig.tar.gz 2fecf324a32123b08cefc0f047bca5ee 63176 valentina-0.7.47.v0.7.47.diff.tar.gz -Debtransform-Tar: valentina-0.7.47.v0.7.47.orig.tar.gz -Debtransform-Files-Tar: debian.tar.gz -Debtransform-Release: 1 From 2902d84a745e6828f24eef1ea2dd5f2bca2d73d7 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 14 May 2021 14:51:03 +0300 Subject: [PATCH 28/29] Try another approach. --- dist/OBS_debian/valentina.dsc | 7 ++----- dist/valentina.dsc | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/dist/OBS_debian/valentina.dsc b/dist/OBS_debian/valentina.dsc index d6d751dd8..7d0229a70 100644 --- a/dist/OBS_debian/valentina.dsc +++ b/dist/OBS_debian/valentina.dsc @@ -14,11 +14,8 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) -Debtransform-Tar: valentina-0.7.47.v0.7.47.orig.tar.gz -Debtransform-Files-Tar: debian.tar.gz -Debtransform-Release: 1 +Debtransform-Tar: valentina-0.7.47.v0.7.47.tar.gz Package-List: valentina deb graphics optional Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina-0.7.47.v0.7.47.orig.tar.gz - 2fecf324a32123b08cefc0f047bca5ee 63176 valentina-0.7.47.v0.7.47.diff.tar.gz + 00000000000000000000000000000000 0 valentina-0.7.47.v0.7.47.tar.gz diff --git a/dist/valentina.dsc b/dist/valentina.dsc index f02337830..2946f516b 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -14,12 +14,9 @@ Build-Depends: debhelper (>= 8.0.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) -Debtransform-Tar: valentina-0.7.47.v0.7.47.orig.tar.gz -Debtransform-Files-Tar: debian.tar.gz -Debtransform-Release: 1 +Debtransform-Tar: valentina-0.7.47.v0.7.47.tar.gz Package-List: valentina deb graphics optional Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina-0.7.47.v0.7.47.orig.tar.gz - 2fecf324a32123b08cefc0f047bca5ee 63176 valentina-0.7.47.v0.7.47.diff.tar.gz + 00000000000000000000000000000000 0 valentina-0.7.47.v0.7.47.tar.gz From 342df09a828db21726020d66ff78536caaef4bad Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 15 May 2021 10:39:31 +0300 Subject: [PATCH 29/29] To less distract users change completer filter mode to match contains. #124 --- src/app/valentina/dialogs/dialogpatternproperties.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/valentina/dialogs/dialogpatternproperties.cpp b/src/app/valentina/dialogs/dialogpatternproperties.cpp index df7eabf17..8f8acc0ae 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.cpp +++ b/src/app/valentina/dialogs/dialogpatternproperties.cpp @@ -135,7 +135,7 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pat m_completer = new QCompleter(m_variables, this); m_completer->setCompletionMode(QCompleter::PopupCompletion); m_completer->setModelSorting(QCompleter::UnsortedModel); - m_completer->setFilterMode(Qt::MatchStartsWith); + m_completer->setFilterMode(Qt::MatchContains); m_completer->setCaseSensitivity(Qt::CaseSensitive); ui->lineEditPassmarkLength->setCompleter(m_completer);