mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
feat: add versionChanger for GUI
This commit is contained in:
@@ -13,6 +13,7 @@ kanban-plugin: board
|
||||
## bugs
|
||||
|
||||
- [ ] При старт стопе не сканится шэред дата
|
||||
- [ ] GUI server: при неподключенном сервере, отключать попытку изменить версию
|
||||
|
||||
|
||||
## feature client Unity
|
||||
|
||||
@@ -60,7 +60,12 @@ add_library(InstructorsAndTrainees SHARED
|
||||
connectorToServer/Core/tools.cpp
|
||||
connectorToServer/Core/tools.h
|
||||
connectorToServer/Core/FileData.h
|
||||
connectorToServer/Core/notifycontroller.cpp
|
||||
connectorToServer/Core/notifycontroller.h
|
||||
connectorToServer/Core/versioncontainer.cpp
|
||||
connectorToServer/Core/versioncontainer.h
|
||||
connectorToServer/Datas.h
|
||||
connectorToServer/streamingversiondata.h
|
||||
messanger/messangerwidget.cpp
|
||||
messanger/messangerwidget.h
|
||||
messanger/messangerwidget.ui
|
||||
@@ -74,6 +79,16 @@ add_library(InstructorsAndTrainees SHARED
|
||||
docTasks/fimtaskswidget.ui
|
||||
docTasks/tasksAmmFim.cpp
|
||||
docTasks/tasksAmmFim.h
|
||||
widgets/newversionwidget.cpp
|
||||
widgets/newversionwidget.h
|
||||
widgets/newversionwidget.ui
|
||||
widgets/versionselectwidget.cpp
|
||||
widgets/versionselectwidget.h
|
||||
widgets/versionselectwidget.ui
|
||||
widgets/waitanimationwidget.cpp
|
||||
widgets/waitanimationwidget.h
|
||||
widgets/waitanimationwidget.ui
|
||||
|
||||
resources.qrc
|
||||
)
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "instructor.h"
|
||||
#include "trainee.h"
|
||||
#include "group.h"
|
||||
#include "streamingversiondata.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
@@ -327,7 +328,8 @@ ServerSettings *DataParser::getServerSettings()
|
||||
|
||||
if(xmlReader.isStartElement()){
|
||||
|
||||
if(xmlReader.name() == "ServerSettings"){
|
||||
if(xmlReader.name() == "ServerSettings")
|
||||
{
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes()){
|
||||
QString name = attr.name().toString();
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "notifycontroller.h"
|
||||
|
||||
NotifyController::NotifyController(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void NotifyController::showWarning(QString text)
|
||||
{
|
||||
QMessageBox warning;
|
||||
warning.setText(text);
|
||||
|
||||
warning.setIcon(QMessageBox::Warning);
|
||||
warning.setWindowTitle(tr("Ошибка"));
|
||||
warning.exec();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef NOTIFYCONTROLLER_H
|
||||
#define NOTIFYCONTROLLER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QMessageBox>
|
||||
|
||||
class NotifyController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NotifyController(QObject *parent = nullptr);
|
||||
|
||||
void showWarning(QString text);
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
#endif // NOTIFYCONTROLLER_H
|
||||
@@ -254,6 +254,17 @@ void RecognizeSystem::recognize(QTcpSocket *socket)
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
|
||||
|
||||
if(packetType == PacketType::BUSY)
|
||||
{
|
||||
emit sigAnimationActivated(true);
|
||||
}
|
||||
|
||||
if(packetType == PacketType::FREE)
|
||||
{
|
||||
emit sigAnimationActivated(false);
|
||||
}
|
||||
|
||||
//xml-ответы на запросы к БД
|
||||
switch(packetType)
|
||||
{
|
||||
@@ -337,6 +348,21 @@ void RecognizeSystem::xmlParser(QByteArray array)
|
||||
{
|
||||
emit sigStartCompare();
|
||||
}
|
||||
|
||||
if (value == "BASEDELETETRY")
|
||||
{
|
||||
emit sigNotify(tr("Нельзя удалять базовую версию"));
|
||||
}
|
||||
|
||||
if (value == "TRYACTIVEDELETE")
|
||||
{
|
||||
emit sigNotify(tr("Нельзя удалять активную версию"));
|
||||
}
|
||||
|
||||
if (value == "DUPLICATEVERNAME")
|
||||
{
|
||||
emit sigNotify(tr("Такое имя уже существет"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -414,6 +440,74 @@ void RecognizeSystem::xmlParser(QByteArray array)
|
||||
}
|
||||
|
||||
emit sigDeAuth(serverDeAuth);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(xmlReader.name() == "VersionList")
|
||||
{
|
||||
QList<StreamingVersionData*> *serverStreamingVersionDataList = new QList<StreamingVersionData*>;
|
||||
xmlReader.readNext();
|
||||
|
||||
while (!xmlReader.atEnd())
|
||||
{
|
||||
if(xmlReader.isStartElement())
|
||||
{
|
||||
if(xmlReader.name() == "VersionData")
|
||||
{
|
||||
StreamingVersionData *data = new StreamingVersionData;
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr,xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if(name == "Version")
|
||||
data->setName(value);
|
||||
else if(name == "Created")
|
||||
data->setCreateData(QDateTime::fromString(value));
|
||||
else if(name == "isChangeable")
|
||||
{
|
||||
data->setIsChangeable(value.toInt());
|
||||
}
|
||||
}
|
||||
|
||||
serverStreamingVersionDataList->append(data);
|
||||
}
|
||||
}
|
||||
|
||||
xmlReader.readNext();
|
||||
}
|
||||
|
||||
emit sigShowServerDataList(serverStreamingVersionDataList);
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "VersionData")
|
||||
{
|
||||
StreamingVersionData *serverVersion = new StreamingVersionData;
|
||||
foreach(const QXmlStreamAttribute &attr,xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if (name == "Version")
|
||||
{
|
||||
serverVersion->setName(value);
|
||||
}
|
||||
|
||||
if (name == "Created")
|
||||
{
|
||||
serverVersion->setCreateData(QDateTime::fromString(value));
|
||||
}
|
||||
|
||||
if (name == "isChangeable")
|
||||
{
|
||||
serverVersion->setIsChangeable(value.toInt());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
emit sigSetVersion(serverVersion);
|
||||
}
|
||||
|
||||
xmlReader.readNext();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <QObject>
|
||||
#include <QDataStream>
|
||||
#include <QTcpSocket>
|
||||
#include <streamingVersionData.h>
|
||||
//#include <mainwindow.h>
|
||||
#include <Core\tools.h>
|
||||
#include "dataparser.h"
|
||||
@@ -48,9 +49,12 @@ signals:
|
||||
void sigAnswerQueryToDB_ListComputers(QList<Computer> listComputers);
|
||||
void sigAnswerQueryToDB_ListClassrooms(QList<Classroom> listClassrooms);
|
||||
void sigAnswerQueryToDB_ListTasks(QList<Task> listTasks);
|
||||
|
||||
void sigAnswerQueryTasksXML_FIM(QList<TaskAmmFim> listTaskFim);
|
||||
void sigAnswerQueryTasksXML_AMM(QList<TaskAmmFim> listTaskAmm);
|
||||
void sigShowServerDataList(QList<StreamingVersionData*> *versions);
|
||||
void sigSetVersion(StreamingVersionData* serverVersion);
|
||||
void sigNotify(QString text);
|
||||
void sigAnimationActivated(bool flag);
|
||||
|
||||
private:
|
||||
QList<QString> *folderList;
|
||||
|
||||
@@ -129,6 +129,43 @@ void SendSystem::sendFinish()
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendChangeVersion(StreamingVersionData *streamingVersion)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::CHANGE_DATA_VERSION;
|
||||
stream << streamingVersion->getViewName();
|
||||
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendDeleteVersion(StreamingVersionData *streamingVersion)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::DELETE_DATA_VERSION;
|
||||
stream << streamingVersion->getViewName();
|
||||
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
void SendSystem::sendCopyVersion(QString versionName)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::COPY_VERSION;
|
||||
|
||||
stream << versionName;
|
||||
}
|
||||
|
||||
void SendSystem::sendPacketType(PacketType packetType)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
QByteArray data;
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
stream << packetType;
|
||||
}
|
||||
SendSystem::~SendSystem()
|
||||
{
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
#include <QTcpSocket>
|
||||
#include <QDataStream>
|
||||
|
||||
#include <streamingVersionData.h>
|
||||
#include "Core/tools.h"
|
||||
|
||||
class SendSystem :public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -19,6 +22,10 @@ public:
|
||||
void sendXMLAnswer(QByteArray array);
|
||||
~SendSystem();
|
||||
void sendFinish();
|
||||
void sendChangeVersion(StreamingVersionData *streamingVersion);
|
||||
void sendDeleteVersion(StreamingVersionData *streamingVersion);
|
||||
void sendCopyVersion(QString versionName);
|
||||
void sendPacketType(PacketType packetType);
|
||||
|
||||
signals:
|
||||
void sigSend();
|
||||
|
||||
@@ -19,6 +19,8 @@ static QString displayTemp = staticDataFolderName + "/displayData.xml";
|
||||
static QString streamingHashFilename = staticDataFolderName + "/streamingHash.xml";
|
||||
static QString serverHash = staticDataFolderName + "/serverHash.xml";
|
||||
|
||||
static QString cmd_CheckVersionList = "CHECKVERSIONLIST";
|
||||
|
||||
enum PacketType{
|
||||
TYPE_NONE = 0,
|
||||
TYPE_UNITY = 1,
|
||||
@@ -31,6 +33,7 @@ enum PacketType{
|
||||
TYPE_XMLANSWER = 8,
|
||||
TYPE_QT = 9,
|
||||
TYPE_DISABLE = 11,
|
||||
TYPE_CHECKVERSION = 13,
|
||||
|
||||
TYPE_XMLANSWER_MESSAGE_FOR_GUI = 90,
|
||||
|
||||
@@ -44,7 +47,14 @@ enum PacketType{
|
||||
|
||||
//xml-ответы на запросы AdditionalFiles
|
||||
TYPE_XMLANSWER_QUERY_TASKS_XML_FIM = 130,
|
||||
TYPE_XMLANSWER_QUERY_TASKS_XML_AMM = 131
|
||||
TYPE_XMLANSWER_QUERY_TASKS_XML_AMM = 131,
|
||||
|
||||
HASH_READY = 150,
|
||||
CHANGE_DATA_VERSION = 151,
|
||||
COPY_VERSION = 152,
|
||||
DELETE_DATA_VERSION = 153,
|
||||
BUSY = 154,
|
||||
FREE = 155
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(PacketType)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
#include "versioncontainer.h"
|
||||
|
||||
VersionContainer::VersionContainer(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
VersionContainer::~VersionContainer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString VersionContainer::getServerVersion() const
|
||||
{
|
||||
return serverVersionData->getViewName();
|
||||
}
|
||||
|
||||
QString VersionContainer::getLocalVersion() const
|
||||
{
|
||||
return localVersionData->getViewName();
|
||||
}
|
||||
|
||||
StreamingVersionData *VersionContainer::getLocalVersionData() const
|
||||
{
|
||||
return localVersionData;
|
||||
}
|
||||
|
||||
void VersionContainer::setLocalVersionData(StreamingVersionData *value)
|
||||
{
|
||||
localVersionData = value;
|
||||
}
|
||||
|
||||
StreamingVersionData *VersionContainer::getServerVersionData() const
|
||||
{
|
||||
return serverVersionData;
|
||||
}
|
||||
|
||||
void VersionContainer::setServerVersionData(StreamingVersionData *value)
|
||||
{
|
||||
serverVersionData = value;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef VERSIONCONTAINER_H
|
||||
#define VERSIONCONTAINER_H
|
||||
|
||||
#include <QObject>
|
||||
#include "connectorToServer/streamingversiondata.h"
|
||||
|
||||
class VersionContainer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit VersionContainer(QObject *parent = nullptr);
|
||||
~VersionContainer();
|
||||
|
||||
QString getServerVersion() const;
|
||||
QString getLocalVersion() const;
|
||||
|
||||
|
||||
StreamingVersionData *getLocalVersionData() const;
|
||||
void setLocalVersionData(StreamingVersionData *value);
|
||||
|
||||
StreamingVersionData *getServerVersionData() const;
|
||||
void setServerVersionData(StreamingVersionData *value);
|
||||
|
||||
private:
|
||||
StreamingVersionData *localVersionData;
|
||||
StreamingVersionData *serverVersionData;
|
||||
|
||||
};
|
||||
|
||||
#endif // VERSIONCONTAINER_H
|
||||
@@ -7,7 +7,11 @@ ConnectorToServer::ConnectorToServer(QObject *parent) :
|
||||
client(nullptr),
|
||||
dataParser(nullptr),
|
||||
sendSystem(nullptr),
|
||||
recognizeSystem(nullptr)
|
||||
recognizeSystem(nullptr),
|
||||
versionSelectWidget(nullptr),
|
||||
versionContainer(nullptr),
|
||||
notifyController(nullptr),
|
||||
waitAnimationWidget(nullptr)
|
||||
{
|
||||
initialize();
|
||||
}
|
||||
@@ -96,6 +100,7 @@ bool ConnectorToServer::sendQueryTasksXML(QString type)
|
||||
void ConnectorToServer::SetConnectToServer()
|
||||
{
|
||||
emit sigSetConnect(dataParser->getServerSettings(),connectionThread);
|
||||
|
||||
}
|
||||
|
||||
QList<TaskAmmFim> ConnectorToServer::getListTaskFim()
|
||||
@@ -249,6 +254,12 @@ int ConnectorToServer::getIdTraineeByLogin(QString login)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ConnectorToServer::showVersionSelect()
|
||||
{
|
||||
QByteArray answer = dataParser->xmlAnswer_notify(cmd_CheckVersionList);
|
||||
emit sigSendAnswerToServer(answer);
|
||||
}
|
||||
|
||||
/*
|
||||
void ConnectorToServer::slot_AnswerQueryToDB(QList<Instructor>* listInstructors,
|
||||
QList<Trainee>* listTrainees,
|
||||
@@ -316,6 +327,11 @@ void ConnectorToServer::slot_msgToClientReady(QString login, QString text)
|
||||
sendMessageForClient(id, login, text);
|
||||
}
|
||||
|
||||
void ConnectorToServer::showServerList(QList<StreamingVersionData *> *serverList)
|
||||
{
|
||||
versionSelectWidget->fillView(serverList);
|
||||
}
|
||||
|
||||
void ConnectorToServer::initialize()
|
||||
{
|
||||
createObjects();
|
||||
@@ -325,6 +341,22 @@ void ConnectorToServer::initialize()
|
||||
emit sigInitializeClient(recognizeSystem,sendSystem,connectionThread);
|
||||
|
||||
emit sigSetConnect(dataParser->getServerSettings(),connectionThread);
|
||||
|
||||
// QByteArray answer = dataParser->xmlAnswer_notify()
|
||||
// sendSystem->sendXMLAnswer()
|
||||
|
||||
}
|
||||
|
||||
void ConnectorToServer::activateLoadAnimation(bool flag)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
waitAnimationWidget->showWithPlay();
|
||||
}
|
||||
else
|
||||
{
|
||||
waitAnimationWidget->hideWithStop();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectorToServer::bindConnection()
|
||||
@@ -332,10 +364,13 @@ void ConnectorToServer::bindConnection()
|
||||
connect(this,&ConnectorToServer::sigInitializeClient,client,&TCPClient::initialize,Qt::AutoConnection);
|
||||
connect(this,&ConnectorToServer::sigSetConnect,client,&TCPClient::setConnect,Qt::AutoConnection);
|
||||
connect(this,&ConnectorToServer::signal_sendXMLmsgGUItoServer,sendSystem,&SendSystem::sendXMLmsgGUItoServer);
|
||||
connect(this,&ConnectorToServer::sigSendAnswerToServer,sendSystem,&SendSystem::sendXMLAnswer,Qt::AutoConnection);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::sigLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::signal_MessageForGUI,this,&ConnectorToServer::signal_msgFromClientReady);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigShowServerDataList,this,&ConnectorToServer::showServerList);
|
||||
connect (recognizeSystem,&RecognizeSystem::sigSetVersion,versionContainer,&VersionContainer::setServerVersionData);
|
||||
//connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB,this,&ConnectorToServer::slot_AnswerQueryToDB);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryToDB_ListInstructors,this,&ConnectorToServer::slot_AnswerQueryToDB_ListInstructors);
|
||||
@@ -347,8 +382,11 @@ void ConnectorToServer::bindConnection()
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_FIM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_FIM);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnswerQueryTasksXML_AMM,this,&ConnectorToServer::slot_AnswerQueryTasksXML_AMM);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAnimationActivated,this,&ConnectorToServer::activateLoadAnimation,Qt::AutoConnection);
|
||||
|
||||
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer);
|
||||
connect(client,&TCPClient::signal_ConnectedToServer,this,&ConnectorToServer::signal_ConnectedToServer,Qt::AutoConnection);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigNotify,notifyController,&NotifyController::showWarning,Qt::AutoConnection);
|
||||
}
|
||||
|
||||
void ConnectorToServer::createObjects()
|
||||
@@ -360,12 +398,25 @@ void ConnectorToServer::createObjects()
|
||||
|
||||
dataParser = new DataParser;
|
||||
|
||||
waitAnimationWidget = new WaitAnimationWidget;
|
||||
|
||||
sendSystem = new SendSystem;
|
||||
sendSystem->moveToThread(connectionThread);
|
||||
|
||||
recognizeSystem = new RecognizeSystem;
|
||||
recognizeSystem->moveToThread(connectionThread);
|
||||
|
||||
notifyController = new NotifyController;
|
||||
versionContainer = new VersionContainer;
|
||||
versionSelectWidget = new VersionSelectWidget;
|
||||
versionSelectWidget->initialize(sendSystem,versionContainer,notifyController);
|
||||
|
||||
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||
|
||||
waitAnimationWidget->setParent(versionSelectWidget);
|
||||
waitAnimationWidget->initialize(movie,versionSelectWidget);
|
||||
waitAnimationWidget->moveToThread(connectionThread);
|
||||
|
||||
connectionThread->start();
|
||||
connectionThread->setPriority(QThread::HighestPriority);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#define CONNECTORTOSERVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <widgets/versionselectwidget.h>
|
||||
#include <widgets/waitanimationwidget.h>
|
||||
#include "Core\tcpclient.h"
|
||||
#include "Core\dataparser.h"
|
||||
#include "Core\sendsystem.h"
|
||||
@@ -12,6 +14,7 @@
|
||||
#include "computer.h"
|
||||
#include "classroom.h"
|
||||
#include "task.h"
|
||||
#include "streamingversiondata.h"
|
||||
|
||||
class ConnectorToServer : public QObject
|
||||
{
|
||||
@@ -54,7 +57,9 @@ public:
|
||||
Group getGroup(int id);
|
||||
|
||||
int getIdTraineeByLogin(QString login);
|
||||
void showVersionSelect();
|
||||
|
||||
void activateLoadAnimation(bool flag);
|
||||
public slots:
|
||||
/*void slot_AnswerQueryToDB(QList<Instructor>* listInstructors,
|
||||
QList<Trainee>* listTrainees,
|
||||
@@ -71,6 +76,7 @@ public slots:
|
||||
void slot_AnswerQueryTasksXML_AMM(QList<TaskAmmFim> listTaskAmm);
|
||||
|
||||
void slot_msgToClientReady(QString login, QString text);
|
||||
void showServerList(QList<StreamingVersionData*> *serverList);
|
||||
|
||||
signals:
|
||||
void sigSetConnect(ServerSettings* serverSettings,QThread *thread);
|
||||
@@ -93,6 +99,7 @@ signals:
|
||||
void signal_InitMessanger(QList<Trainee> listTrainees);
|
||||
|
||||
void signal_msgFromClientReady(QString login, QString text);
|
||||
void sigSendAnswerToServer(QByteArray array);
|
||||
|
||||
|
||||
private:
|
||||
@@ -106,6 +113,10 @@ private:
|
||||
DataParser *dataParser;
|
||||
SendSystem *sendSystem;
|
||||
RecognizeSystem *recognizeSystem;
|
||||
VersionSelectWidget *versionSelectWidget;
|
||||
VersionContainer *versionContainer;
|
||||
NotifyController *notifyController;
|
||||
WaitAnimationWidget *waitAnimationWidget;
|
||||
|
||||
//Списочная модель БД СУО
|
||||
QList<Instructor> listInstructors;
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#ifndef STREAMINGVERSIONDATA_H
|
||||
#define STREAMINGVERSIONDATA_H
|
||||
|
||||
#include <QObject>
|
||||
#include <qdatetime.h>
|
||||
|
||||
class StreamingVersionData
|
||||
{
|
||||
public:
|
||||
|
||||
StreamingVersionData(){}
|
||||
|
||||
StreamingVersionData(QString absoltePath,QString viewName,QDateTime data,qint32 size)
|
||||
{
|
||||
this->absolutePath = absoltePath;
|
||||
this->viewName = viewName;
|
||||
this->createData = data;
|
||||
this->size = size;
|
||||
}
|
||||
|
||||
void setName(QString viewName)
|
||||
{
|
||||
this->viewName = viewName;
|
||||
}
|
||||
|
||||
void setCreateData(QDateTime data)
|
||||
{
|
||||
this->createData = data;
|
||||
}
|
||||
|
||||
~StreamingVersionData();
|
||||
|
||||
QString getAbsolutPath() const
|
||||
{
|
||||
return absolutePath;
|
||||
}
|
||||
|
||||
QString getViewName() const
|
||||
{
|
||||
return viewName;
|
||||
}
|
||||
|
||||
QDateTime getCreateData() const
|
||||
{
|
||||
return createData;
|
||||
}
|
||||
|
||||
qint32 getSize() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
|
||||
bool getIsChangeable() const
|
||||
{
|
||||
return isChangeable;
|
||||
}
|
||||
void setIsChangeable(bool value)
|
||||
{
|
||||
isChangeable = value;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
QString absolutePath;
|
||||
QString viewName;
|
||||
QDateTime createData;
|
||||
bool isChangeable;
|
||||
qint32 size;
|
||||
};
|
||||
|
||||
#endif // STREAMINGVERSIONDATA_H
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
ui->verticalLayout_1->addWidget(viewerInstructors);
|
||||
ui->verticalLayout_2->addWidget(docTasksWidget);
|
||||
ui->verticalLayout_2->addWidget(fIMtasksWidget);
|
||||
|
||||
ui->btnSetVersion->hide();
|
||||
viewerTrainees->setMinimumHeight(800);
|
||||
viewerInstructors->setMinimumSize(1800, 300);
|
||||
messangerWidget->setMinimumSize(500, 600);
|
||||
@@ -170,7 +170,7 @@ void InstructorsAndTraineesWidget::checkLoginResult(ServerAuthorization *serverA
|
||||
viewerTrainees->setAuthComplited(true);
|
||||
|
||||
Q_EMIT signal_NeedUpdateUI(true, true);
|
||||
|
||||
ui->btnSetVersion->show();
|
||||
ui->btnAuthorizationInstructor->setText(tr("Deauthorization Instructor"));
|
||||
|
||||
updateLabelLoggedInInstructor(serverAuth->Login, serverAuth->ClientName);
|
||||
@@ -200,7 +200,6 @@ void InstructorsAndTraineesWidget::checkDeLoginResult(ServerDeAuthorization *ser
|
||||
Q_EMIT signal_NeedUpdateUI(true, false);
|
||||
|
||||
ui->btnAuthorizationInstructor->setText(tr("Authorization Instructor"));
|
||||
|
||||
updateLabelLoggedInInstructor("","");
|
||||
|
||||
QMessageBox::information(this, tr("Instructor deauthorization"), tr("Successfully!"));
|
||||
@@ -225,7 +224,7 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
|
||||
{//Сервер отключен
|
||||
ui->btnConnectionToServer->setEnabled(true);
|
||||
ui->btnAuthorizationInstructor->setEnabled(false);
|
||||
|
||||
ui->btnSetVersion->hide();
|
||||
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
|
||||
}
|
||||
}
|
||||
@@ -325,3 +324,8 @@ void InstructorsAndTraineesWidget::on_btnUpdateStyleSheet_clicked()
|
||||
{
|
||||
updateMyStyleSheet();
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::on_btnSetVersion_clicked()
|
||||
{
|
||||
connectorToServer->showVersionSelect();
|
||||
}
|
||||
|
||||
@@ -63,6 +63,8 @@ private Q_SLOTS:
|
||||
void on_btnAuthorizationInstructor_clicked();
|
||||
void on_btnUpdateStyleSheet_clicked();
|
||||
|
||||
void on_btnSetVersion_clicked();
|
||||
|
||||
private:
|
||||
//Авторизация инструктора локальная
|
||||
bool authorizationInstructorDialog(QWidget* parent = nullptr);
|
||||
|
||||
@@ -203,6 +203,19 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnSetVersion">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>58</width>
|
||||
<height>58</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ChangeVersion</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnUpdateStyleSheet">
|
||||
<property name="minimumSize">
|
||||
|
||||
@@ -40,5 +40,6 @@
|
||||
<file>resources/icons/task.png</file>
|
||||
<file>resources/icons/procedure.png</file>
|
||||
<file>resources/icons/malfunction.png</file>
|
||||
<file>resources/icons/762.gif</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
BIN
InstructorsAndTrainees/resources/icons/762.gif
Normal file
BIN
InstructorsAndTrainees/resources/icons/762.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.6 KiB |
37
InstructorsAndTrainees/widgets/newversionwidget.cpp
Normal file
37
InstructorsAndTrainees/widgets/newversionwidget.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include "newversionwidget.h"
|
||||
#include "ui_newversionwidget.h"
|
||||
|
||||
NewVersionWidget::NewVersionWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::NewVersionWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(Qt::SubWindow);
|
||||
setAttribute(Qt::WA_ShowModal,true);
|
||||
}
|
||||
|
||||
void NewVersionWidget::initialize(VersionSelectWidget *versionSelectWidget, QString prevName)
|
||||
{
|
||||
this->versionSelectWidget = versionSelectWidget;
|
||||
ui->prevVerValue->setText(prevName);
|
||||
}
|
||||
|
||||
|
||||
void NewVersionWidget::on_createButton_clicked()
|
||||
{
|
||||
if(ui->lineEdit->text() != "")
|
||||
{
|
||||
versionSelectWidget->sendCopyEmit(ui->lineEdit->text());
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
void NewVersionWidget::on_cancelButton_clicked()
|
||||
{
|
||||
hide();
|
||||
}
|
||||
|
||||
NewVersionWidget::~NewVersionWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
31
InstructorsAndTrainees/widgets/newversionwidget.h
Normal file
31
InstructorsAndTrainees/widgets/newversionwidget.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef NEWVERSIONWIDGET_H
|
||||
#define NEWVERSIONWIDGET_H
|
||||
|
||||
#include <Widgets/versionselectwidget.h>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class NewVersionWidget;
|
||||
}
|
||||
|
||||
class VersionSelectWidget;
|
||||
class NewVersionWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit NewVersionWidget(QWidget *parent = nullptr);
|
||||
void initialize(VersionSelectWidget *versionSelectWidget,QString prevName);
|
||||
~NewVersionWidget();
|
||||
|
||||
private slots:
|
||||
void on_createButton_clicked();
|
||||
|
||||
void on_cancelButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::NewVersionWidget *ui;
|
||||
VersionSelectWidget *versionSelectWidget;
|
||||
};
|
||||
|
||||
#endif // NEWVERSIONWIDGET_H
|
||||
219
InstructorsAndTrainees/widgets/newversionwidget.ui
Normal file
219
InstructorsAndTrainees/widgets/newversionwidget.ui
Normal file
@@ -0,0 +1,219 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>NewVersionWidget</class>
|
||||
<widget class="QWidget" name="NewVersionWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>325</width>
|
||||
<height>200</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Создать копию...</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QFrame" name="NewVerBackground">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="baseVerLayout">
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="prevVerTitle">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Базовая версия:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="prevVerValue">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="newNameLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="newNameVersionTitle">
|
||||
<property name="text">
|
||||
<string>Новое название:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="createButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Создать</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Отмена</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
107
InstructorsAndTrainees/widgets/versionselectwidget.cpp
Normal file
107
InstructorsAndTrainees/widgets/versionselectwidget.cpp
Normal file
@@ -0,0 +1,107 @@
|
||||
#include "versionselectwidget.h"
|
||||
#include "ui_versionselectwidget.h"
|
||||
#include "ui_versionselectwidget.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
VersionSelectWidget::VersionSelectWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::VersionSelectWidget),
|
||||
selectedVersion(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
|
||||
setAttribute(Qt::WA_ShowModal,true);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::initialize(SendSystem *sendSystem,VersionContainer *versionContainer,NotifyController *notifyController)
|
||||
{
|
||||
connect(this,&VersionSelectWidget::sigSendSwitchVersion,sendSystem,&SendSystem::sendChangeVersion,Qt::AutoConnection);
|
||||
connect(this,&VersionSelectWidget::sigSendCopyVersion,sendSystem,&SendSystem::sendCopyVersion,Qt::AutoConnection);
|
||||
connect(this,&VersionSelectWidget::sigSendDeleteVersion,sendSystem,&SendSystem::sendDeleteVersion,Qt::AutoConnection);
|
||||
connect(this,&VersionSelectWidget::sigSendNotify,notifyController,&NotifyController::showWarning,Qt::AutoConnection);
|
||||
this->versionContainer = versionContainer;
|
||||
hide();
|
||||
setWindowTitle(tr("Управление версиями"));
|
||||
}
|
||||
|
||||
void VersionSelectWidget::fillView(QList<StreamingVersionData *> *serverData)
|
||||
{
|
||||
show();
|
||||
ui->verListView->clear();
|
||||
serverDataList = serverData;
|
||||
ui->verValue->setText(versionContainer->getServerVersionData()->getViewName());
|
||||
|
||||
foreach(StreamingVersionData *data,*serverData)
|
||||
{
|
||||
ui->verListView->addItem(data->getViewName());
|
||||
}
|
||||
}
|
||||
|
||||
void VersionSelectWidget::on_verListView_itemDoubleClicked(QListWidgetItem *item)
|
||||
{
|
||||
foreach(StreamingVersionData *data,*serverDataList)
|
||||
{
|
||||
if(data->getViewName() == item->text())
|
||||
{
|
||||
QString info = "Имя версии: " + data->getViewName() + "\n";
|
||||
info.append("Создан: " + data->getCreateData().toString());
|
||||
ui->infoValue->setText(info);
|
||||
selectedVersion = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void VersionSelectWidget::on_createDuplicateButton_clicked()
|
||||
{
|
||||
NewVersionWidget *newVersionWidget = new NewVersionWidget;
|
||||
newVersionWidget->initialize(this,selectedVersion->getViewName());
|
||||
newVersionWidget->show();
|
||||
}
|
||||
|
||||
void VersionSelectWidget::sendCopyEmit(QString newName)
|
||||
{
|
||||
QString result = selectedVersion->getViewName() + ";" + newName;
|
||||
|
||||
if (selectedVersion == nullptr)
|
||||
{
|
||||
sigSendNotify(tr("Версия не выбрана"));
|
||||
return;
|
||||
}
|
||||
|
||||
//versionContainer->setLocalVersionData(selectedVersion);
|
||||
emit sigSendCopyVersion(result);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::on_DeleteVersionButton_clicked()
|
||||
{
|
||||
if (selectedVersion == nullptr)
|
||||
{
|
||||
sigSendNotify(tr("Версия не выбрана"));
|
||||
return;
|
||||
}
|
||||
|
||||
emit sigSendDeleteVersion(selectedVersion);
|
||||
}
|
||||
|
||||
void VersionSelectWidget::on_switchServerVersionButton_clicked()
|
||||
{
|
||||
if (selectedVersion == nullptr)
|
||||
{
|
||||
sigSendNotify(tr("Версия не выбрана"));
|
||||
return;
|
||||
}
|
||||
|
||||
versionContainer->setServerVersionData(selectedVersion);
|
||||
ui->verValue->setText(selectedVersion->getViewName());
|
||||
emit sigSendSwitchVersion(selectedVersion);
|
||||
}
|
||||
|
||||
|
||||
|
||||
VersionSelectWidget::~VersionSelectWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
50
InstructorsAndTrainees/widgets/versionselectwidget.h
Normal file
50
InstructorsAndTrainees/widgets/versionselectwidget.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef VERSIONSELECTWIDGET_H
|
||||
#define VERSIONSELECTWIDGET_H
|
||||
|
||||
#include <QListWidget>
|
||||
#include <QWidget>
|
||||
|
||||
#include <Core/sendsystem.h>
|
||||
#include <Core/versioncontainer.h>
|
||||
#include <Core/notifycontroller.h>
|
||||
#include <streamingversiondata.h>
|
||||
#include <Widgets/newversionwidget.h>
|
||||
|
||||
namespace Ui {
|
||||
class VersionSelectWidget;
|
||||
}
|
||||
|
||||
class VersionSelectWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit VersionSelectWidget(QWidget *parent = nullptr);
|
||||
|
||||
void initialize(SendSystem *sendSystem,VersionContainer *versionContainer,NotifyController *notifyController);
|
||||
void fillView(QList<StreamingVersionData*> *serverData);
|
||||
void sendCopyEmit(QString newName);
|
||||
|
||||
~VersionSelectWidget();
|
||||
private slots:
|
||||
void on_verListView_itemDoubleClicked(QListWidgetItem *item);
|
||||
void on_createDuplicateButton_clicked();
|
||||
void on_DeleteVersionButton_clicked();
|
||||
void on_switchServerVersionButton_clicked();
|
||||
|
||||
signals:
|
||||
void sigSendDeleteVersion(StreamingVersionData *streaming);
|
||||
void sigSendSwitchVersion(StreamingVersionData *selectVersion);
|
||||
void sigSendCopyVersion(QString versionPair);
|
||||
void sigSendNotify(QString message);
|
||||
|
||||
private:
|
||||
Ui::VersionSelectWidget *ui;
|
||||
SendSystem *sendSystem;
|
||||
QList<StreamingVersionData*> *serverDataList;
|
||||
VersionContainer *versionContainer;
|
||||
NotifyController *notifyController;
|
||||
StreamingVersionData *selectedVersion;
|
||||
};
|
||||
|
||||
#endif // VERSIONSELECTWIDGET_H
|
||||
239
InstructorsAndTrainees/widgets/versionselectwidget.ui
Normal file
239
InstructorsAndTrainees/widgets/versionselectwidget.ui
Normal file
@@ -0,0 +1,239 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>VersionSelectWidget</class>
|
||||
<widget class="QWidget" name="VersionSelectWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>606</width>
|
||||
<height>229</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>301</width>
|
||||
<height>171</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="actualServerListLayout">
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="verListTitle">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Calibri</family>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::PreventContextMenu</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Доступные версии на сервере</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="verListView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>180</y>
|
||||
<width>601</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="ButtonLayout" stretch="0,0">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="createDuplicateButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Создать копию</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="DeleteVersionButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Удалить</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="switchServerVersionButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Переключить версию сервера</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>0</y>
|
||||
<width>291</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="infoViewTitle">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Информация:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="infoValue">
|
||||
<property name="text">
|
||||
<string>Тут будет информация о версии...</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>140</y>
|
||||
<width>291</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="ServerInfoLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="verTitle">
|
||||
<property name="text">
|
||||
<string>Текущая версия сервера:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="verValue">
|
||||
<property name="text">
|
||||
<string>none</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
35
InstructorsAndTrainees/widgets/waitanimationwidget.cpp
Normal file
35
InstructorsAndTrainees/widgets/waitanimationwidget.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "waitanimationwidget.h"
|
||||
#include "ui_waitanimationwidget.h"
|
||||
|
||||
WaitAnimationWidget::WaitAnimationWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::WaitAnimationWidget),
|
||||
loadingMovie(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
void WaitAnimationWidget::initialize(QMovie *movie,QWidget *parent)
|
||||
{
|
||||
ui->MovieLabel->setMovie(movie);
|
||||
loadingMovie = movie;
|
||||
setFixedSize(parent->width(),parent->height());
|
||||
hide();
|
||||
}
|
||||
|
||||
void WaitAnimationWidget::showWithPlay()
|
||||
{
|
||||
show();
|
||||
loadingMovie->start();
|
||||
}
|
||||
|
||||
void WaitAnimationWidget::hideWithStop()
|
||||
{
|
||||
hide();
|
||||
loadingMovie->stop();
|
||||
}
|
||||
|
||||
WaitAnimationWidget::~WaitAnimationWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
27
InstructorsAndTrainees/widgets/waitanimationwidget.h
Normal file
27
InstructorsAndTrainees/widgets/waitanimationwidget.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef WAITANIMATIONWIDGET_H
|
||||
#define WAITANIMATIONWIDGET_H
|
||||
|
||||
#include <QMovie>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class WaitAnimationWidget;
|
||||
}
|
||||
|
||||
class WaitAnimationWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit WaitAnimationWidget(QWidget *parent = nullptr);
|
||||
void initialize(QMovie *movie,QWidget *parent);
|
||||
void showWithPlay();
|
||||
void hideWithStop();
|
||||
~WaitAnimationWidget();
|
||||
|
||||
private:
|
||||
Ui::WaitAnimationWidget *ui;
|
||||
QMovie *loadingMovie;
|
||||
};
|
||||
|
||||
#endif // WAITANIMATIONWIDGET_H
|
||||
73
InstructorsAndTrainees/widgets/waitanimationwidget.ui
Normal file
73
InstructorsAndTrainees/widgets/waitanimationwidget.ui
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>WaitAnimationWidget</class>
|
||||
<widget class="QWidget" name="WaitAnimationWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>635</width>
|
||||
<height>293</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color:rgba(0,0,0,50%);</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="mainLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="MovieLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color:rgba(0,0,0,50%)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../resources.qrc">:/resources/icons/762.gif</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user