2014-11-22 17:15:47 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vsettings.cpp
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 22 11, 2014
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2014-11-22 17:15:47 +01:00
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** 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/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "vsettings.h"
|
|
|
|
|
|
|
|
#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>
|
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"
|
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
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
const QString settingConfigurationLabelLanguage = QStringLiteral("configuration/label_language");
|
|
|
|
|
|
|
|
const QString settingPathsPattern = QStringLiteral("paths/pattern");
|
|
|
|
const QString settingPathsLayout = QStringLiteral("paths/layout");
|
|
|
|
|
2017-08-30 06:26:18 +02:00
|
|
|
const QString settingPatternGraphicalOutput = QStringLiteral("pattern/graphicalOutput");
|
|
|
|
const QString settingPatternKnownMaterials = QStringLiteral("pattern/knownMaterials");
|
|
|
|
const QString settingPatternRememberMaterials = QStringLiteral("pattern/rememberMaterials");
|
2017-04-11 10:16:11 +02:00
|
|
|
|
|
|
|
const QString settingLayoutWidth = QStringLiteral("layout/width");
|
|
|
|
const QString settingLayoutSorting = QStringLiteral("layout/sorting");
|
|
|
|
const QString settingLayoutPaperHeight = QStringLiteral("layout/paperHeight");
|
|
|
|
const QString settingLayoutPaperWidth = QStringLiteral("layout/paperWidth");
|
|
|
|
const QString settingLayoutShift = QStringLiteral("layout/shift");
|
|
|
|
const QString settingLayoutRotate = QStringLiteral("layout/Rotate");
|
|
|
|
const QString settingLayoutRotationIncrease = QStringLiteral("layout/rotationIncrease");
|
|
|
|
const QString settingLayoutAutoCrop = QStringLiteral("layout/autoCrop");
|
|
|
|
const QString settingLayoutSaveLength = QStringLiteral("layout/saveLength");
|
|
|
|
const QString settingLayoutUnitePages = QStringLiteral("layout/unitePages");
|
|
|
|
const QString settingFields = QStringLiteral("layout/fields");
|
|
|
|
const QString settingIgnoreFields = QStringLiteral("layout/ignoreFields");
|
|
|
|
const QString settingStripOptimization = QStringLiteral("layout/stripOptimization");
|
|
|
|
const QString settingMultiplier = QStringLiteral("layout/multiplier");
|
2017-07-01 19:32:54 +02:00
|
|
|
const QString settingTextAsPaths = QStringLiteral("layout/textAsPaths");
|
|
|
|
}
|
2015-05-08 16:24:20 +02:00
|
|
|
|
2014-11-22 17:15:47 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VSettings::VSettings(Format format, Scope scope, const QString &organization, const QString &application,
|
|
|
|
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
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-11-28 19:41:46 +01:00
|
|
|
QString VSettings::GetLabelLanguage() const
|
2014-11-22 17:15:47 +01:00
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
return value(settingConfigurationLabelLanguage, QLocale().bcp47Name()).toString();
|
2014-11-22 17:15:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetLabelLanguage(const QString &value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingConfigurationLabelLanguage, value);
|
2014-11-22 17:15:47 +01:00
|
|
|
}
|
|
|
|
|
2017-02-17 19:37:49 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
QString VSettings::GetDefPathPattern()
|
|
|
|
{
|
|
|
|
return QDir::homePath() + QLatin1String("/valentina/") + tr("patterns");
|
|
|
|
}
|
|
|
|
|
2014-11-22 17:15:47 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-11-28 19:41:46 +01:00
|
|
|
QString VSettings::GetPathPattern() const
|
2014-11-22 17:15:47 +01:00
|
|
|
{
|
2015-10-18 15:17:56 +02:00
|
|
|
QSettings settings(this->format(), this->scope(), this->organizationName(), this->applicationName());
|
2017-04-11 10:16:11 +02:00
|
|
|
return settings.value(settingPathsPattern, GetDefPathPattern()).toString();
|
2014-11-22 17:15:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetPathPattern(const QString &value)
|
|
|
|
{
|
2015-10-18 15:13:51 +02:00
|
|
|
QSettings settings(this->format(), this->scope(), this->organizationName(), this->applicationName());
|
2017-04-11 10:16:11 +02:00
|
|
|
settings.setValue(settingPathsPattern, value);
|
2015-10-18 14:38:05 +02:00
|
|
|
settings.sync();
|
2014-11-22 17:15:47 +01:00
|
|
|
}
|
|
|
|
|
2017-02-17 19:37:49 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
QString VSettings::GetDefPathLayout()
|
|
|
|
{
|
|
|
|
return QDir::homePath() + QLatin1String("/valentina/") + tr("layouts");
|
|
|
|
}
|
|
|
|
|
2015-01-26 15:08:09 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
QString VSettings::GetPathLayout() const
|
|
|
|
{
|
2015-10-18 15:13:51 +02:00
|
|
|
QSettings settings(this->format(), this->scope(), this->organizationName(), this->applicationName());
|
2017-04-11 10:16:11 +02:00
|
|
|
return settings.value(settingPathsLayout, GetDefPathLayout()).toString();
|
2015-01-26 15:08:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetPathLayout(const QString &value)
|
|
|
|
{
|
2015-10-18 15:13:51 +02:00
|
|
|
QSettings settings(this->format(), this->scope(), this->organizationName(), this->applicationName());
|
2017-04-11 10:16:11 +02: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
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-11-28 19:41:46 +01:00
|
|
|
bool VSettings::GetGraphicalOutput() const
|
2014-11-22 17:15:47 +01:00
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
return value(settingPatternGraphicalOutput, 1).toBool();
|
2014-11-22 17:15:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetGraphicalOutput(const bool &value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingPatternGraphicalOutput, value);
|
2014-11-22 17:15:47 +01:00
|
|
|
}
|
|
|
|
|
2015-05-08 16:24:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 12:07:51 +01:00
|
|
|
qreal VSettings::GetLayoutPaperHeight() const
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2015-11-05 12:07:51 +01:00
|
|
|
const qreal def = UnitConvertor(1189/*A0*/, Unit::Mm, Unit::Px);
|
2015-05-08 16:24:20 +02:00
|
|
|
bool ok = false;
|
2017-04-11 10:16:11 +02:00
|
|
|
const qreal height = value(settingLayoutPaperHeight, def).toDouble(&ok);
|
2015-05-08 16:24:20 +02:00
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
return height;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 12:07:51 +01:00
|
|
|
void VSettings::SetLayoutPaperHeight(qreal value)
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutPaperHeight, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 12:07:51 +01:00
|
|
|
qreal VSettings::GetLayoutPaperWidth() const
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2015-11-05 12:07:51 +01:00
|
|
|
const qreal def = UnitConvertor(841/*A0*/, Unit::Mm, Unit::Px);
|
2015-05-08 16:24:20 +02:00
|
|
|
bool ok = false;
|
2017-04-11 10:16:11 +02:00
|
|
|
const qreal width = value(settingLayoutPaperWidth, def).toDouble(&ok);
|
2015-05-08 16:24:20 +02:00
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
return width;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 12:07:51 +01:00
|
|
|
void VSettings::SetLayoutPaperWidth(qreal value)
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutPaperWidth, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 13:32:47 +01:00
|
|
|
qreal VSettings::GetLayoutShift() const
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2015-11-05 13:32:47 +01:00
|
|
|
const qreal def = GetDefLayoutShift();
|
2015-05-08 16:24:20 +02:00
|
|
|
bool ok = false;
|
2017-04-11 10:16:11 +02:00
|
|
|
const qreal shift = value(settingLayoutShift, def).toDouble(&ok);
|
2015-05-08 16:24:20 +02:00
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
return shift;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 12:07:51 +01:00
|
|
|
qreal VSettings::GetDefLayoutShift()
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2016-03-28 16:19:29 +02:00
|
|
|
return 0;
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 13:32:47 +01:00
|
|
|
void VSettings::SetLayoutShift(qreal value)
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutShift, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 13:32:47 +01:00
|
|
|
qreal VSettings::GetLayoutWidth() const
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2015-11-05 13:32:47 +01:00
|
|
|
const qreal def = GetDefLayoutWidth();
|
2015-05-08 16:24:20 +02:00
|
|
|
bool ok = false;
|
2017-04-11 10:16:11 +02:00
|
|
|
const qreal lWidth = value(settingLayoutWidth, def).toDouble(&ok);
|
2015-05-08 16:24:20 +02:00
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
return lWidth;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 12:07:51 +01:00
|
|
|
qreal VSettings::GetDefLayoutWidth()
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2015-11-05 12:07:51 +01:00
|
|
|
return UnitConvertor(2.5, Unit::Mm, Unit::Px);
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-05 13:32:47 +01:00
|
|
|
void VSettings::SetLayoutWidth(qreal value)
|
2015-05-08 16:24:20 +02:00
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutWidth, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
2015-11-09 12:33:36 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2016-09-30 18:33:10 +02:00
|
|
|
QMarginsF VSettings::GetFields(const QMarginsF &def) const
|
2015-11-09 12:33:36 +01:00
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
const QVariant val = value(settingFields, QVariant::fromValue(def));
|
2015-11-09 12:33:36 +01:00
|
|
|
if (val.canConvert<QMarginsF>())
|
|
|
|
{
|
|
|
|
return val.value<QMarginsF>();
|
|
|
|
}
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetFields(const QMarginsF &value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingFields, QVariant::fromValue(value));
|
2015-11-09 12:33:36 +01:00
|
|
|
}
|
|
|
|
|
2015-05-08 16:24:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
Cases VSettings::GetLayoutGroup() const
|
|
|
|
{
|
|
|
|
const Cases def = GetDefLayoutGroup();
|
|
|
|
bool ok = false;
|
2017-04-11 10:16:11 +02:00
|
|
|
const int g = value(settingLayoutSorting, static_cast<int>(def)).toInt(&ok);
|
2015-05-08 16:24:20 +02:00
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
if (g >= static_cast<int>(Cases::UnknownCase))
|
|
|
|
{
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return static_cast<Cases>(g);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
Cases VSettings::GetDefLayoutGroup()
|
|
|
|
{
|
|
|
|
return Cases::CaseDesc;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetLayoutGroup(const Cases &value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutSorting, static_cast<int>(value));
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetLayoutRotate() const
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
return value(settingLayoutRotate, GetDefLayoutRotate()).toBool();
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetDefLayoutRotate()
|
|
|
|
{
|
2016-03-28 16:19:29 +02:00
|
|
|
return false;
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetLayoutRotate(bool value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutRotate, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
int VSettings::GetLayoutRotationIncrease() const
|
|
|
|
{
|
|
|
|
const int def = GetDefLayoutRotationIncrease();
|
|
|
|
bool ok = false;
|
2017-04-11 10:16:11 +02:00
|
|
|
const int r = value(settingLayoutRotationIncrease, def).toInt(&ok);
|
2015-05-08 16:24:20 +02:00
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
if (not (r >= 1 && r <= 180 && 360 % r == 0))
|
|
|
|
{
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
int VSettings::GetDefLayoutRotationIncrease()
|
|
|
|
{
|
|
|
|
return 180;/*degree*/
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetLayoutRotationIncrease(int value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutRotationIncrease, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetLayoutAutoCrop() const
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
return value(settingLayoutAutoCrop, GetDefLayoutAutoCrop()).toBool();
|
2015-11-09 12:33:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetDefLayoutAutoCrop()
|
|
|
|
{
|
|
|
|
return false;
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetLayoutAutoCrop(bool value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutAutoCrop, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetLayoutSaveLength() const
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
return value(settingLayoutSaveLength, GetDefLayoutSaveLength()).toBool();
|
2015-11-09 12:33:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetDefLayoutSaveLength()
|
|
|
|
{
|
|
|
|
return false;
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetLayoutSaveLength(bool value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutSaveLength, value);
|
2015-05-08 16:24:20 +02:00
|
|
|
}
|
|
|
|
|
2015-05-18 13:26:37 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetLayoutUnitePages() const
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
return value(settingLayoutUnitePages, GetDefLayoutUnitePages()).toBool();
|
2015-11-09 12:33:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetDefLayoutUnitePages()
|
|
|
|
{
|
|
|
|
return false;
|
2015-05-18 13:26:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetLayoutUnitePages(bool value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingLayoutUnitePages, value);
|
2015-05-18 13:26:37 +02:00
|
|
|
}
|
|
|
|
|
2015-11-09 12:33:36 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetIgnoreAllFields() const
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
return value(settingIgnoreFields, GetDefIgnoreAllFields()).toBool();
|
2015-11-09 12:33:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetDefIgnoreAllFields()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetIgnoreAllFields(bool value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingIgnoreFields, value);
|
2015-11-09 12:33:36 +01:00
|
|
|
}
|
2016-02-23 13:13:10 +01:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetStripOptimization() const
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
return value(settingStripOptimization, GetDefStripOptimization()).toBool();
|
2016-02-23 13:13:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetDefStripOptimization()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetStripOptimization(bool value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
setValue(settingStripOptimization, value);
|
2016-02-23 13:13:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
quint8 VSettings::GetMultiplier() const
|
|
|
|
{
|
2017-04-11 10:16:11 +02:00
|
|
|
return static_cast<quint8>(value(settingMultiplier, GetDefMultiplier()).toUInt());
|
2016-02-23 13:13:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
quint8 VSettings::GetDefMultiplier()
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetMultiplier(quint8 value)
|
|
|
|
{
|
2017-04-11 10:16:11 +02: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
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetTextAsPaths() const
|
|
|
|
{
|
|
|
|
return value(settingTextAsPaths, GetDefTextAsPaths()).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::GetDefTextAsPaths()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetTextAsPaths(bool value)
|
|
|
|
{
|
|
|
|
setValue(settingTextAsPaths, value);
|
|
|
|
}
|
|
|
|
|
2017-08-28 15:03:19 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
QStringList VSettings::GetKnownMaterials() const
|
|
|
|
{
|
|
|
|
return value(settingPatternKnownMaterials, QStringList()).toStringList();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetKnownMaterials(const QStringList &list)
|
|
|
|
{
|
|
|
|
setValue(settingPatternKnownMaterials, list);
|
|
|
|
}
|
2017-08-30 06:26:18 +02:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VSettings::IsRememberPatternMaterials() const
|
|
|
|
{
|
|
|
|
return value(settingPatternRememberMaterials, true).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VSettings::SetRememberPatternMaterials(bool value)
|
|
|
|
{
|
|
|
|
setValue(settingPatternRememberMaterials, value);
|
|
|
|
}
|