2014-02-19 14:32:02 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file dialogpatternproperties.h
|
2014-04-30 07:38:52 +02:00
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
2014-02-19 14:32:02 +01:00
|
|
|
** @date 18 2, 2014
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2014-02-19 14:32:02 +01:00
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#ifndef DIALOGPATTERNPROPERTIES_H
|
|
|
|
#define DIALOGPATTERNPROPERTIES_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2015-06-19 13:21:46 +02:00
|
|
|
#include "../options.h"
|
2014-10-03 12:32:12 +02:00
|
|
|
#include <QMap>
|
2014-06-08 20:10:57 +02:00
|
|
|
|
|
|
|
class VPattern;
|
2015-12-11 15:19:11 +01:00
|
|
|
class VContainer;
|
2014-08-08 18:07:44 +02:00
|
|
|
class QCheckBox;
|
2014-02-19 14:32:02 +01:00
|
|
|
|
2014-02-26 10:51:37 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class DialogPatternProperties;
|
2014-02-19 14:32:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
class DialogPatternProperties : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2016-06-18 15:57:07 +02:00
|
|
|
explicit DialogPatternProperties(const QString &filePath, VPattern *doc, VContainer *pattern,
|
|
|
|
QWidget *parent = nullptr);
|
2015-07-03 15:36:54 +02:00
|
|
|
virtual ~DialogPatternProperties() Q_DECL_OVERRIDE;
|
2014-02-19 14:32:02 +01:00
|
|
|
signals:
|
2016-07-18 17:09:15 +02:00
|
|
|
void UpdateGradation();
|
2015-12-11 15:19:11 +01:00
|
|
|
private slots:
|
|
|
|
void ToggleComboBox();
|
|
|
|
void DefValueChanged();
|
2016-01-22 11:45:18 +01:00
|
|
|
void SecurityValueChanged();
|
2016-06-26 16:49:51 +02:00
|
|
|
void GeneralInfoChanged();
|
2016-07-18 17:09:15 +02:00
|
|
|
void Apply();
|
|
|
|
void Ok();
|
|
|
|
void SelectAll(int state);
|
|
|
|
void CheckStateHeight(int state);
|
|
|
|
void CheckStateSize(int state);
|
|
|
|
void DescEdited();
|
|
|
|
void ChangeImage();
|
2016-03-18 19:23:19 +01:00
|
|
|
void SaveImage();
|
2014-02-19 14:32:02 +01:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(DialogPatternProperties)
|
|
|
|
Ui::DialogPatternProperties *ui;
|
2014-08-08 18:07:44 +02:00
|
|
|
VPattern *doc;
|
2015-12-11 15:19:11 +01:00
|
|
|
VContainer *pattern;
|
2014-08-08 18:07:44 +02:00
|
|
|
char heightsChecked;
|
|
|
|
char sizesChecked;
|
|
|
|
QMap<GHeights, bool> heights;
|
|
|
|
QMap<GSizes, bool> sizes;
|
|
|
|
QMap<QCheckBox *, int> data;
|
|
|
|
bool descriptionChanged;
|
|
|
|
bool gradationChanged;
|
2015-12-11 15:19:11 +01:00
|
|
|
bool defaultChanged;
|
2016-01-22 11:45:18 +01:00
|
|
|
bool securityChanged;
|
2016-06-26 16:49:51 +02:00
|
|
|
bool generalInfoChanged;
|
2016-03-17 15:34:40 +01:00
|
|
|
QAction *deleteAction;
|
|
|
|
QAction *changeImageAction;
|
|
|
|
QAction *saveImageAction;
|
|
|
|
QAction *showImageAction;
|
2016-06-18 15:57:07 +02:00
|
|
|
const QString &m_filePath;
|
2014-08-08 18:07:44 +02:00
|
|
|
|
|
|
|
void SetHeightsChecked(bool enabled);
|
|
|
|
void SetSizesChecked(bool enabled);
|
|
|
|
void InitHeights();
|
|
|
|
void InitSizes();
|
|
|
|
template<typename Func>
|
|
|
|
void Init(QCheckBox *check, int val, Func slot);
|
|
|
|
template<typename GVal>
|
|
|
|
void SetOptions(const QMap<GVal, bool> &option);
|
2015-12-11 15:19:11 +01:00
|
|
|
template<typename GVal>
|
|
|
|
void InitComboBox(QComboBox *box, const QMap<GVal, bool> &option);
|
2014-08-08 18:07:44 +02:00
|
|
|
void CheckApplyOk();
|
|
|
|
void SaveDescription();
|
|
|
|
void SaveGradation();
|
2015-12-11 15:19:11 +01:00
|
|
|
void SaveDefValues();
|
2016-06-26 16:49:51 +02:00
|
|
|
void SaveGeneralInfo();
|
2015-12-11 15:19:11 +01:00
|
|
|
|
|
|
|
void SetDefaultHeight(const QString &def);
|
|
|
|
void SetDefaultSize(const QString &def);
|
|
|
|
|
|
|
|
void UpdateDefHeight();
|
|
|
|
void UpdateDefSize();
|
2016-03-09 20:01:37 +01:00
|
|
|
void InitImage();
|
2016-03-27 13:22:16 +02:00
|
|
|
QImage GetImage();
|
2014-02-19 14:32:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DIALOGPATTERNPROPERTIES_H
|