mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
123 lines
2.6 KiB
C++
123 lines
2.6 KiB
C++
#ifndef COMMONVIEW_H
|
|
#define COMMONVIEW_H
|
|
|
|
#include <QTreeWidget>
|
|
#include <QTranslator>
|
|
#include <QMutex>
|
|
#include <QMap>
|
|
#include "instructorsAndTrainees_global.h"
|
|
#include "connectortoserver.h"
|
|
#include "waitanimationwidget.h"
|
|
|
|
//Родительский класс представления БД Инструкторов/Обучаемых (самого верхнего уровня)
|
|
|
|
class CommonView : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum TypeView
|
|
{
|
|
onlyView,
|
|
control
|
|
};
|
|
|
|
enum TypeObject
|
|
{
|
|
objInstructor,
|
|
objTrainee,
|
|
objGroup
|
|
};
|
|
|
|
protected:
|
|
enum ColumnsTreeUsers{
|
|
clmn_Name = 0,
|
|
clmn_Password,
|
|
clmn_Class,
|
|
clmn_Computer,
|
|
clmn_IP_address,
|
|
clmn_Administrator,
|
|
clmn_Archived,
|
|
clmn_AMMtasks,
|
|
clmn_FIMtasks,
|
|
clmn_Login,
|
|
clmn_Messages,
|
|
clmn_Logged,
|
|
clmn_ID,
|
|
clmn_count
|
|
};
|
|
|
|
public:
|
|
CommonView(ConnectorToServer* connectorToServer, TypeView type, QWidget *parent = nullptr);
|
|
~CommonView();
|
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
|
|
public:
|
|
void setAdminMode(bool adminMode)
|
|
{
|
|
this->adminMode = adminMode;
|
|
}
|
|
void activate()
|
|
{
|
|
treeWidget->setEnabled(true);
|
|
}
|
|
void deactivate()
|
|
{
|
|
treeWidget->clear();
|
|
treeWidget->setEnabled(false);
|
|
lastCurrentID = 0;
|
|
mapNewMsg.clear();
|
|
}
|
|
void clearSelection()
|
|
{
|
|
treeWidget->clearSelection();
|
|
lastCurrentID = 0;
|
|
}
|
|
|
|
protected:
|
|
void setArchiveVisible(bool archiveVisible)
|
|
{
|
|
this->archiveVisible = archiveVisible;
|
|
}
|
|
void setNotLoggedInVisible(bool notLoggedInVisible)
|
|
{
|
|
this->notLoggedInVisible = notLoggedInVisible;
|
|
}
|
|
|
|
void setItemColorArchive(QTreeWidgetItem* item);
|
|
void setItemColorNoArchive(QTreeWidgetItem* item);
|
|
|
|
void setItemColor(QTreeWidgetItem* item, QColor color);
|
|
|
|
void preparationTreeWidget();
|
|
|
|
protected:
|
|
int calculateWidth_0Column();
|
|
void setWidthColumnsTree();
|
|
|
|
protected:
|
|
void reSetHeadTreeWidget();
|
|
|
|
protected:
|
|
ConnectorToServer* connectorToServer;
|
|
QTreeWidget* treeWidget;
|
|
QList<int> listWidthColumn;
|
|
QString TypeUserDB;
|
|
QMutex mtxTreeWidget;
|
|
TypeView typeView;
|
|
bool archiveVisible;
|
|
bool notLoggedInVisible;
|
|
bool adminMode;
|
|
bool authComplited;
|
|
int lastCurrentID;
|
|
TypeObject typeObject;
|
|
|
|
QMutex mtxmapNewMsg;
|
|
QMap<int, int> mapNewMsg;
|
|
|
|
WaitAnimationWidget *waitAnimationWidget;
|
|
};
|
|
|
|
#endif // COMMONVIEW_H
|