Placeholder for area units. #193

This commit is contained in:
Roman Telezhynskyi 2023-01-02 14:19:46 +02:00
parent 86ee89414a
commit cfe341e7b9
4 changed files with 9 additions and 3 deletions

View File

@ -189,8 +189,10 @@ auto PreparePlaceholders(const VAbstractPattern *doc, const VContainer *data) ->
placeholders.insert(pl_author, doc->GetCompanyName()); placeholders.insert(pl_author, doc->GetCompanyName());
placeholders.insert(pl_mUnits, UnitsToStr(VAbstractValApplication::VApp()->MeasurementsUnits(), true)); placeholders.insert(pl_mUnits, UnitsToStr(VAbstractValApplication::VApp()->MeasurementsUnits(), true));
placeholders.insert(pl_pUnits, UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true)); const QString pUnits = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true);
placeholders.insert(pl_pUnits, pUnits);
placeholders.insert(pl_mSizeUnits, UnitsToStr(VAbstractValApplication::VApp()->DimensionSizeUnits(), true)); placeholders.insert(pl_mSizeUnits, UnitsToStr(VAbstractValApplication::VApp()->DimensionSizeUnits(), true));
placeholders.insert(pl_areaUnits, pUnits + QStringLiteral("²"));
if (VAbstractValApplication::VApp()->GetMeasurementsType() == MeasurementsType::Individual) if (VAbstractValApplication::VApp()->GetMeasurementsType() == MeasurementsType::Individual)
{ {

View File

@ -138,6 +138,7 @@ const QString pl_mFileName = QStringLiteral("mFileName");
const QString pl_mExt = QStringLiteral("mExt"); const QString pl_mExt = QStringLiteral("mExt");
const QString pl_mUnits = QStringLiteral("mUnits"); const QString pl_mUnits = QStringLiteral("mUnits");
const QString pl_mSizeUnits = QStringLiteral("mSizeUnits"); const QString pl_mSizeUnits = QStringLiteral("mSizeUnits");
const QString pl_areaUnits = QStringLiteral("areaUnits");
const QString pl_pLetter = QStringLiteral("pLetter"); const QString pl_pLetter = QStringLiteral("pLetter");
const QString pl_pAnnotation = QStringLiteral("pAnnotation"); const QString pl_pAnnotation = QStringLiteral("pAnnotation");
const QString pl_pOrientation = QStringLiteral("pOrientation"); const QString pl_pOrientation = QStringLiteral("pOrientation");

View File

@ -121,6 +121,7 @@ extern const QString pl_mFileName;
extern const QString pl_mExt; extern const QString pl_mExt;
extern const QString pl_mUnits; extern const QString pl_mUnits;
extern const QString pl_mSizeUnits; extern const QString pl_mSizeUnits;
extern const QString pl_areaUnits;
extern const QString pl_pLetter; extern const QString pl_pLetter;
extern const QString pl_pAnnotation; extern const QString pl_pAnnotation;
extern const QString pl_pOrientation; extern const QString pl_pOrientation;

View File

@ -519,11 +519,13 @@ void DialogEditLabel::InitPlaceholders()
m_placeholders.insert(pl_mUnits, qMakePair(tr("Measurements units"), m_placeholders.insert(pl_mUnits, qMakePair(tr("Measurements units"),
UnitsToStr(VAbstractValApplication::VApp()->MeasurementsUnits(), true))); UnitsToStr(VAbstractValApplication::VApp()->MeasurementsUnits(), true)));
m_placeholders.insert(pl_pUnits, qMakePair(tr("Pattern units"),
UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true))); const QString pUnits = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true);
m_placeholders.insert(pl_pUnits, qMakePair(tr("Pattern units"), pUnits));
m_placeholders.insert(pl_mSizeUnits, qMakePair(tr("Size units"), m_placeholders.insert(pl_mSizeUnits, qMakePair(tr("Size units"),
UnitsToStr(VAbstractValApplication::VApp()->DimensionSizeUnits(), UnitsToStr(VAbstractValApplication::VApp()->DimensionSizeUnits(),
true))); true)));
m_placeholders.insert(pl_areaUnits, qMakePair(tr("Area units"), pUnits + QStringLiteral("²")));
if (VAbstractValApplication::VApp()->GetMeasurementsType() == MeasurementsType::Individual) if (VAbstractValApplication::VApp()->GetMeasurementsType() == MeasurementsType::Individual)
{ {