2015-07-15 09:16:59 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vcommonsettings.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 15 7, 2015
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2015 Valentina project
|
|
|
|
** <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/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#ifndef VCOMMONSETTINGS_H
|
|
|
|
#define VCOMMONSETTINGS_H
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
2015-07-15 09:16:59 +02:00
|
|
|
#include <QSettings>
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QSize>
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
2015-10-08 20:11:50 +02:00
|
|
|
#include "../vlayout/vbank.h"
|
2015-07-15 09:16:59 +02:00
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
class QDate;
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
class VCommonSettings : public QSettings
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
VCommonSettings(Format format, Scope scope, const QString &organization, const QString &application = QString(),
|
2016-10-30 13:34:55 +01:00
|
|
|
QObject *parent = nullptr);
|
2015-07-15 09:16:59 +02:00
|
|
|
|
2016-10-30 13:34:55 +01:00
|
|
|
static QString SharePath(const QString &shareItem);
|
|
|
|
static QString StandardTablesPath();
|
|
|
|
static QString TemplatesPath();
|
2015-07-18 14:39:33 +02:00
|
|
|
|
|
|
|
QString GetPathIndividualMeasurements() const;
|
|
|
|
void SetPathIndividualMeasurements(const QString &value);
|
|
|
|
|
|
|
|
QString GetPathStandardMeasurements() const;
|
|
|
|
void SetPathStandardMeasurements(const QString &value);
|
|
|
|
|
2015-10-18 12:01:38 +02:00
|
|
|
QString GetPathTemplate() const;
|
|
|
|
void SetPathTemplate(const QString &value);
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
bool GetOsSeparator() const;
|
|
|
|
void SetOsSeparator(const bool &value);
|
|
|
|
|
|
|
|
bool GetAutosaveState() const;
|
|
|
|
void SetAutosaveState(const bool &value);
|
|
|
|
|
|
|
|
int GetAutosaveTime() const;
|
|
|
|
void SetAutosaveTime(const int &value);
|
|
|
|
|
|
|
|
bool GetSendReportState() const;
|
|
|
|
void SetSendReportState(const bool &value);
|
|
|
|
|
|
|
|
QString GetLocale() const;
|
|
|
|
void SetLocale(const QString &value);
|
|
|
|
|
2015-08-02 17:27:18 +02:00
|
|
|
QString GetPMSystemCode() const;
|
|
|
|
void SetPMSystemCode(const QString &value);
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
QString GetUnit() const;
|
|
|
|
void SetUnit(const QString &value);
|
|
|
|
|
|
|
|
bool GetConfirmItemDelete() const;
|
|
|
|
void SetConfirmItemDelete(const bool &value);
|
|
|
|
|
|
|
|
bool GetToolBarStyle() const;
|
|
|
|
void SetToolBarStyle(const bool &value);
|
|
|
|
|
|
|
|
QString GetUser() const;
|
|
|
|
void SetUser(const QString &value);
|
|
|
|
|
|
|
|
int GetUndoCount() const;
|
|
|
|
void SetUndoCount(const int &value);
|
|
|
|
|
|
|
|
QStringList GetRecentFileList() const;
|
|
|
|
void SetRecentFileList(const QStringList &value);
|
|
|
|
|
|
|
|
QStringList GetRestoreFileList() const;
|
|
|
|
void SetRestoreFileList(const QStringList &value);
|
|
|
|
|
|
|
|
QByteArray GetGeometry() const;
|
|
|
|
void SetGeometry(const QByteArray &value);
|
|
|
|
|
|
|
|
QByteArray GetWindowState() const;
|
|
|
|
void SetWindowState(const QByteArray &value);
|
|
|
|
|
|
|
|
QByteArray GetToolbarsState() const;
|
|
|
|
void SetToolbarsState(const QByteArray &value);
|
|
|
|
|
2016-07-15 11:00:00 +02:00
|
|
|
QSize GetPreferenceDialogSize() const;
|
|
|
|
void SetPreferenceDialogSize(const QSize& sz);
|
|
|
|
|
|
|
|
int GetLatestSkippedVersion() const;
|
|
|
|
void SetLatestSkippedVersion(int value);
|
2016-06-10 21:34:21 +02:00
|
|
|
|
2016-07-15 11:30:55 +02:00
|
|
|
QDate GetDateOfLastRemind() const;
|
|
|
|
void SetDateOfLastRemind(const QDate &date);
|
|
|
|
|
2016-08-12 01:22:23 +02:00
|
|
|
QStringList GetUserDefinedMaterials() const;
|
|
|
|
void AddUserDefinedMaterial(QString qsMaterial);
|
|
|
|
void ClearUserDefinedMaterial();
|
|
|
|
|
2016-09-06 16:05:54 +02:00
|
|
|
bool GetForbidWorkpieceFlipping() const;
|
|
|
|
void SetForbidWorkpieceFlipping(bool value);
|
|
|
|
|
2016-10-30 13:34:55 +01:00
|
|
|
#if !defined(Q_OS_WIN)
|
|
|
|
static const QString unixStandardSharePath;
|
|
|
|
#endif
|
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(VCommonSettings)
|
2015-10-18 11:56:47 +02:00
|
|
|
|
2015-07-18 14:39:33 +02:00
|
|
|
static const QString SettingPathsIndividualMeasurements;
|
|
|
|
static const QString SettingPathsStandardMeasurements;
|
2015-10-18 12:01:38 +02:00
|
|
|
static const QString SettingPathsTemplates;
|
2015-07-18 14:39:33 +02:00
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
static const QString SettingConfigurationOsSeparator;
|
|
|
|
static const QString SettingConfigurationAutosaveState;
|
|
|
|
static const QString SettingConfigurationAutosaveTime;
|
|
|
|
static const QString SettingConfigurationSendReportState;
|
|
|
|
static const QString SettingConfigurationLocale;
|
2015-08-02 17:27:18 +02:00
|
|
|
static const QString SettingPMSystemCode;
|
2015-07-15 09:16:59 +02:00
|
|
|
static const QString SettingConfigurationUnit;
|
|
|
|
static const QString SettingConfigurationConfirmItemDeletion;
|
|
|
|
static const QString SettingConfigurationToolBarStyle;
|
|
|
|
|
|
|
|
static const QString SettingPatternUser;
|
|
|
|
static const QString SettingPatternUndo;
|
2016-09-06 16:05:54 +02:00
|
|
|
static const QString SettingPatternForbidFlipping;
|
2015-07-15 09:16:59 +02:00
|
|
|
|
|
|
|
static const QString SettingGeneralRecentFileList;
|
|
|
|
static const QString SettingGeneralRestoreFileList;
|
|
|
|
static const QString SettingGeneralGeometry;
|
|
|
|
static const QString SettingGeneralWindowState;
|
|
|
|
static const QString SettingGeneralToolbarsState;
|
2016-06-10 21:34:21 +02:00
|
|
|
static const QString SettingPreferenceDialogSize;
|
2016-07-15 11:00:00 +02:00
|
|
|
static const QString SettingLatestSkippedVersion;
|
2016-07-15 11:30:55 +02:00
|
|
|
static const QString SettingDateOfLastRemind;
|
2016-08-12 01:22:23 +02:00
|
|
|
static const QString SettingUserDefinedMaterials;
|
2015-07-15 09:16:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VCOMMONSETTINGS_H
|