Application doesn't support standard table with inches.

--HG--
branch : develop
This commit is contained in:
dismine 2014-07-09 16:44:26 +03:00
parent 6f127035f4
commit 91843fe8d8

View File

@ -2210,34 +2210,20 @@ void MainWindow::LoadPattern(const QString &fileName)
return;
}
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
.arg(doc->UnitsToStr(qApp->patternUnit()));
if (qApp->patternType() == MeasurementsType::Standard)
{
VStandardMeasurements m(pattern);
m.setContent(path);
Unit mUnit = m.MUnit();
if (qApp->patternUnit() != mUnit)
if (m.MUnit() == Unit::Inch)
{
QMessageBox::critical(this, tr("Wrong units."), text);
QMessageBox::critical(this, tr("Wrong units."),
tr("Application doesn't support standard table with inches."));
Clear();
return;
}
m.SetSize();
m.SetHeight();
}
else
{
VIndividualMeasurements m(pattern);
m.setContent(path);
Unit mUnit = m.MUnit();
if (qApp->patternUnit() != mUnit)
{
QMessageBox::critical(this, tr("Wrong units."), text);
Clear();
return;
}
}
ToolBarOption();
}
catch (VException &e)