2014-11-22 17:15:47 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
2021-02-24 15:26:11 +01:00
|
|
|
** @file vvalentinasettings.h
|
2014-11-22 17:15:47 +01:00
|
|
|
** @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
|
|
|
#ifndef VVALENTINASETTINGS_H
|
|
|
|
#define VVALENTINASETTINGS_H
|
2014-11-22 17:15:47 +01:00
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSettings>
|
|
|
|
#include <QString>
|
|
|
|
#include <QtGlobal>
|
2019-04-05 14:42:22 +02:00
|
|
|
#include <QMargins>
|
2016-08-08 13:44:49 +02:00
|
|
|
|
|
|
|
#include "vcommonsettings.h"
|
2019-09-10 15:57:31 +02:00
|
|
|
#include "../vlayout/vbank.h"
|
2014-11-22 17:15:47 +01:00
|
|
|
|
2020-05-10 17:32:14 +02:00
|
|
|
class VValentinaSettings : public VCommonSettings
|
2014-11-22 17:15:47 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-05-10 17:32:14 +02:00
|
|
|
VValentinaSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(),
|
2017-07-05 18:35:34 +02:00
|
|
|
QObject *parent = nullptr);
|
2020-05-10 17:32:14 +02:00
|
|
|
VValentinaSettings(const QString &fileName, Format format, QObject *parent = nullptr);
|
2014-11-22 17:15:47 +01:00
|
|
|
|
2014-11-28 19:41:46 +01:00
|
|
|
QString GetLabelLanguage() const;
|
2014-11-22 17:15:47 +01:00
|
|
|
void SetLabelLanguage(const QString &value);
|
|
|
|
|
2017-02-17 19:37:49 +01:00
|
|
|
static QString GetDefPathLayout();
|
2015-01-26 15:08:09 +01:00
|
|
|
QString GetPathLayout() const;
|
|
|
|
void SetPathLayout(const QString &value);
|
|
|
|
|
2015-11-09 12:33:36 +01:00
|
|
|
// Layout settings
|
2015-11-05 12:07:51 +01:00
|
|
|
qreal GetLayoutPaperHeight() const;
|
|
|
|
void SetLayoutPaperHeight(qreal value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
2015-11-05 12:07:51 +01:00
|
|
|
qreal GetLayoutPaperWidth() const;
|
|
|
|
void SetLayoutPaperWidth(qreal value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
2015-11-05 13:32:47 +01:00
|
|
|
qreal GetLayoutWidth() const;
|
2015-11-05 12:07:51 +01:00
|
|
|
static qreal GetDefLayoutWidth();
|
2015-11-05 13:32:47 +01:00
|
|
|
void SetLayoutWidth(qreal value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
2019-03-29 10:31:17 +01:00
|
|
|
int GetNestingTime() const;
|
|
|
|
static int GetDefNestingTime(){return 1;}
|
|
|
|
void SetNestingTime(int value);
|
|
|
|
|
|
|
|
qreal GetEfficiencyCoefficient() const;
|
|
|
|
static qreal GetDefEfficiencyCoefficient(){return 0.0;}
|
|
|
|
void SetEfficiencyCoefficient(qreal value);
|
|
|
|
|
2016-09-30 18:33:10 +02:00
|
|
|
QMarginsF GetFields(const QMarginsF &def = QMarginsF()) const;
|
2015-11-09 12:33:36 +01:00
|
|
|
void SetFields(const QMarginsF &value);
|
|
|
|
|
2015-05-08 16:24:20 +02:00
|
|
|
Cases GetLayoutGroup() const;
|
|
|
|
static Cases GetDefLayoutGroup();
|
|
|
|
void SetLayoutGroup(const Cases &value);
|
|
|
|
|
2018-12-27 14:54:29 +01:00
|
|
|
bool GetLayoutFollowGrainline() const;
|
|
|
|
static bool GetDefLayoutFollowGrainline();
|
|
|
|
void SetLayoutFollowGrainline(bool value);
|
2019-07-21 15:26:21 +02:00
|
|
|
|
|
|
|
bool GetLayoutManualPriority() const;
|
|
|
|
static bool GetDefLayoutManualPriority();
|
|
|
|
void SetLayoutManualPriority(bool value);
|
2018-12-27 14:54:29 +01:00
|
|
|
|
2019-07-04 13:33:45 +02:00
|
|
|
bool GetLayoutNestQuantity() const;
|
|
|
|
static bool GetDefLayoutNestQuantity();
|
|
|
|
void SetLayoutNestQuantity(bool value);
|
|
|
|
|
2019-10-16 10:16:16 +02:00
|
|
|
bool GetLayoutAutoCropLength() const;
|
|
|
|
static bool GetDefLayoutAutoCropLength();
|
|
|
|
void SetLayoutAutoCropLength(bool value);
|
|
|
|
|
|
|
|
bool GetLayoutAutoCropWidth() const;
|
|
|
|
static bool GetDefLayoutAutoCropWidth();
|
|
|
|
void SetLayoutAutoCropWidth(bool value);
|
2015-05-08 16:24:20 +02:00
|
|
|
|
|
|
|
bool GetLayoutSaveLength() const;
|
2015-11-09 12:33:36 +01:00
|
|
|
static bool GetDefLayoutSaveLength();
|
2015-05-08 16:24:20 +02:00
|
|
|
void SetLayoutSaveLength(bool value);
|
|
|
|
|
2020-03-25 14:28:23 +01:00
|
|
|
bool GetLayoutPreferOneSheetSolution() const;
|
|
|
|
static bool GetDefLayoutPreferOneSheetSolution();
|
|
|
|
void SetLayoutPreferOneSheetSolution(bool value);
|
|
|
|
|
2015-05-18 13:26:37 +02:00
|
|
|
bool GetLayoutUnitePages() const;
|
2015-11-09 12:33:36 +01:00
|
|
|
static bool GetDefLayoutUnitePages();
|
2015-05-18 13:26:37 +02:00
|
|
|
void SetLayoutUnitePages(bool value);
|
|
|
|
|
2015-11-09 12:33:36 +01:00
|
|
|
bool GetIgnoreAllFields() const;
|
|
|
|
static bool GetDefIgnoreAllFields();
|
|
|
|
void SetIgnoreAllFields(bool value);
|
|
|
|
|
2016-02-23 13:13:10 +01:00
|
|
|
bool GetStripOptimization() const;
|
|
|
|
static bool GetDefStripOptimization();
|
|
|
|
void SetStripOptimization(bool value);
|
|
|
|
|
|
|
|
quint8 GetMultiplier() const;
|
|
|
|
static quint8 GetDefMultiplier();
|
|
|
|
void SetMultiplier(quint8 value);
|
|
|
|
|
2017-07-01 19:32:54 +02:00
|
|
|
bool GetTextAsPaths() const;
|
|
|
|
static bool GetDefTextAsPaths();
|
|
|
|
void SetTextAsPaths(bool value);
|
|
|
|
|
2017-08-28 15:03:19 +02:00
|
|
|
QStringList GetKnownMaterials() const;
|
|
|
|
void SetKnownMaterials(const QStringList &list);
|
|
|
|
|
2017-08-30 06:26:18 +02:00
|
|
|
bool IsRememberPatternMaterials() const;
|
|
|
|
void SetRememberPatternMaterials(bool value);
|
|
|
|
|
2017-10-10 11:22:59 +02:00
|
|
|
// settings for the tiled PDFs
|
|
|
|
qreal GetTiledPDFPaperHeight(const Unit &unit) const;
|
|
|
|
void SetTiledPDFPaperHeight(qreal value, const Unit &unit);
|
|
|
|
|
|
|
|
qreal GetTiledPDFPaperWidth(const Unit &unit) const;
|
|
|
|
void SetTiledPDFPaperWidth(qreal value, const Unit &unit);
|
|
|
|
|
2019-10-28 16:44:31 +01:00
|
|
|
bool IsDockWidgetGroupsActive() const;
|
|
|
|
static bool GetDefDockWidgetGroupsActive();
|
|
|
|
void SetDockWidgetGroupsActive(bool value);
|
|
|
|
|
|
|
|
bool IsDockWidgetToolOptionsActive() const;
|
|
|
|
static bool GetDefDockWidgetToolOptionsActive();
|
|
|
|
void SetDockWidgetToolOptionsActive(bool value);
|
|
|
|
|
|
|
|
bool IsDockWidgetPatternMessagesActive() const;
|
|
|
|
static bool GetDefDockWidgetPatternMessagesActive();
|
|
|
|
void SetDockWidgetPatternMessagesActive(bool value);
|
|
|
|
|
|
|
|
int GetPatternMessageFontSize(int fontSizeDef) const;
|
|
|
|
static int GetDefMinPatternMessageFontSize();
|
|
|
|
static int GetDefMaxPatternMessageFontSize();
|
|
|
|
void SetPatternMessageFontSize(int size);
|
|
|
|
|
2019-11-28 14:17:27 +01:00
|
|
|
bool GetAutoRefreshPatternMessage() const;
|
|
|
|
void SetAutoRefreshPatternMessage(bool value);
|
|
|
|
|
2020-06-04 12:45:32 +02:00
|
|
|
bool GetToolPanelScaling() const;
|
|
|
|
void SetToolPanelScaling(const bool &value);
|
|
|
|
|
2021-04-23 17:03:16 +02:00
|
|
|
auto GetLayoutExportFormat() const -> qint8;
|
|
|
|
void SetLayoutExportFormat(qint8 format);
|
|
|
|
|
2021-06-28 09:25:52 +02:00
|
|
|
auto GetDetailExportFormat() const -> qint8;
|
|
|
|
void SetDetailExportFormat(qint8 format);
|
|
|
|
|
2021-11-22 14:24:48 +01:00
|
|
|
auto GetHistorySearchHistory() const -> QStringList;
|
|
|
|
void SetHistorySearchHistory(const QStringList &history);
|
|
|
|
|
|
|
|
auto GetIncrementsSearchHistory() const -> QStringList;
|
|
|
|
void SetIncrementsSearchHistory(const QStringList &history);
|
|
|
|
|
|
|
|
auto GetPreviewCalculationsSearchHistory() const -> QStringList;
|
|
|
|
void SetPreviewCalculationsSearchHistory(const QStringList &history);
|
|
|
|
|
|
|
|
auto GetFinalMeasurementsSearchHistory() const -> QStringList;
|
|
|
|
void SetFinalMeasurementsSearchHistory(const QStringList &history);
|
|
|
|
|
|
|
|
auto GetHistorySearchOptionUseUnicodeProperties() const -> bool;
|
|
|
|
void SetHistorySearchOptionUseUnicodeProperties(bool value);
|
|
|
|
|
|
|
|
auto GetHistorySearchOptionWholeWord() const -> bool;
|
|
|
|
void SetHistorySearchOptionWholeWord(bool value);
|
|
|
|
|
|
|
|
auto GetHistorySearchOptionRegexp() const -> bool;
|
|
|
|
void SetHistorySearchOptionRegexp(bool value);
|
|
|
|
|
|
|
|
auto GetHistorySearchOptionMatchCase() const ->bool;
|
|
|
|
void SetHistorySearchOptionMatchCase(bool value);
|
|
|
|
|
|
|
|
auto GetIncrementsSearchOptionUseUnicodeProperties() const -> bool;
|
|
|
|
void SetIncrementsSearchOptionUseUnicodeProperties(bool value);
|
|
|
|
|
|
|
|
auto GetIncrementsSearchOptionWholeWord() const -> bool;
|
|
|
|
void SetIncrementsSearchOptionWholeWord(bool value);
|
|
|
|
|
|
|
|
auto GetIncrementsSearchOptionRegexp() const -> bool;
|
|
|
|
void SetIncrementsSearchOptionRegexp(bool value);
|
|
|
|
|
|
|
|
auto GetIncrementsSearchOptionMatchCase() const ->bool;
|
|
|
|
void SetIncrementsSearchOptionMatchCase(bool value);
|
|
|
|
|
|
|
|
auto GetPreviewCalculationsSearchOptionUseUnicodeProperties() const -> bool;
|
|
|
|
void SetPreviewCalculationsSearchOptionUseUnicodeProperties(bool value);
|
|
|
|
|
|
|
|
auto GetPreviewCalculationsSearchOptionWholeWord() const -> bool;
|
|
|
|
void SetPreviewCalculationsSearchOptionWholeWord(bool value);
|
|
|
|
|
|
|
|
auto GetPreviewCalculationsSearchOptionRegexp() const -> bool;
|
|
|
|
void SetPreviewCalculationsSearchOptionRegexp(bool value);
|
|
|
|
|
|
|
|
auto GetPreviewCalculationsSearchOptionMatchCase() const ->bool;
|
|
|
|
void SetPreviewCalculationsSearchOptionMatchCase(bool value);
|
|
|
|
|
|
|
|
auto GetFinalMeasurementsSearchOptionUseUnicodeProperties() const -> bool;
|
|
|
|
void SetFinalMeasurementsSearchOptionUseUnicodeProperties(bool value);
|
|
|
|
|
|
|
|
auto GetFinalMeasurementsSearchOptionWholeWord() const -> bool;
|
|
|
|
void SetFinalMeasurementsSearchOptionWholeWord(bool value);
|
|
|
|
|
|
|
|
auto GetFinalMeasurementsSearchOptionRegexp() const -> bool;
|
|
|
|
void SetFinalMeasurementsSearchOptionRegexp(bool value);
|
|
|
|
|
|
|
|
auto GetFinalMeasurementsSearchOptionMatchCase() const ->bool;
|
|
|
|
void SetFinalMeasurementsSearchOptionMatchCase(bool value);
|
|
|
|
|
2014-11-22 17:15:47 +01:00
|
|
|
private:
|
2020-05-10 17:32:14 +02:00
|
|
|
Q_DISABLE_COPY(VValentinaSettings)
|
2018-05-11 11:42:20 +02:00
|
|
|
|
|
|
|
template <typename T>
|
2020-12-23 14:29:55 +01:00
|
|
|
T GetCachedValue(T &cache, const QString &setting, T defValue, T valueMin, T valueMax) const;
|
2014-11-22 17:15:47 +01:00
|
|
|
};
|
|
|
|
|
2020-05-10 17:32:14 +02:00
|
|
|
#endif // VVALENTINASETTINGS_H
|