diff --git a/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp b/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp
index 16c3a19fc..d71a18c0b 100644
--- a/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp
+++ b/src/app/valentina/dialogs/configpages/preferencespatternpage.cpp
@@ -52,6 +52,8 @@ PreferencesPatternPage::PreferencesPatternPage(QWidget *parent)
QMessageBox::information(this, QCoreApplication::applicationName(), qsMsg);
});
+ ui->defaultSeamAllowance->setValue(qApp->ValentinaSettings()->GetDefaultSeamAllowance());
+
ui->forbidFlippingCheck->setChecked(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping());
ui->doublePassmarkCheck->setChecked(qApp->ValentinaSettings()->IsDoublePassmark());
ui->checkBoxHideMainPath->setChecked(qApp->ValentinaSettings()->IsHideMainPath());
@@ -79,6 +81,8 @@ void PreferencesPatternPage::Apply()
* prints a warning and does nothing.*/
settings->SetUndoCount(ui->undoCount->value());
+ settings->SetDefaultSeamAllowance(ui->defaultSeamAllowance->value());
+
settings->SetForbidWorkpieceFlipping(ui->forbidFlippingCheck->isChecked());
settings->SetHideMainPath(ui->checkBoxHideMainPath->isChecked());
diff --git a/src/app/valentina/dialogs/configpages/preferencespatternpage.ui b/src/app/valentina/dialogs/configpages/preferencespatternpage.ui
index 403b37069..ffd7d7f26 100644
--- a/src/app/valentina/dialogs/configpages/preferencespatternpage.ui
+++ b/src/app/valentina/dialogs/configpages/preferencespatternpage.ui
@@ -7,7 +7,7 @@
0
0
327
- 414
+ 482
@@ -136,6 +136,38 @@
+ -
+
+
+ Seam allowance
+
+
+
-
+
+
+ Default value:
+
+
+
+ -
+
+
+ 3
+
+
+ 10.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+
+
+
-
diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp
index faf22e74c..26f1d5f63 100644
--- a/src/libs/vmisc/vcommonsettings.cpp
+++ b/src/libs/vmisc/vcommonsettings.cpp
@@ -43,6 +43,8 @@
#include "../vmisc/def.h"
#include "../vmisc/vmath.h"
#include "../vpatterndb/pmsystems.h"
+//#include "../ifc/xml/vdomdocument.h"
+
const QString settingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements");
const QString settingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements");
@@ -59,11 +61,12 @@ const QString settingConfigurationConfirmItemDeletion = QStringLiteral("confi
const QString settingConfigurationConfirmFormatRewriting = QStringLiteral("configuration/confirm_format_rewriting");
const QString settingConfigurationToolBarStyle = QStringLiteral("configuration/tool_bar_style");
-const QString settingPatternUser = QStringLiteral("pattern/user");
-const QString settingPatternUndo = QStringLiteral("pattern/undo");
-const QString settingPatternForbidFlipping = QStringLiteral("pattern/forbidFlipping");
-const QString settingPatternHideMainPath = QStringLiteral("pattern/hideMainPath");
-const QString settingDoublePassmark = QStringLiteral("pattern/doublePassmark");
+const QString settingPatternUser = QStringLiteral("pattern/user");
+const QString settingPatternUndo = QStringLiteral("pattern/undo");
+const QString settingPatternForbidFlipping = QStringLiteral("pattern/forbidFlipping");
+const QString settingPatternHideMainPath = QStringLiteral("pattern/hideMainPath");
+const QString settingDoublePassmark = QStringLiteral("pattern/doublePassmark");
+const QString settingPatternDefaultSeamAllowance = QStringLiteral("pattern/defaultSeamAllowance");
const QString settingGeneralRecentFileList = QStringLiteral("recentFileList");
const QString settingGeneralRestoreFileList = QStringLiteral("restoreFileList");
@@ -755,3 +758,50 @@ QChar VCommonSettings::GetDefCSVSeparator() const
{
return QChar(',');
}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VCommonSettings::SetDefaultSeamAllowance(double value)
+{
+ setValue(settingPatternDefaultSeamAllowance, value);
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+/**
+ * @brief returns the default seam allowance. The corresponding unit is the default unit.
+ * @return the default seam allowance
+ */
+double VCommonSettings::GetDefaultSeamAllowance()
+{
+ double defaultValue;
+
+ //Unit globalUnit = VDomDocument::StrToUnits(GetUnit());
+ Unit globalUnit = Unit::Cm; // just for test purpuses
+
+ switch (globalUnit)
+ {
+ case Unit::Mm:
+ defaultValue = 10;
+ break;
+ case Unit::Inch:
+ defaultValue = 0.25;
+ break;
+ default:
+ case Unit::Cm:
+ defaultValue = 1;
+ break;
+ }
+
+ bool ok = false;
+ double val = value(settingPatternDefaultSeamAllowance, defaultValue).toDouble(&ok);
+ if (ok == false)
+ {
+ qDebug()<< "Could not convert value"<