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>
|
2023-06-21 09:24:51 +02:00
|
|
|
|
#include <QGlobalStatic>
|
2014-11-28 19:33:28 +01:00
|
|
|
|
#include <QLocale>
|
2023-06-21 09:24:51 +02:00
|
|
|
|
#include <QMargins>
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include <QMetaType>
|
2015-11-09 12:33:36 +01:00
|
|
|
|
#include <QPrinter>
|
2023-06-21 09:24:51 +02:00
|
|
|
|
#include <QPrinterInfo>
|
2015-11-09 12:33:36 +01:00
|
|
|
|
#include <QSharedPointer>
|
2016-08-08 13:44:49 +02:00
|
|
|
|
#include <QVariant>
|
2017-10-10 11:22:59 +02:00
|
|
|
|
#include <QtDebug>
|
2014-11-22 17:15:47 +01:00
|
|
|
|
|
2023-06-21 09:24:51 +02:00
|
|
|
|
#include "compatibility.h"
|
|
|
|
|
#include "def.h"
|
2022-02-04 10:01:52 +01:00
|
|
|
|
#include "qglobal.h"
|
2016-08-08 13:44:49 +02:00
|
|
|
|
|
2023-02-21 09:20:39 +01:00
|
|
|
|
#ifndef QPRINTENGINE_H
|
2023-01-18 16:15:16 +01:00
|
|
|
|
Q_DECLARE_METATYPE(QMarginsF) // NOLINT
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-07-01 19:32:54 +02:00
|
|
|
|
namespace
|
|
|
|
|
{
|
2023-06-21 09:24:51 +02:00
|
|
|
|
QT_WARNING_PUSH
|
|
|
|
|
QT_WARNING_DISABLE_CLANG("-Wunused-member-function")
|
|
|
|
|
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationLabelLanguage,
|
2018-03-14 14:39:15 +01:00
|
|
|
|
(QLatin1String("configuration/label_language")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
2023-08-29 17:49:16 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationToolPointerMode,
|
|
|
|
|
(QLatin1String("configuration/toolPointerMode")))
|
|
|
|
|
// NOLINTNEXTLINE
|
2023-09-04 12:56:08 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationUseToolGroups,
|
|
|
|
|
(QLatin1String("configuration/useToolGroups")))
|
|
|
|
|
// NOLINTNEXTLINE
|
2023-06-21 09:24:51 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingAutoRefreshPatternMessage,
|
2019-11-28 14:17:27 +01:00
|
|
|
|
(QLatin1String("configuration/autoRefreshPatternMessage")))
|
2017-04-11 10:16:11 +02:00
|
|
|
|
|
2023-06-22 17:30:43 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPathsLayout, (QLatin1String("paths/layout"))) // NOLINT
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPathsLabelTemplate, (QLatin1String("paths/labels"))) // NOLINT
|
2017-04-11 10:16:11 +02:00
|
|
|
|
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternKnownMaterials, (QLatin1String("pattern/knownMaterials")))
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternRememberMaterials, (QLatin1String("pattern/rememberMaterials")))
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternBackgroundImageDefOpacity,
|
2022-02-04 10:01:52 +01:00
|
|
|
|
(QLatin1String("pattern/backgroundImageDefOpacity")))
|
2017-04-11 10:16:11 +02:00
|
|
|
|
|
2023-06-21 09:24:51 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutWidth, (QLatin1String("layout/width"))) // NOLINT
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSorting, (QLatin1String("layout/sorting"))) // NOLINT
|
2022-08-12 17:50:13 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPaperHeight, (QLatin1String("layout/paperHeight"))) // NOLINT
|
2023-06-21 09:24:51 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPaperWidth, (QLatin1String("layout/paperWidth"))) // NOLINT
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutFollowGrainline, (QLatin1String("layout/followGrainline")))
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutManualPriority, (QLatin1String("layout/manualPriority")))
|
2022-08-12 17:50:13 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutNestQuantity, (QLatin1String("layout/nestQuantity"))) // NOLINT
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutAutoCropLength, (QLatin1String("layout/autoCropLength")))
|
2022-08-12 17:50:13 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutAutoCropWidth, (QLatin1String("layout/autoCropWidth"))) // NOLINT
|
2023-06-21 09:24:51 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSaveLength, (QLatin1String("layout/saveLength"))) // NOLINT
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPreferOneSheetSolution,
|
2020-03-25 14:28:23 +01:00
|
|
|
|
(QLatin1String("layout/preferOneSheetSolution")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutUnitePages, (QLatin1String("layout/unitePages"))) // NOLINT
|
2023-04-10 11:20:18 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutShowGrainline, (QLatin1String("layout/showGrainline"))) // NOLINT
|
2023-06-21 09:24:51 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingFields, (QLatin1String("layout/fields"))) // NOLINT
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingIgnoreFields, (QLatin1String("layout/ignoreFields"))) // NOLINT
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingStripOptimization, (QLatin1String("layout/stripOptimization")))
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingMultiplier, (QLatin1String("layout/multiplier"))) // NOLINT
|
2022-08-12 17:50:13 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTextAsPaths, (QLatin1String("layout/textAsPaths"))) // NOLINT
|
2023-06-21 09:24:51 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingNestingTime, (QLatin1String("layout/time"))) // NOLINT
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingEfficiencyCoefficient, (QLatin1String("layout/efficiencyCoefficient")))
|
2022-08-12 17:50:13 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutExportFormat, (QLatin1String("layout/exportFormat"))) // NOLINT
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDetailExportFormat, (QLatin1String("detail/exportFormat"))) // NOLINT
|
|
|
|
|
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTiledPDFPaperHeight, (QLatin1String("tiledPDF/paperHeight"))) // NOLINT
|
2023-06-21 09:24:51 +02:00
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTiledPDFPaperWidth, (QLatin1String("tiledPDF/paperWidth"))) // NOLINT
|
2022-08-12 17:50:13 +02:00
|
|
|
|
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingdockWidgetGroupsActive, (QLatin1String("dockWidget/groupsActive")))
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDockWidgetToolOptionsActive,
|
2019-10-28 16:44:31 +01:00
|
|
|
|
(QLatin1String("dockWidget/toolOptionsActive")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDockWidgetPatternMessagesActive,
|
2019-10-28 16:44:31 +01:00
|
|
|
|
(QLatin1String("dockWidget/patternMessagesActive")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDockWidgetBackgroundImagesActive,
|
2022-01-28 15:54:20 +01:00
|
|
|
|
(QLatin1String("dockWidget/backgroundImagesActive")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPatternMessagesFontSize, (QLatin1String("font/patternMessagesSize")))
|
|
|
|
|
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchHistoryHistory, (QLatin1String("searchHistory/history")))
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchHistoryIncrements, (QLatin1String("searchHistory/increments")))
|
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchHistoryPreviewCalculations,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchHistory/previewCalculations")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchHistoryFinalMeasurements,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchHistory/finalMeasurements")))
|
|
|
|
|
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsHistoryUseUnicodeProperties,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/historyUseUnicodeProperties")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsHistoryWholeWord,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/historyWholeWord")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsHistoryRegexp,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/historyRegexp")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsHistoryMatchCase,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/historyMatchCase")))
|
|
|
|
|
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsIncrementsUseUnicodeProperties,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/incrementsUseUnicodeProperties")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsIncrementsWholeWord,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/incrementsWholeWord")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsIncrementsRegexp,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/incrementsRegexp")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsIncrementsMatchCase,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/incrementsMatchCase")))
|
|
|
|
|
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsPreviewCalculationsUseUnicodeProperties,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/previewCalculationsUseUnicodeProperties")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsPreviewCalculationsWholeWord,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/previewCalculationsWholeWord")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsPreviewCalculationsRegexp,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/previewCalculationsRegexp")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsPreviewCalculationsMatchCase,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/previewCalculationsMatchCase")))
|
|
|
|
|
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsFinalMeasurementsUseUnicodeProperties,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/finalMeasurementsUseUnicodeProperties")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsFinalMeasurementsWholeWord,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/finalMeasurementsWholeWord")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsFinalMeasurementsRegexp,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/finalMeasurementsRegexp")))
|
2023-06-21 09:24:51 +02:00
|
|
|
|
// NOLINTNEXTLINE
|
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsFinalMeasurementsMatchCase,
|
2021-11-22 14:24:48 +01:00
|
|
|
|
(QLatin1String("searchOptions/finalMeasurementsMatchCase")))
|
2023-06-22 17:30:43 +02:00
|
|
|
|
|
2023-06-21 09:24:51 +02:00
|
|
|
|
QT_WARNING_POP
|
|
|
|
|
} // namespace
|
2015-05-08 16:24:20 +02:00
|
|
|
|
|
2014-11-22 17:15:47 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-06-21 09:24:51 +02:00
|
|
|
|
VValentinaSettings::VValentinaSettings(Format format, Scope scope, const QString &organization,
|
|
|
|
|
const QString &application, QObject *parent)
|
|
|
|
|
: VCommonSettings(format, scope, organization, application, parent)
|
2015-11-09 12:33:36 +01:00
|
|
|
|
{
|
2023-02-09 15:43:58 +01:00
|
|
|
|
REGISTER_META_TYPE_STREAM_OPERATORS(QMarginsF);
|
2015-11-09 12:33:36 +01:00
|
|
|
|
}
|
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)
|
2023-06-21 09:24:51 +02:00
|
|
|
|
: VCommonSettings(fileName, format, parent)
|
2020-03-25 14:28:23 +01:00
|
|
|
|
{
|
2023-02-09 15:43:58 +01:00
|
|
|
|
REGISTER_META_TYPE_STREAM_OPERATORS(QMarginsF);
|
2020-03-25 14:28:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
2019-07-22 16:06:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLabelLanguage() const -> QString
|
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
|
|
|
|
}
|
|
|
|
|
|
2015-01-26 15:08:09 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetPathLayout() const -> QString
|
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());
|
2023-10-05 15:51:21 +02:00
|
|
|
|
return settings.value(*settingPathsLayout, QDir::homePath()).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
|
|
|
|
}
|
|
|
|
|
|
2023-06-22 17:30:43 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetPathLabelTemplate() const -> QString
|
|
|
|
|
{
|
2023-10-05 15:51:21 +02:00
|
|
|
|
return value(*settingPathsLabelTemplate, QDir::homePath()).toString();
|
2023-06-22 17:30:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetPathLabelTemplate(const QString &value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingPathsLabelTemplate, value);
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-22 17:15:47 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutPaperHeight() const -> qreal
|
2014-11-22 17:15:47 +01:00
|
|
|
|
{
|
2023-06-21 09:24:51 +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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutPaperWidth() const -> qreal
|
2015-05-08 16:24:20 +02:00
|
|
|
|
{
|
2023-06-21 09:24:51 +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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutWidth() const -> qreal
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutWidth() -> qreal
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetNestingTime() const -> int
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetEfficiencyCoefficient() const -> qreal
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetFields(const QMarginsF &def) const -> QMarginsF
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutGroup() const -> Cases
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutGroup() -> Cases
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutFollowGrainline() const -> bool
|
2018-12-27 14:54:29 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutFollowGrainline, GetDefLayoutFollowGrainline()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutFollowGrainline() -> bool
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutManualPriority() const -> bool
|
2019-07-21 15:26:21 +02:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutManualPriority, GetDefLayoutManualPriority()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutManualPriority() -> bool
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutNestQuantity() const -> bool
|
2019-07-04 13:33:45 +02:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutNestQuantity, GetDefLayoutNestQuantity()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutNestQuantity() -> bool
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutAutoCropLength() const -> bool
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutAutoCropLength() -> bool
|
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);
|
|
|
|
|
}
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutAutoCropWidth() const -> bool
|
2019-10-16 10:16:16 +02:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutAutoCropWidth, GetDefLayoutAutoCropWidth()).toBool();
|
|
|
|
|
}
|
2015-05-08 16:24:20 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutAutoCropWidth() -> bool
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutSaveLength() const -> bool
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutSaveLength() -> bool
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutPreferOneSheetSolution() const -> bool
|
2020-03-25 14:28:23 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutPreferOneSheetSolution, GetDefLayoutPreferOneSheetSolution()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutPreferOneSheetSolution() -> bool
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetLayoutUnitePages() const -> bool
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefLayoutUnitePages() -> bool
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetIgnoreAllFields() const -> bool
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefIgnoreAllFields() -> bool
|
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
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetStripOptimization() const -> bool
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefStripOptimization() -> bool
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetMultiplier() const -> quint8
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefMultiplier() -> quint8
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetTextAsPaths() const -> bool
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefTextAsPaths() -> bool
|
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
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetKnownMaterials() const -> QStringList
|
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
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::IsRememberPatternMaterials() const -> bool
|
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
|
|
|
|
*/
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetTiledPDFPaperHeight(const Unit &unit) const -> qreal
|
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
|
|
|
|
*/
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetTiledPDFPaperWidth(const Unit &unit) const -> qreal
|
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
|
|
|
|
{
|
2023-06-21 09:24:51 +02:00
|
|
|
|
setValue(*settingTiledPDFPaperWidth, UnitConvertor(value, unit, Unit::Mm));
|
2017-10-10 11:22:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-05-11 11:42:20 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::IsDockWidgetGroupsActive() const -> bool
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingdockWidgetGroupsActive, GetDefDockWidgetGroupsActive()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefDockWidgetGroupsActive() -> bool
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::IsDockWidgetToolOptionsActive() const -> bool
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingDockWidgetToolOptionsActive, GetDefDockWidgetToolOptionsActive()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefDockWidgetToolOptionsActive() -> bool
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::IsDockWidgetPatternMessagesActive() const -> bool
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingDockWidgetPatternMessagesActive, GetDefDockWidgetPatternMessagesActive()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefDockWidgetPatternMessagesActive() -> bool
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-28 15:54:20 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::IsDockWidgetBackgroundImagesActive() const -> bool
|
2022-01-28 15:54:20 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingDockWidgetBackgroundImagesActive, GetDefDockWidgetBackgroundImagesActive()).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefDockWidgetBackgroundImagesActive() -> bool
|
2022-01-28 15:54:20 +01:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetDockWidgetBackgroundImagesActive(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingDockWidgetBackgroundImagesActive, value);
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-28 16:44:31 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetPatternMessageFontSize(int fontSizeDef) const -> int
|
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());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefMinPatternMessageFontSize() -> int
|
2019-10-28 16:44:31 +01:00
|
|
|
|
{
|
|
|
|
|
return 5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDefMaxPatternMessageFontSize() -> int
|
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
|
|
|
|
{
|
2023-06-21 09:24:51 +02:00
|
|
|
|
setValue(*settingPatternMessagesFontSize,
|
|
|
|
|
qBound(GetDefMinPatternMessageFontSize(), size, GetDefMaxPatternMessageFontSize()));
|
2019-11-28 14:17:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetAutoRefreshPatternMessage() const -> bool
|
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
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
{
|
2023-05-03 15:23:54 +02:00
|
|
|
|
return CastToLayoutExportFormat(qvariant_cast<qint8>(value(*settingLayoutExportFormat, 0)));
|
2021-04-23 17:03:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2021-04-24 12:05:13 +02:00
|
|
|
|
void VValentinaSettings::SetLayoutExportFormat(qint8 format)
|
2021-04-23 17:03:16 +02:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingLayoutExportFormat, format);
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 09:25:52 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetDetailExportFormat() const -> qint8
|
2021-06-28 09:25:52 +02:00
|
|
|
|
{
|
2023-05-03 15:23:54 +02:00
|
|
|
|
return CastToLayoutExportFormat(qvariant_cast<qint8>(value(*settingDetailExportFormat, 0)));
|
2021-06-28 09:25:52 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2021-07-26 15:47:54 +02:00
|
|
|
|
void VValentinaSettings::SetDetailExportFormat(qint8 format)
|
2021-06-28 09:25:52 +02:00
|
|
|
|
{
|
|
|
|
|
setValue(*settingDetailExportFormat, format);
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-22 14:24:48 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetHistorySearchHistory() const -> QStringList
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchHistoryHistory).toStringList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetHistorySearchHistory(const QStringList &history)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchHistoryHistory, history);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetIncrementsSearchHistory() const -> QStringList
|
2021-11-22 14:24:48 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchHistoryIncrements).toStringList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetIncrementsSearchHistory(const QStringList &history)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchHistoryIncrements, history);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetPreviewCalculationsSearchHistory() const -> QStringList
|
2021-11-22 14:24:48 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchHistoryPreviewCalculations).toStringList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetPreviewCalculationsSearchHistory(const QStringList &history)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchHistoryPreviewCalculations, history);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetFinalMeasurementsSearchHistory() const -> QStringList
|
2021-11-22 14:24:48 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchHistoryFinalMeasurements).toStringList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetFinalMeasurementsSearchHistory(const QStringList &history)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchHistoryFinalMeasurements, history);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetHistorySearchOptionUseUnicodeProperties() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsHistoryUseUnicodeProperties, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetHistorySearchOptionUseUnicodeProperties(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsHistoryUseUnicodeProperties, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetHistorySearchOptionWholeWord() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsHistoryWholeWord, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetHistorySearchOptionWholeWord(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsHistoryWholeWord, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetHistorySearchOptionRegexp() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsHistoryRegexp, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetHistorySearchOptionRegexp(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsHistoryRegexp, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetHistorySearchOptionMatchCase() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsHistoryMatchCase, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetHistorySearchOptionMatchCase(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsHistoryMatchCase, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetIncrementsSearchOptionUseUnicodeProperties() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsIncrementsUseUnicodeProperties, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetIncrementsSearchOptionUseUnicodeProperties(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsIncrementsUseUnicodeProperties, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetIncrementsSearchOptionWholeWord() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsIncrementsWholeWord, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetIncrementsSearchOptionWholeWord(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsIncrementsWholeWord, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetIncrementsSearchOptionRegexp() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsIncrementsRegexp, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetIncrementsSearchOptionRegexp(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsIncrementsRegexp, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetIncrementsSearchOptionMatchCase() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsIncrementsMatchCase, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetIncrementsSearchOptionMatchCase(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsIncrementsMatchCase, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetPreviewCalculationsSearchOptionUseUnicodeProperties() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsPreviewCalculationsUseUnicodeProperties, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetPreviewCalculationsSearchOptionUseUnicodeProperties(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsPreviewCalculationsUseUnicodeProperties, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetPreviewCalculationsSearchOptionWholeWord() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsPreviewCalculationsWholeWord, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetPreviewCalculationsSearchOptionWholeWord(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsPreviewCalculationsWholeWord, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetPreviewCalculationsSearchOptionRegexp() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsPreviewCalculationsRegexp, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetPreviewCalculationsSearchOptionRegexp(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsPreviewCalculationsRegexp, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetPreviewCalculationsSearchOptionMatchCase() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsPreviewCalculationsMatchCase, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetPreviewCalculationsSearchOptionMatchCase(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsPreviewCalculationsMatchCase, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetFinalMeasurementsSearchOptionUseUnicodeProperties() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsFinalMeasurementsUseUnicodeProperties, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetFinalMeasurementsSearchOptionUseUnicodeProperties(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsFinalMeasurementsUseUnicodeProperties, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetFinalMeasurementsSearchOptionWholeWord() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsFinalMeasurementsWholeWord, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetFinalMeasurementsSearchOptionWholeWord(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsFinalMeasurementsWholeWord, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetFinalMeasurementsSearchOptionRegexp() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsFinalMeasurementsRegexp, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetFinalMeasurementsSearchOptionRegexp(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsFinalMeasurementsRegexp, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetFinalMeasurementsSearchOptionMatchCase() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingSearchOptionsFinalMeasurementsMatchCase, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetFinalMeasurementsSearchOptionMatchCase(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingSearchOptionsFinalMeasurementsMatchCase, value);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-04 10:01:52 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetBackgroundImageDefOpacity() const -> int
|
2022-02-04 10:01:52 +01:00
|
|
|
|
{
|
|
|
|
|
return value(*settingPatternBackgroundImageDefOpacity, 100).toInt();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetBackgroundImageDefOpacity(int value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingPatternBackgroundImageDefOpacity, qBound(0, value, 100));
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-10 11:20:18 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
auto VValentinaSettings::GetShowGrainline() const -> bool
|
2023-04-10 11:20:18 +02:00
|
|
|
|
{
|
|
|
|
|
return value(*settingLayoutShowGrainline, true).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetShowGrainline(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingLayoutShowGrainline, value);
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-29 17:49:16 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::GetPointerMode() const -> VToolPointerMode
|
|
|
|
|
{
|
|
|
|
|
int val = value(*settingConfigurationToolPointerMode, static_cast<int>(VToolPointerMode::ToolIcon)).toInt();
|
|
|
|
|
|
|
|
|
|
if (val < 0 || val > 2)
|
|
|
|
|
{
|
|
|
|
|
val = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return static_cast<VToolPointerMode>(val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetPointerMode(VToolPointerMode mode)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingConfigurationToolPointerMode, static_cast<int>(mode));
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-04 12:56:08 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
auto VValentinaSettings::IsUseToolGroups() const -> bool
|
|
|
|
|
{
|
|
|
|
|
return value(*settingConfigurationUseToolGroups, true).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VValentinaSettings::SetUseToolGroups(bool value)
|
|
|
|
|
{
|
|
|
|
|
setValue(*settingConfigurationUseToolGroups, value);
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-11 11:42:20 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2023-05-03 13:07:02 +02:00
|
|
|
|
template <typename T>
|
|
|
|
|
auto VValentinaSettings::GetCachedValue(T &cache, const QString &setting, T defValue, T valueMin, T valueMax) const -> T
|
2018-05-11 11:42:20 +02:00
|
|
|
|
{
|
|
|
|
|
if (cache < 0)
|
|
|
|
|
{
|
2019-03-29 18:50:17 +01:00
|
|
|
|
cache = qBound(valueMin, ValueOrDef(setting, defValue), valueMax);
|
2018-05-11 11:42:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return cache;
|
|
|
|
|
}
|