2019-03-29 10:31:17 +01:00
|
|
|
|
/************************************************************************
|
2014-11-22 17:15:47 +01:00
|
|
|
|
**
|
|
|
|
|
** @file vsettings.cpp
|
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
|
** @date 22 11, 2014
|
|
|
|
|
**
|
|
|
|
|
** @brief
|
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2014-11-22 17:15:47 +01:00
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2014-11-22 17:15:47 +01:00
|
|
|
|
**
|
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
** (at your option) any later version.
|
|
|
|
|
**
|
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
|
**
|
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
**
|
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
2020-05-10 17:32:14 +02:00
|
|
|
|
#include "vvalentinasettings.h"
|
2014-11-22 17:15:47 +01:00
|
|
|
|
|
|
|
|
|
#include <QDir>
|
2014-11-28 19:33:28 +01:00
|
|
|
|
#include <QLocale>
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include <QMetaType>
|
2015-11-09 12:33:36 +01:00
|
|
|
|
#include <QPrinter>
|
|
|
|
|
#include <QSharedPointer>
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include <QStaticStringData>
|
|
|
|
|
#include <QStringData>
|
|
|
|
|
#include <QStringDataPtr>
|
|
|
|
|
#include <QVariant>
|
2016-08-22 18:43:22 +02:00
|
|
|
|
#include <QPrinterInfo>
|
2017-10-10 11:22:59 +02:00
|
|
|
|
#include <QtDebug>
|
2018-03-14 14:39:15 +01:00
|
|
|
|
#include <QGlobalStatic>
|
2014-11-22 17:15:47 +01:00
|
|
|
|
|
2016-08-09 15:55:46 +02:00
|
|
|
|
#include "../vmisc/def.h"
|
2016-08-16 18:57:32 +02:00
|
|
|
|
#include "../vmisc/vmath.h"
|
2019-07-22 16:06:30 +02:00
|
|
|
|
#include "../vlayout/vbank.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
|
|
2015-11-16 13:07:28 +01:00
|
|
|
|
Q_DECLARE_METATYPE(QMarginsF)
|
|
|
|
|
|
2017-07-01 19:32:54 +02:00
|
|
|
|
namespace
|
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationLabelLanguage,
|
|
|
|
|
(QLatin1String("configuration/label_language")))
|
2019-11-28 14:17:27 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingAutoRefreshPatternMessage,
|
|
|
|
|
(QLatin1String("configuration/autoRefreshPatternMessage")))
|
2020-06-04 12:45:32 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingToolPanelScaling,
|
|
|
|
|
(QLatin1String("configuration/toolPanelScaling")))
|
2017-04-11 10:16:11 +02:00
|
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPathsLayout, (QLatin1String("paths/layout")))
|
2017-04-11 10:16:11 +02:00
|
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternKnownMaterials, (QLatin1String("pattern/knownMaterials")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternRememberMaterials, (QLatin1String("pattern/rememberMaterials")))
|
2017-04-11 10:16:11 +02:00
|
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutWidth, (QLatin1String("layout/width")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSorting, (QLatin1String("layout/sorting")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPaperHeight, (QLatin1String("layout/paperHeight")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPaperWidth, (QLatin1String("layout/paperWidth")))
|
2018-12-27 14:54:29 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutFollowGrainline, (QLatin1String("layout/followGrainline")))
|
2019-07-21 15:26:21 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutManualPriority, (QLatin1String("layout/manualPriority")))
|
2019-07-04 13:33:45 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutNestQuantity, (QLatin1String("layout/nestQuantity")))
|
2019-10-16 10:16:16 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutAutoCropLength, (QLatin1String("layout/autoCropLength")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutAutoCropWidth, (QLatin1String("layout/autoCropWidth")))
|
2018-03-14 14:39:15 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSaveLength, (QLatin1String("layout/saveLength")))
|
2020-03-25 14:28:23 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPreferOneSheetSolution,
|
|
|
|
|
(QLatin1String("layout/preferOneSheetSolution")))
|
2018-03-14 14:39:15 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutUnitePages, (QLatin1String("layout/unitePages")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingFields, (QLatin1String("layout/fields")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingIgnoreFields, (QLatin1String("layout/ignoreFields")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingStripOptimization, (QLatin1String("layout/stripOptimization")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingMultiplier, (QLatin1String("layout/multiplier")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTextAsPaths, (QLatin1String("layout/textAsPaths")))
|
2019-03-29 10:31:17 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingNestingTime, (QLatin1String("layout/time")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingEfficiencyCoefficient, (QLatin1String("layout/efficiencyCoefficient")))
|
2021-04-23 17:03:16 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutExportFormat, (QLatin1String("layout/exportFormat")))
|
2017-10-10 11:22:59 +02:00
|
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTiledPDFPaperHeight, (QLatin1String("tiledPDF/paperHeight")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTiledPDFPaperWidth, (QLatin1String("tiledPDF/paperWidth")))
|
2018-05-11 11:42:20 +02:00
|
|
|
|
|
2019-10-28 16:44:31 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingdockWidgetGroupsActive, (QLatin1String("dockWidget/groupsActive")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDockWidgetToolOptionsActive,
|
|
|
|
|
(QLatin1String("dockWidget/toolOptionsActive")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDockWidgetPatternMessagesActive,
|
|
|
|
|
(QLatin1String("dockWidget/patternMessagesActive")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternMessagesFontSize, (QLatin1String("font/patternMessagesSize")))
|
|
|
|
|
|
2019-12-13 09:51:29 +01:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingWatermarkEditorSize, (QLatin1String("watermarkEditorSize")))
|
2017-07-01 19:32:54 +02:00
|
|
|
|
}
|
2015-05-08 16:24:20 +02:00
|
|
|
|
|
2014-11-22 17:15:47 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
VValentinaSettings::VValentinaSettings(Format format, Scope scope, const QString &organization, const QString &application,
|
2014-11-22 17:15:47 +01:00
|
|
|
|
QObject *parent)
|
2015-07-15 09:16:59 +02:00
|
|
|
|
:VCommonSettings(format, scope, organization, application, parent)
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
|
|
|
|
qRegisterMetaTypeStreamOperators<QMarginsF>("QMarginsF");
|
|
|
|
|
}
|
2014-11-22 17:15:47 +01:00
|
|
|
|
|
2020-03-25 14:28:23 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
VValentinaSettings::VValentinaSettings(const QString &fileName, QSettings::Format format, QObject *parent)
|
2020-03-25 14:28:23 +01:00
|
|
|
|
:VCommonSettings(fileName, format, parent)
|
|
|
|
|
{
|
|
|
|
|
qRegisterMetaTypeStreamOperators<QMarginsF>("QMarginsF");
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-22 16:06:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
QString VValentinaSettings::GetLabelLanguage() const
|
2014-11-22 17:15:47 +01:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return value(*settingConfigurationLabelLanguage, QLocale().bcp47Name()).toString();
|
2014-11-22 17:15:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLabelLanguage(const QString &value)
|
2014-11-22 17:15:47 +01:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingConfigurationLabelLanguage, value);
|
2014-11-22 17:15:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
2017-02-17 19:37:49 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
QString VValentinaSettings::GetDefPathLayout()
|
2017-02-17 19:37:49 +01:00
|
|
|
|
{
|
2019-07-22 16:06:30 +02:00
|
|
|
|
return QDir::homePath() + QStringLiteral("/valentina/") + tr("layouts");
|
2017-02-17 19:37:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
2015-01-26 15:08:09 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
QString VValentinaSettings::GetPathLayout() const
|
2015-01-26 15:08:09 +01:00
|
|
|
|
{
|
2015-10-18 15:13:51 +02:00
|
|
|
|
QSettings settings(this->format(), this->scope(), this->organizationName(), this->applicationName());
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return settings.value(*settingPathsLayout, GetDefPathLayout()).toString();
|
2015-01-26 15:08:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetPathLayout(const QString &value)
|
2015-01-26 15:08:09 +01:00
|
|
|
|
{
|
2015-10-18 15:13:51 +02:00
|
|
|
|
QSettings settings(this->format(), this->scope(), this->organizationName(), this->applicationName());
|
2018-03-14 14:39:15 +01:00
|
|
|
|
settings.setValue(*settingPathsLayout, value);
|
2015-10-18 14:38:05 +02:00
|
|
|
|
settings.sync();
|
2015-01-26 15:08:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-22 17:15:47 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
qreal VValentinaSettings::GetLayoutPaperHeight() const
|
2014-11-22 17:15:47 +01:00
|
|
|
|
{
|
2020-05-10 17:32:14 +02:00
|
|
|
|
return ValueOrDef<qreal>(*this, *settingLayoutPaperHeight, UnitConvertor(1189/*A0*/, Unit::Mm, Unit::Px));
|
2014-11-22 17:15:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-10 15:39:37 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutPaperHeight(qreal value)
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingLayoutPaperHeight, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
qreal VValentinaSettings::GetLayoutPaperWidth() const
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2020-05-10 17:32:14 +02:00
|
|
|
|
return ValueOrDef<qreal>(*this, *settingLayoutPaperWidth, UnitConvertor(841/*A0*/, Unit::Mm, Unit::Px));
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutPaperWidth(qreal value)
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingLayoutPaperWidth, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
qreal VValentinaSettings::GetLayoutWidth() const
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2020-05-10 17:32:14 +02:00
|
|
|
|
return ValueOrDef<qreal>(*this, *settingLayoutWidth, GetDefLayoutWidth());
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
qreal VValentinaSettings::GetDefLayoutWidth()
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2019-03-29 10:31:17 +01:00
|
|
|
|
return UnitConvertor(2.5, Unit::Mm, Unit::Px);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutWidth(qreal value)
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2019-03-29 10:31:17 +01:00
|
|
|
|
setValue(*settingLayoutWidth, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
int VValentinaSettings::GetNestingTime() const
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2020-05-10 17:32:14 +02:00
|
|
|
|
return ValueOrDef<int>(*this, *settingNestingTime, GetDefNestingTime());
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetNestingTime(int value)
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2019-03-29 10:31:17 +01:00
|
|
|
|
setValue(*settingNestingTime, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
qreal VValentinaSettings::GetEfficiencyCoefficient() const
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2020-05-10 17:32:14 +02:00
|
|
|
|
return ValueOrDef<qreal>(*this, *settingEfficiencyCoefficient, GetDefEfficiencyCoefficient());
|
2019-03-29 10:31:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetEfficiencyCoefficient(qreal value)
|
2019-03-29 10:31:17 +01:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingEfficiencyCoefficient, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-11-09 12:33:36 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
QMarginsF VValentinaSettings::GetFields(const QMarginsF &def) const
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
2020-05-10 17:32:14 +02:00
|
|
|
|
return ValueOrDef<QMarginsF>(*this, *settingFields, def);
|
2015-11-09 12:33:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetFields(const QMarginsF &value)
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingFields, QVariant::fromValue(value));
|
2015-11-09 12:33:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
2015-05-08 16:24:20 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
Cases VValentinaSettings::GetLayoutGroup() const
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2020-05-10 17:32:14 +02:00
|
|
|
|
return ValueOrDef<Cases>(*this, *settingLayoutSorting, GetDefLayoutGroup());
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
Cases VValentinaSettings::GetDefLayoutGroup()
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
|
|
|
|
return Cases::CaseDesc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutGroup(const Cases &value)
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingLayoutSorting, static_cast<int>(value));
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-27 14:54:29 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetLayoutFollowGrainline() const
|
2018-12-27 14:54:29 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutFollowGrainline, GetDefLayoutFollowGrainline()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefLayoutFollowGrainline()
|
2018-12-27 14:54:29 +01:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutFollowGrainline(bool value)
|
2018-12-27 14:54:29 +01:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingLayoutFollowGrainline, value);
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-21 15:26:21 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetLayoutManualPriority() const
|
2019-07-21 15:26:21 +02:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutManualPriority, GetDefLayoutManualPriority()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefLayoutManualPriority()
|
2019-07-21 15:26:21 +02:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutManualPriority(bool value)
|
2019-07-21 15:26:21 +02:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingLayoutManualPriority, value);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-08 16:24:20 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetLayoutNestQuantity() const
|
2019-07-04 13:33:45 +02:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutNestQuantity, GetDefLayoutNestQuantity()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefLayoutNestQuantity()
|
2019-07-04 13:33:45 +02:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutNestQuantity(bool value)
|
2019-07-04 13:33:45 +02:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingLayoutNestQuantity, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetLayoutAutoCropLength() const
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2019-10-16 10:16:16 +02:00
|
|
|
|
return value(*settingLayoutAutoCropLength, GetDefLayoutAutoCropLength()).toBool();
|
2015-11-09 12:33:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefLayoutAutoCropLength()
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
|
|
|
|
return false;
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
2019-10-16 10:16:16 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutAutoCropLength(bool value)
|
2019-10-16 10:16:16 +02:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingLayoutAutoCropLength, value);
|
|
|
|
|
}
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetLayoutAutoCropWidth() const
|
2019-10-16 10:16:16 +02:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutAutoCropWidth, GetDefLayoutAutoCropWidth()).toBool();
|
|
|
|
|
}
|
2015-05-08 16:24:20 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefLayoutAutoCropWidth()
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2019-10-16 10:16:16 +02:00
|
|
|
|
return false;
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-10-16 10:16:16 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutAutoCropWidth(bool value)
|
2019-10-16 10:16:16 +02:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingLayoutAutoCropWidth, value);
|
|
|
|
|
}
|
2015-05-08 16:24:20 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetLayoutSaveLength() const
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return value(*settingLayoutSaveLength, GetDefLayoutSaveLength()).toBool();
|
2015-11-09 12:33:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefLayoutSaveLength()
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
|
|
|
|
return false;
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutSaveLength(bool value)
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingLayoutSaveLength, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
2020-03-25 14:28:23 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetLayoutPreferOneSheetSolution() const
|
2020-03-25 14:28:23 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutPreferOneSheetSolution, GetDefLayoutPreferOneSheetSolution()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefLayoutPreferOneSheetSolution()
|
2020-03-25 14:28:23 +01:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutPreferOneSheetSolution(bool value)
|
2020-03-25 14:28:23 +01:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingLayoutPreferOneSheetSolution, value);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-18 13:26:37 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetLayoutUnitePages() const
|
2015-05-18 13:26:37 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return value(*settingLayoutUnitePages, GetDefLayoutUnitePages()).toBool();
|
2015-11-09 12:33:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefLayoutUnitePages()
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
|
|
|
|
return false;
|
2015-05-18 13:26:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutUnitePages(bool value)
|
2015-05-18 13:26:37 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingLayoutUnitePages, value);
|
2015-05-18 13:26:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-11-09 12:33:36 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetIgnoreAllFields() const
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return value(*settingIgnoreFields, GetDefIgnoreAllFields()).toBool();
|
2015-11-09 12:33:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefIgnoreAllFields()
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetIgnoreAllFields(bool value)
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingIgnoreFields, value);
|
2015-11-09 12:33:36 +01:00
|
|
|
|
}
|
2016-02-23 13:13:10 +01:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetStripOptimization() const
|
2016-02-23 13:13:10 +01:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return value(*settingStripOptimization, GetDefStripOptimization()).toBool();
|
2016-02-23 13:13:10 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefStripOptimization()
|
2016-02-23 13:13:10 +01:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetStripOptimization(bool value)
|
2016-02-23 13:13:10 +01:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingStripOptimization, value);
|
2016-02-23 13:13:10 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
quint8 VValentinaSettings::GetMultiplier() const
|
2016-02-23 13:13:10 +01:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return static_cast<quint8>(value(*settingMultiplier, GetDefMultiplier()).toUInt());
|
2016-02-23 13:13:10 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
quint8 VValentinaSettings::GetDefMultiplier()
|
2016-02-23 13:13:10 +01:00
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetMultiplier(quint8 value)
|
2016-02-23 13:13:10 +01:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingMultiplier, value);
|
2016-02-23 13:13:10 +01:00
|
|
|
|
}
|
2016-08-12 01:22:23 +02:00
|
|
|
|
|
2017-07-01 19:32:54 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetTextAsPaths() const
|
2017-07-01 19:32:54 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return value(*settingTextAsPaths, GetDefTextAsPaths()).toBool();
|
2017-07-01 19:32:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefTextAsPaths()
|
2017-07-01 19:32:54 +02:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetTextAsPaths(bool value)
|
2017-07-01 19:32:54 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingTextAsPaths, value);
|
2017-07-01 19:32:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-28 15:03:19 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
QStringList VValentinaSettings::GetKnownMaterials() const
|
2017-08-28 15:03:19 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return value(*settingPatternKnownMaterials, QStringList()).toStringList();
|
2017-08-28 15:03:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetKnownMaterials(const QStringList &list)
|
2017-08-28 15:03:19 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingPatternKnownMaterials, list);
|
2017-08-28 15:03:19 +02:00
|
|
|
|
}
|
2017-08-30 06:26:18 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::IsRememberPatternMaterials() const
|
2017-08-30 06:26:18 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
return value(*settingPatternRememberMaterials, true).toBool();
|
2017-08-30 06:26:18 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetRememberPatternMaterials(bool value)
|
2017-08-30 06:26:18 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingPatternRememberMaterials, value);
|
2017-08-30 06:26:18 +02:00
|
|
|
|
}
|
2017-10-10 11:22:59 +02:00
|
|
|
|
|
|
|
|
|
// settings for the tiled PDFs
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
|
|
|
|
* @brief GetTiledPDFPaperHeight returns the paper height of tiled pdf in the desired unit.
|
2017-10-12 09:35:22 +02:00
|
|
|
|
* @param unit the unit in which are the value. Necessary because we save the values
|
|
|
|
|
* internaly as mm so there is conversion beeing made.
|
|
|
|
|
* @return tiled pdf paper height
|
2017-10-10 11:22:59 +02:00
|
|
|
|
*/
|
2020-05-10 17:32:14 +02:00
|
|
|
|
qreal VValentinaSettings::GetTiledPDFPaperHeight(const Unit &unit) const
|
2017-10-10 11:22:59 +02:00
|
|
|
|
{
|
2020-05-10 17:32:14 +02:00
|
|
|
|
return UnitConvertor(ValueOrDef<qreal>(*this, *settingTiledPDFPaperHeight, 297 /*A4*/), Unit::Mm, unit);
|
2017-10-10 11:22:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
|
|
|
|
* @brief SetTiledPDFPaperHeight sets the tiled pdf paper height
|
2017-10-12 09:35:22 +02:00
|
|
|
|
* @param value in mm
|
2017-10-10 11:22:59 +02:00
|
|
|
|
* @param unit unit of the given value
|
|
|
|
|
*/
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetTiledPDFPaperHeight(qreal value, const Unit &unit)
|
2017-10-10 11:22:59 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingTiledPDFPaperHeight, UnitConvertor(value, unit, Unit::Mm));
|
2017-10-10 11:22:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
|
|
|
|
* @brief GetTiledPDFPaperWidth returns the paper height of tiled pdf in the desired unit.
|
2017-10-12 09:35:22 +02:00
|
|
|
|
* @param unit the unit in which are the value. Necessary because we save the values
|
|
|
|
|
* internaly as mm so there is conversion beeing made.
|
|
|
|
|
* @return tiled pdf paper width
|
2017-10-10 11:22:59 +02:00
|
|
|
|
*/
|
2020-05-10 17:32:14 +02:00
|
|
|
|
qreal VValentinaSettings::GetTiledPDFPaperWidth(const Unit &unit) const
|
2017-10-10 11:22:59 +02:00
|
|
|
|
{
|
2020-05-10 17:32:14 +02:00
|
|
|
|
return UnitConvertor(ValueOrDef<qreal>(*this, *settingTiledPDFPaperWidth, 210 /*A4*/), Unit::Mm, unit);
|
2017-10-10 11:22:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
|
|
|
|
* @brief SetTiledPDFPaperWidth sets the tiled pdf paper width
|
|
|
|
|
* @param unit unit of the given value
|
2017-10-12 09:35:22 +02:00
|
|
|
|
* @param value in mm
|
2017-10-10 11:22:59 +02:00
|
|
|
|
*/
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetTiledPDFPaperWidth(qreal value, const Unit &unit)
|
2017-10-10 11:22:59 +02:00
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
|
setValue(*settingTiledPDFPaperWidth, UnitConvertor(value,unit, Unit::Mm));
|
2017-10-10 11:22:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-05-11 11:42:20 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::IsDockWidgetGroupsActive() const
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingdockWidgetGroupsActive, GetDefDockWidgetGroupsActive()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefDockWidgetGroupsActive()
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetDockWidgetGroupsActive(bool value)
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingdockWidgetGroupsActive, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::IsDockWidgetToolOptionsActive() const
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingDockWidgetToolOptionsActive, GetDefDockWidgetToolOptionsActive()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefDockWidgetToolOptionsActive()
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetDockWidgetToolOptionsActive(bool value)
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingDockWidgetToolOptionsActive, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::IsDockWidgetPatternMessagesActive() const
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingDockWidgetPatternMessagesActive, GetDefDockWidgetPatternMessagesActive()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetDefDockWidgetPatternMessagesActive()
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetDockWidgetPatternMessagesActive(bool value)
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingDockWidgetPatternMessagesActive, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
int VValentinaSettings::GetPatternMessageFontSize(int fontSizeDef) const
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
fontSizeDef = qBound(GetDefMinPatternMessageFontSize(), fontSizeDef, GetDefMaxPatternMessageFontSize());
|
|
|
|
|
const int fontSize = value(*settingPatternMessagesFontSize, fontSizeDef).toInt();
|
|
|
|
|
return qBound(GetDefMinPatternMessageFontSize(), fontSize, GetDefMaxPatternMessageFontSize());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
int VValentinaSettings::GetDefMinPatternMessageFontSize()
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return 5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
int VValentinaSettings::GetDefMaxPatternMessageFontSize()
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return 40;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetPatternMessageFontSize(int size)
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingPatternMessagesFontSize, qBound(GetDefMinPatternMessageFontSize(), size,
|
2019-11-28 14:17:27 +01:00
|
|
|
|
GetDefMaxPatternMessageFontSize()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
bool VValentinaSettings::GetAutoRefreshPatternMessage() const
|
2019-11-28 14:17:27 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingAutoRefreshPatternMessage, true).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetAutoRefreshPatternMessage(bool value)
|
2019-11-28 14:17:27 +01:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingAutoRefreshPatternMessage, value);
|
2019-10-28 16:44:31 +01:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 09:51:29 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
QSize VValentinaSettings::GetWatermarkEditorSize() const
|
2019-12-13 09:51:29 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingWatermarkEditorSize, QSize(0, 0)).toSize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2020-05-10 17:32:14 +02:00
|
|
|
|
void VValentinaSettings::SetWatermarkEditorSize(const QSize &sz)
|
2019-12-13 09:51:29 +01:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingWatermarkEditorSize, sz);
|
|
|
|
|
}
|
2020-06-04 12:45:32 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
bool VValentinaSettings::GetToolPanelScaling() const
|
|
|
|
|
{
|
|
|
|
|
return value(*settingToolPanelScaling, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetToolPanelScaling(const bool &value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingToolPanelScaling, value);
|
|
|
|
|
}
|
2020-06-01 11:21:09 +02:00
|
|
|
|
|
2021-04-23 17:03:16 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2021-04-24 12:05:13 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutExportFormat() const -> qint8
|
2021-04-23 17:03:16 +02:00
|
|
|
|
{
|
|
|
|
|
return qvariant_cast<qint8>(value(*settingLayoutExportFormat, 0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2021-04-24 12:05:13 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutExportFormat(qint8 format)
|
2021-04-23 17:03:16 +02:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingLayoutExportFormat, format);
|
|
|
|
|
}
|