Fix issue with passing incorrect number of dimension to Tape.
This commit is contained in:
parent
5fd4b8f563
commit
8476b50a24
|
@ -35,6 +35,7 @@
|
||||||
- Tool box redesign.
|
- Tool box redesign.
|
||||||
- Increased requirement for minimal Qt version.
|
- Increased requirement for minimal Qt version.
|
||||||
- Support for Dark mode.
|
- Support for Dark mode.
|
||||||
|
- Fix issue with passing incorrect number of dimension to Tape.
|
||||||
|
|
||||||
# Valentina 0.7.52 September 12, 2022
|
# Valentina 0.7.52 September 12, 2022
|
||||||
- Fix crash when default locale is ru.
|
- Fix crash when default locale is ru.
|
||||||
|
|
|
@ -864,19 +864,19 @@ auto MApplication::StartWithFiles(QCommandLineParser &parser) -> bool
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flagDimensionA && not MainWindow()->SetDimensionABase(dimensionAValue))
|
if (flagDimensionA)
|
||||||
{
|
{
|
||||||
parser.showHelp(V_EX_USAGE);
|
MainWindow()->SetDimensionABase(dimensionAValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flagDimensionB && not MainWindow()->SetDimensionBBase(dimensionBValue))
|
if (flagDimensionB)
|
||||||
{
|
{
|
||||||
parser.showHelp(V_EX_USAGE);
|
MainWindow()->SetDimensionBBase(dimensionBValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flagDimensionC && not MainWindow()->SetDimensionCBase(dimensionCValue))
|
if (flagDimensionC)
|
||||||
{
|
{
|
||||||
parser.showHelp(V_EX_USAGE);
|
MainWindow()->SetDimensionCBase(dimensionCValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flagUnits)
|
if (flagUnits)
|
||||||
|
|
|
@ -343,14 +343,14 @@ void TMainWindow::RetranslateTable()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto TMainWindow::SetDimensionABase(int base) -> bool
|
void TMainWindow::SetDimensionABase(int base)
|
||||||
{
|
{
|
||||||
const QList<MeasurementDimension_p> dimensions = m_m->Dimensions().values();
|
const QList<MeasurementDimension_p> dimensions = m_m->Dimensions().values();
|
||||||
|
|
||||||
if (dimensions.isEmpty())
|
if (dimensions.isEmpty())
|
||||||
{
|
{
|
||||||
qCCritical(tMainWindow, "%s\n", qPrintable(tr("The table doesn't provide dimensions")));
|
qCWarning(tMainWindow, "%s\n", qPrintable(tr("The table doesn't provide dimensions")));
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const qint32 i = m_gradationDimensionA->findData(base);
|
const qint32 i = m_gradationDimensionA->findData(base);
|
||||||
|
@ -361,21 +361,20 @@ auto TMainWindow::SetDimensionABase(int base) -> bool
|
||||||
|
|
||||||
if (not VFuzzyComparePossibleNulls(base, m_currentDimensionA))
|
if (not VFuzzyComparePossibleNulls(base, m_currentDimensionA))
|
||||||
{
|
{
|
||||||
qCCritical(tMainWindow, "%s\n", qPrintable(tr("Invalid base value for dimension A")));
|
qCWarning(tMainWindow, "%s\n", qPrintable(tr("Invalid base value for dimension A")));
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto TMainWindow::SetDimensionBBase(int base) -> bool
|
void TMainWindow::SetDimensionBBase(int base)
|
||||||
{
|
{
|
||||||
const QList<MeasurementDimension_p> dimensions = m_m->Dimensions().values();
|
const QList<MeasurementDimension_p> dimensions = m_m->Dimensions().values();
|
||||||
|
|
||||||
if (dimensions.size() <= 1)
|
if (dimensions.size() <= 1)
|
||||||
{
|
{
|
||||||
qCCritical(tMainWindow, "%s\n", qPrintable(tr("The table doesn't support dimension B")));
|
qCWarning(tMainWindow, "%s\n", qPrintable(tr("The table doesn't support dimension B")));
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const qint32 i = m_gradationDimensionB->findData(base);
|
const qint32 i = m_gradationDimensionB->findData(base);
|
||||||
|
@ -386,22 +385,20 @@ auto TMainWindow::SetDimensionBBase(int base) -> bool
|
||||||
|
|
||||||
if (not VFuzzyComparePossibleNulls(base, m_currentDimensionB))
|
if (not VFuzzyComparePossibleNulls(base, m_currentDimensionB))
|
||||||
{
|
{
|
||||||
qCCritical(tMainWindow, "%s\n", qPrintable(tr("Invalid base value for dimension B")));
|
qCWarning(tMainWindow, "%s\n", qPrintable(tr("Invalid base value for dimension B")));
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto TMainWindow::SetDimensionCBase(int base) -> bool
|
void TMainWindow::SetDimensionCBase(int base)
|
||||||
{
|
{
|
||||||
const QList<MeasurementDimension_p> dimensions = m_m->Dimensions().values();
|
const QList<MeasurementDimension_p> dimensions = m_m->Dimensions().values();
|
||||||
|
|
||||||
if (dimensions.size() <= 2)
|
if (dimensions.size() <= 2)
|
||||||
{
|
{
|
||||||
qCCritical(tMainWindow, "%s\n", qPrintable(tr("The table doesn't support dimension C")));
|
qCWarning(tMainWindow, "%s\n", qPrintable(tr("The table doesn't support dimension C")));
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const qint32 i = m_gradationDimensionC->findData(base);
|
const qint32 i = m_gradationDimensionC->findData(base);
|
||||||
|
@ -412,10 +409,9 @@ auto TMainWindow::SetDimensionCBase(int base) -> bool
|
||||||
|
|
||||||
if (not VFuzzyComparePossibleNulls(base, m_currentDimensionC))
|
if (not VFuzzyComparePossibleNulls(base, m_currentDimensionC))
|
||||||
{
|
{
|
||||||
qCCritical(tMainWindow, "%s\n", qPrintable(tr("Invalid base value for dimension C")));
|
qCWarning(tMainWindow, "%s\n", qPrintable(tr("Invalid base value for dimension C")));
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -58,9 +58,9 @@ public:
|
||||||
|
|
||||||
void RetranslateTable();
|
void RetranslateTable();
|
||||||
|
|
||||||
auto SetDimensionABase(int base) -> bool;
|
void SetDimensionABase(int base);
|
||||||
auto SetDimensionBBase(int base) -> bool;
|
void SetDimensionBBase(int base);
|
||||||
auto SetDimensionCBase(int base) -> bool;
|
void SetDimensionCBase(int base);
|
||||||
void SetPUnit(Unit unit);
|
void SetPUnit(Unit unit);
|
||||||
|
|
||||||
auto LoadFile(const QString &path) -> bool;
|
auto LoadFile(const QString &path) -> bool;
|
||||||
|
|
|
@ -902,16 +902,26 @@ void VAbstractPattern::SetMPath(const QString &path)
|
||||||
QDomElement domElement = UniqueTag(TagMeasurements);
|
QDomElement domElement = UniqueTag(TagMeasurements);
|
||||||
if (not domElement.isNull())
|
if (not domElement.isNull())
|
||||||
{
|
{
|
||||||
|
auto RemoveDimensions = [&domElement]()
|
||||||
|
{
|
||||||
|
domElement.removeAttribute(AttrDimensionA);
|
||||||
|
domElement.removeAttribute(AttrDimensionB);
|
||||||
|
domElement.removeAttribute(AttrDimensionC);
|
||||||
|
};
|
||||||
|
|
||||||
if (not path.isEmpty())
|
if (not path.isEmpty())
|
||||||
{
|
{
|
||||||
SetAttribute(domElement, AttrPath, path);
|
SetAttribute(domElement, AttrPath, path);
|
||||||
|
|
||||||
|
if (path.endsWith(QStringLiteral(".vit")) || QFileInfo(m_MPath).fileName() != QFileInfo(path).fileName())
|
||||||
|
{
|
||||||
|
RemoveDimensions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
domElement.removeAttribute(AttrPath);
|
domElement.removeAttribute(AttrPath);
|
||||||
domElement.removeAttribute(AttrDimensionA);
|
RemoveDimensions();
|
||||||
domElement.removeAttribute(AttrDimensionB);
|
|
||||||
domElement.removeAttribute(AttrDimensionC);
|
|
||||||
}
|
}
|
||||||
m_MPath = path;
|
m_MPath = path;
|
||||||
patternLabelWasChanged = true;
|
patternLabelWasChanged = true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user