2015-08-01 11:39:32 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file dialogmdatabase.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 26 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 DIALOGMDATABASE_H
|
|
|
|
#define DIALOGMDATABASE_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class DialogMDataBase;
|
|
|
|
}
|
|
|
|
|
|
|
|
class QTreeWidgetItem;
|
|
|
|
|
|
|
|
class DialogMDataBase : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-10-20 16:32:01 +02:00
|
|
|
explicit DialogMDataBase(const QStringList &list, QWidget *parent = 0);
|
2015-08-01 11:39:32 +02:00
|
|
|
explicit DialogMDataBase(QWidget *parent = 0);
|
2015-08-01 19:09:10 +02:00
|
|
|
virtual ~DialogMDataBase() Q_DECL_OVERRIDE;
|
2015-08-01 11:39:32 +02:00
|
|
|
|
2015-08-01 13:25:05 +02:00
|
|
|
QStringList GetNewNames() const;
|
|
|
|
|
2015-08-08 16:33:37 +02:00
|
|
|
void RetranslateGroups();
|
|
|
|
|
2015-11-15 16:48:48 +01:00
|
|
|
static QString ImgTag(const QString &number);
|
|
|
|
|
2015-08-08 16:33:37 +02:00
|
|
|
protected:
|
|
|
|
virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE;
|
2015-10-08 12:59:24 +02:00
|
|
|
virtual bool eventFilter(QObject *target, QEvent *event) Q_DECL_OVERRIDE;
|
2015-08-08 16:33:37 +02:00
|
|
|
|
2015-08-01 11:39:32 +02:00
|
|
|
private slots:
|
|
|
|
void UpdateChecks(QTreeWidgetItem *item, int column);
|
|
|
|
void ShowDescription(QTreeWidgetItem *item, int column);
|
2015-10-08 15:20:07 +02:00
|
|
|
void TreeMenu(const QPoint &pos);
|
2015-11-12 11:47:00 +01:00
|
|
|
void Recheck();
|
2015-08-01 11:39:32 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(DialogMDataBase)
|
|
|
|
Ui::DialogMDataBase *ui;
|
|
|
|
bool selectMode;
|
|
|
|
QStringList list;
|
|
|
|
|
2015-08-08 16:33:37 +02:00
|
|
|
QTreeWidgetItem *groupA;
|
|
|
|
QTreeWidgetItem *groupB;
|
|
|
|
QTreeWidgetItem *groupC;
|
|
|
|
QTreeWidgetItem *groupD;
|
|
|
|
QTreeWidgetItem *groupE;
|
|
|
|
QTreeWidgetItem *groupF;
|
|
|
|
QTreeWidgetItem *groupG;
|
|
|
|
QTreeWidgetItem *groupH;
|
|
|
|
QTreeWidgetItem *groupI;
|
|
|
|
QTreeWidgetItem *groupJ;
|
|
|
|
QTreeWidgetItem *groupK;
|
|
|
|
QTreeWidgetItem *groupL;
|
|
|
|
QTreeWidgetItem *groupM;
|
|
|
|
QTreeWidgetItem *groupN;
|
|
|
|
QTreeWidgetItem *groupO;
|
|
|
|
QTreeWidgetItem *groupP;
|
|
|
|
QTreeWidgetItem *groupQ;
|
|
|
|
|
2015-09-29 20:56:46 +02:00
|
|
|
void InitDataBase(const QStringList &list = QStringList());
|
2015-11-12 11:47:00 +01:00
|
|
|
void InitGroup(QTreeWidgetItem **group, const QString &groupName, const QStringList &mList,
|
2015-08-08 16:33:37 +02:00
|
|
|
const QStringList &list = QStringList());
|
2015-08-01 11:39:32 +02:00
|
|
|
|
2015-08-01 13:44:41 +02:00
|
|
|
QTreeWidgetItem *AddGroup(const QString &text);
|
2015-08-01 11:39:32 +02:00
|
|
|
void AddMeasurement(QTreeWidgetItem *group, const QString &name, const QStringList &list);
|
|
|
|
|
2015-08-01 19:09:10 +02:00
|
|
|
void ReadSettings();
|
|
|
|
void WriteSettings();
|
2015-08-08 16:33:37 +02:00
|
|
|
|
|
|
|
void RetranslateGroup(QTreeWidgetItem *group, const QString &groupText, const QStringList &list);
|
|
|
|
void RetranslateMeasurement(QTreeWidgetItem *group, int index, const QString &name);
|
2015-11-12 11:47:00 +01:00
|
|
|
|
|
|
|
void ChangeCheckState(QTreeWidgetItem *group, Qt::CheckState check);
|
|
|
|
Qt::CheckState GlobalCheckState() const;
|
2015-08-01 11:39:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DIALOGMDATABASE_H
|