2015-07-15 09:16:59 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vtapesettings.cpp
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 15 7, 2015
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2015-07-15 09:16:59 +02:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2015 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2015-07-15 09:16:59 +02: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/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "vtapesettings.h"
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QStaticStringData>
|
|
|
|
#include <QStringData>
|
|
|
|
#include <QStringDataPtr>
|
|
|
|
#include <QVariant>
|
2018-03-14 14:39:15 +01:00
|
|
|
#include <QGlobalStatic>
|
2015-07-18 14:39:33 +02:00
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDataBaseGeometry, (QLatin1String("database/geometry")))
|
2015-07-25 14:59:40 +02:00
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDefHeight, (QLatin1String("gradation/defHeight")))
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDefSize, (QLatin1String("gradation/defSize")))
|
|
|
|
}
|
2015-12-12 12:11:39 +01:00
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VTapeSettings::VTapeSettings(Format format, Scope scope, const QString &organization, const QString &application,
|
|
|
|
QObject *parent)
|
|
|
|
:VCommonSettings(format, scope, organization, application, parent)
|
|
|
|
{
|
|
|
|
}
|
2015-07-18 14:39:33 +02:00
|
|
|
|
2015-08-01 19:09:10 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
QByteArray VTapeSettings::GetDataBaseGeometry() const
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
return value(*settingDataBaseGeometry).toByteArray();
|
2015-08-01 19:09:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VTapeSettings::SetDataBaseGeometry(const QByteArray &value)
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
setValue(*settingDataBaseGeometry, value);
|
2015-08-01 19:09:10 +02:00
|
|
|
}
|
2015-12-12 12:11:39 +01:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VTapeSettings::SetDefHeight(int value)
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
setValue(*settingDefHeight, value);
|
2015-12-12 12:11:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
int VTapeSettings::GetDefHeight() const
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
return value(*settingDefHeight, 176).toInt();
|
2015-12-12 12:11:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VTapeSettings::SetDefSize(int value)
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
setValue(*settingDefSize, value);
|
2015-12-12 12:11:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
int VTapeSettings::GetDefSize() const
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
return value(*settingDefSize, 50).toInt();
|
2015-12-12 12:11:39 +01:00
|
|
|
}
|