mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feta: change version with callback from server
This commit is contained in:
@@ -266,6 +266,10 @@ void RecognizeSystem::recognize(QTcpSocket *socket)
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
|
||||
if(packetType == PacketType::HASH_READY)
|
||||
{
|
||||
mainWindow->checkUpdate();
|
||||
}
|
||||
packetType = PacketType::TYPE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ SendSystem::SendSystem(QObject *)
|
||||
|
||||
void SendSystem::initialize(MainWindow *mainWindow,DataParser *dataParser)
|
||||
{
|
||||
this->mainWindow = mainWindow;
|
||||
connect(this,&SendSystem::sigSend,mainWindow,&MainWindow::updateProgress);
|
||||
connect(this,&SendSystem::sigGetXmlAnswer,dataParser,&DataParser::xmlAnswer_notify,Qt::DirectConnection); //МОЖЕТ ДАТУ ПАРСЕР В ВТОРОСТЕПЕННЫЙ ПОТОК?
|
||||
}
|
||||
@@ -107,7 +108,6 @@ void SendSystem::sendFolderBlock(QString path)
|
||||
socket->waitForReadyRead(100);
|
||||
}
|
||||
|
||||
|
||||
void SendSystem::sendQTConnect()
|
||||
{
|
||||
QString value = QString::number(PacketType::TYPE_QT);
|
||||
@@ -139,6 +139,25 @@ 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::sendCopyVersion(StreamingVersionData *streamingVersion)
|
||||
{
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
stream << PacketType::COPY_VERSION;
|
||||
|
||||
stream << streamingVersion->getViewName();
|
||||
}
|
||||
|
||||
SendSystem::~SendSystem()
|
||||
{
|
||||
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
#include <QTcpSocket>
|
||||
#include <QDataStream>
|
||||
#include <mainwindow.h>
|
||||
#include <Core/tools.h>
|
||||
|
||||
class MainWindow;
|
||||
class DataParser;
|
||||
class Tools;
|
||||
|
||||
class SendSystem :public QObject
|
||||
{
|
||||
@@ -26,6 +28,8 @@ public:
|
||||
|
||||
~SendSystem();
|
||||
|
||||
void sendChangeVersion(StreamingVersionData *streamingVersion);
|
||||
void sendCopyVersion(StreamingVersionData* streamingVersion);
|
||||
signals:
|
||||
void sigSend();
|
||||
QByteArray sigGetXmlAnswer(QString);
|
||||
@@ -34,6 +38,7 @@ public slots:
|
||||
void xmlAnswer(QString message);
|
||||
private:
|
||||
QTcpSocket *socket;
|
||||
MainWindow *mainWindow;
|
||||
|
||||
};
|
||||
|
||||
|
||||
10
Core/tools.h
10
Core/tools.h
@@ -21,6 +21,10 @@ static QString displayTemp = staticDataFolderName + "/displayData.xml";
|
||||
static QString streamingHashFilename = staticDataFolderName + "/streamingHash.xml";
|
||||
static QString serverHash = staticDataFolderName + "/serverHash.xml";
|
||||
|
||||
static QString cmd_CheckVersionList = "CHECKVERSIONLIST";
|
||||
static QString cmd_GetServerHash = "GETSERVERDATALIST";
|
||||
static QString cmd_Disable = "DISABLE";
|
||||
|
||||
enum PacketType{
|
||||
TYPE_NONE = 0,
|
||||
TYPE_UNITY = 1,
|
||||
@@ -32,7 +36,11 @@ enum PacketType{
|
||||
TYPE_NEEDUPDATE = 7,
|
||||
TYPE_XMLANSWER = 8,
|
||||
TYPE_QT = 9,
|
||||
TYPE_DISABLE = 11
|
||||
TYPE_DISABLE = 11,
|
||||
|
||||
HASH_READY = 150,
|
||||
CHANGE_DATA_VERSION = 151,
|
||||
COPY_VERSION = 152
|
||||
};
|
||||
|
||||
class Tools {
|
||||
|
||||
Reference in New Issue
Block a user