2017-07-19 23:20:32 +02:00
|
|
|
#pragma once
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class lcQEditGroupsDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class lcQEditGroupsDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-08-01 05:44:15 +02:00
|
|
|
lcQEditGroupsDialog(QWidget* Parent, const QMap<lcPiece*, lcGroup*>& PieceParents, const QMap<lcGroup*, lcGroup*>& GroupParents);
|
2013-08-09 06:57:18 +02:00
|
|
|
~lcQEditGroupsDialog();
|
|
|
|
|
2016-08-01 05:44:15 +02:00
|
|
|
QMap<lcPiece*, lcGroup*> mPieceParents;
|
|
|
|
QMap<lcGroup*, lcGroup*> mGroupParents;
|
|
|
|
QList<lcGroup*> mNewGroups;
|
|
|
|
//QList<lcGroup*> mDeletedGroups; // todo: support deleting groups in the edit groups dialog
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PieceRole = Qt::UserRole,
|
2013-12-13 23:27:57 +01:00
|
|
|
GroupRole
|
2013-08-09 06:57:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void accept();
|
2014-11-10 01:06:11 +01:00
|
|
|
void reject();
|
2013-08-09 06:57:18 +02:00
|
|
|
void on_newGroup_clicked();
|
2014-11-10 01:06:11 +01:00
|
|
|
void onItemClicked(QTreeWidgetItem* Item, int Column);
|
|
|
|
void onItemDoubleClicked(QTreeWidgetItem* Item, int Column);
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::lcQEditGroupsDialog *ui;
|
|
|
|
|
2014-11-10 01:06:11 +01:00
|
|
|
void UpdateParents(QTreeWidgetItem* ParentItem, lcGroup* ParentGroup);
|
|
|
|
void AddChildren(QTreeWidgetItem* ParentItem, lcGroup* ParentGroup);
|
2013-12-13 23:27:57 +01:00
|
|
|
|
2014-11-10 01:06:11 +01:00
|
|
|
void timerEvent(QTimerEvent* Event);
|
2013-12-13 23:27:57 +01:00
|
|
|
|
2014-11-10 01:06:11 +01:00
|
|
|
QTreeWidgetItem* mLastItemClicked;
|
|
|
|
bool mEditableDoubleClicked;
|
|
|
|
QBasicTimer mClickTimer;
|
2013-08-09 06:57:18 +02:00
|
|
|
};
|
|
|
|
|