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; 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) if (qApp->patternType() == MeasurementsType::Standard)
{ {
VStandardMeasurements m(pattern); VStandardMeasurements m(pattern);
m.setContent(path); m.setContent(path);
Unit mUnit = m.MUnit(); if (m.MUnit() == Unit::Inch)
if (qApp->patternUnit() != mUnit)
{ {
QMessageBox::critical(this, tr("Wrong units."), text); QMessageBox::critical(this, tr("Wrong units."),
tr("Application doesn't support standard table with inches."));
Clear(); Clear();
return; return;
} }
m.SetSize(); m.SetSize();
m.SetHeight(); 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(); ToolBarOption();
} }
catch (VException &e) catch (VException &e)