Remember last selected export format.

This commit is contained in:
Roman Telezhynskyi 2021-04-23 18:03:16 +03:00
parent d9f2b756a4
commit e1fa77510b
4 changed files with 21 additions and 0 deletions

View File

@ -5,6 +5,7 @@
- Fix export to DXF AAMA/ASTM.
- [smart-pattern/valentina#121] Incorrect elliptical arc end angle.
- [smart-pattern/valentina#122] Extend piece bounding rect.
- Remember last selected export format.
# Version 0.7.46 Mar 31, 2021
- Fix incorrect calculation of value for multisize measurements in Valentina.

View File

@ -915,6 +915,8 @@ void DialogSaveLayout::ReadSettings()
{
ui->toolButtonLandscape->setChecked(true);
}
SelectFormat(static_cast<LayoutExportFormats>(settings->GetLayoutExportFormat()));
}
//---------------------------------------------------------------------------------------------------------------------
@ -957,5 +959,7 @@ void DialogSaveLayout::WriteSettings() const
{
settings->SetTiledPDFOrientation(PageOrientation::Landscape);
}
settings->SetLayoutExportFormat(static_cast<qint8>(Format()));
}

View File

@ -103,6 +103,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingMultiplier, (QLatin1String("layo
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTextAsPaths, (QLatin1String("layout/textAsPaths")))
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, settingTiledPDFPaperHeight, (QLatin1String("tiledPDF/paperHeight")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTiledPDFPaperWidth, (QLatin1String("tiledPDF/paperWidth")))
@ -770,6 +771,18 @@ void VSettings::SetToolPanelScaling(const bool &value)
setValue(*settingToolPanelScaling, value);
}
//---------------------------------------------------------------------------------------------------------------------
auto VSettings::GetLayoutExportFormat() const -> qint8
{
return qvariant_cast<qint8>(value(*settingLayoutExportFormat, 0));
}
//---------------------------------------------------------------------------------------------------------------------
void VSettings::SetLayoutExportFormat(qint8 format)
{
setValue(*settingLayoutExportFormat, format);
}
//---------------------------------------------------------------------------------------------------------------------
template<typename T>
T VSettings::GetCachedValue(T &cache, const QString &setting, T defValue, T valueMin, T valueMax) const

View File

@ -203,6 +203,9 @@ public:
bool GetToolPanelScaling() const;
void SetToolPanelScaling(const bool &value);
auto GetLayoutExportFormat() const -> qint8;
void SetLayoutExportFormat(qint8 format);
private:
Q_DISABLE_COPY(VSettings)