Fix regression. Fix correct handle export format for exporting details in the Detail mode.

This commit is contained in:
Roman Telezhynskyi 2021-06-28 10:25:52 +03:00
parent 7779e16be3
commit b2b7dff106
4 changed files with 33 additions and 2 deletions

View File

@ -2,6 +2,7 @@
- [smart-pattern/valentina#129] Incorrect behavior of empty arc and elliptical arc.
- Parsing formulas with not canonical math symbols.
- [smart-pattern/valentina#133] Incorrect seam allowance.
- Fix regression. Fix correct handle export format for exporting details in the Detail mode.
# Version 0.7.47 May 13, 2021
- [smart-pattern/valentina#118] Incorrect seam allowance.

View File

@ -914,7 +914,14 @@ void DialogSaveLayout::ReadSettings()
ui->toolButtonLandscape->setChecked(true);
}
if (m_mode != Draw::Layout)
{
SelectFormat(static_cast<LayoutExportFormats>(settings->GetDetailExportFormat()));
}
else
{
SelectFormat(static_cast<LayoutExportFormats>(settings->GetLayoutExportFormat()));
}
}
//---------------------------------------------------------------------------------------------------------------------
@ -958,6 +965,13 @@ void DialogSaveLayout::WriteSettings() const
settings->SetTiledPDFOrientation(PageOrientation::Landscape);
}
if (m_mode != Draw::Layout)
{
settings->SetDetailExportFormat(static_cast<qint8>(Format()));
}
else
{
settings->SetLayoutExportFormat(static_cast<qint8>(Format()));
}
}

View File

@ -104,6 +104,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTextAsPaths, (QLatin1String("lay
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingNestingTime, (QLatin1String("layout/time")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingEfficiencyCoefficient, (QLatin1String("layout/efficiencyCoefficient")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutExportFormat, (QLatin1String("layout/exportFormat")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDetailExportFormat, (QLatin1String("detail/exportFormat")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTiledPDFPaperHeight, (QLatin1String("tiledPDF/paperHeight")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTiledPDFPaperWidth, (QLatin1String("tiledPDF/paperWidth")))
@ -783,6 +784,18 @@ void VSettings::SetLayoutExportFormat(qint8 format)
setValue(*settingLayoutExportFormat, format);
}
//---------------------------------------------------------------------------------------------------------------------
qint8 VSettings::GetDetailExportFormat() const
{
return qvariant_cast<qint8>(value(*settingDetailExportFormat, 0));
}
//---------------------------------------------------------------------------------------------------------------------
void VSettings::SetDetailExportFormat(qint8 format)
{
setValue(*settingDetailExportFormat, format);
}
//---------------------------------------------------------------------------------------------------------------------
template<typename T>
T VSettings::GetCachedValue(T &cache, const QString &setting, T defValue, T valueMin, T valueMax) const

View File

@ -206,6 +206,9 @@ public:
auto GetLayoutExportFormat() const -> qint8;
void SetLayoutExportFormat(qint8 format);
auto GetDetailExportFormat() const -> qint8;
void SetDetailExportFormat(qint8 format);
private:
Q_DISABLE_COPY(VSettings)