Restore feature Edit current measurements.

This commit is contained in:
Roman Telezhynskyi 2020-10-16 09:31:08 +03:00
parent 18e1a4a601
commit a5298ea059
2 changed files with 23 additions and 16 deletions

View File

@ -788,7 +788,7 @@ void MApplication::ParseCommandLine(const SocketConnection &connection, const QS
if (flagDimensionB)
{
if (MainWindow()->SetDimensionBBase(dimensionBValue))
if (not MainWindow()->SetDimensionBBase(dimensionBValue))
{
parser.showHelp(V_EX_USAGE);
}
@ -796,7 +796,7 @@ void MApplication::ParseCommandLine(const SocketConnection &connection, const QS
if (flagDimensionC)
{
if (MainWindow()->SetDimensionCBase(dimensionCValue))
if (not MainWindow()->SetDimensionCBase(dimensionCValue))
{
parser.showHelp(V_EX_USAGE);
}

View File

@ -1904,22 +1904,29 @@ void MainWindow::ShowMeasurements()
const QString absoluteMPath = AbsoluteMPath(qApp->GetPatternPath(), doc->MPath());
QStringList arguments;
arguments.append(absoluteMPath);
arguments.append("-u");
arguments.append(UnitsToStr(qApp->patternUnits()));
if (qApp->GetMeasurementsType() == MeasurementsType::Multisize)
{
arguments = QStringList()
<< absoluteMPath
<< "-u"
<< UnitsToStr(qApp->patternUnits())
<< "-e"
<< QString().setNum(static_cast<int>(UnitConvertor(pattern->height(), doc->MUnit(), Unit::Cm)))
<< "-s"
<< QString().setNum(static_cast<int>(UnitConvertor(pattern->size(), doc->MUnit(), Unit::Cm)));
}
else
{
arguments = QStringList() << absoluteMPath
<< "-u"
<< UnitsToStr(qApp->patternUnits());
if (m_currentDimensionA > 0)
{
arguments.append("-a");
arguments.append(QString::number(m_currentDimensionA));
}
if (m_currentDimensionB > 0)
{
arguments.append("-b");
arguments.append(QString::number(m_currentDimensionB));
}
if (m_currentDimensionC > 0)
{
arguments.append("-c");
arguments.append(QString::number(m_currentDimensionC));
}
}
if (isNoScaling)