diff --git a/Core/UpdateController.cpp b/Core/UpdateController.cpp index 6cf0ec2..b9689aa 100644 --- a/Core/UpdateController.cpp +++ b/Core/UpdateController.cpp @@ -107,6 +107,12 @@ QList UpdateController::calculateHash(QString path,QString ignoreName) return *hashes; } +void UpdateController::checkCanUpdate() +{ + QByteArray checkUpdate = dataParser->xmlAnswer_notify("CANCHANGE"); + sendSystem->sendXMLAnswer(checkUpdate); +} + void UpdateController::updateFilesOnServer(QList *fileSendList){ QListIterator serverIterator(*fileSendList); @@ -122,7 +128,7 @@ void UpdateController::updateFilesOnServer(QList *fileSendList){ } else { - QString fullPath = Tools::createReceiveFullPath(data.path,versionContainer->getLocalVersionData()); + QString fullPath = Tools::createReceiveFullPath(data.path,versionContainer->getServerVersionData()); sendSystem->sendFileBlockWithVersion(fullPath,data.path); } diff --git a/Core/UpdateController.h b/Core/UpdateController.h index ee548a8..0162758 100644 --- a/Core/UpdateController.h +++ b/Core/UpdateController.h @@ -41,6 +41,7 @@ public: void updateFilesOnServer(QList *fileSendList); + void checkCanUpdate(); signals: void sigUpdateComplete(bool flag); private: diff --git a/Core/dataparser.cpp b/Core/dataparser.cpp index d9f32a7..8c8d79b 100644 --- a/Core/dataparser.cpp +++ b/Core/dataparser.cpp @@ -8,11 +8,17 @@ DataParser::DataParser(QObject *parent) : } } -void DataParser::initialize(RecognizeSystem *recognizeSystem,NotifyController *notifyController) +void DataParser::initialize(RecognizeSystem *recognizeSystem, + NotifyController *notifyController, + UpdateController *updateController, + HashComparer *hashComparer) { this->recognizeSystem = recognizeSystem; this->notifyController = notifyController; + this->hashComparer = hashComparer; + connect(this,&DataParser::sigNotify,notifyController,&NotifyController::showWarning,Qt::AutoConnection); + connect(this,&DataParser::sigUpdateFilesOnServer,updateController,&UpdateController::updateFilesOnServer,Qt::AutoConnection); } void DataParser::createFileDataList(QList fileDataList,QString filename) @@ -428,6 +434,17 @@ void DataParser::xmlParser(QByteArray array) { emit sigNotify(tr("Такое имя уже существет")); } + + if (value == "UNCHANGEABLE") + { + emit sigNotify(tr("Нельзя выгружать в базовую версию")); + emit recognizeSystem->sigShowUpdateList(); + } + + if (value == "CHANGEABLE") + { + emit sigUpdateFilesOnServer(hashComparer->getFilesForUpdate()); + } } } } @@ -470,16 +487,21 @@ void DataParser::xmlParser(QByteArray array) QString name = attr.name().toString(); QString value = attr.value().toString(); - if(name == "Version") + if (name == "Version") { serverVersion->setName(value); } - if(name == "Created") + if (name == "Created") { serverVersion->setCreateData(QDateTime::fromString(value)); } + if (name == "isChangeable") + { + serverVersion->setIsChangeable(value.toInt()); + } + } recognizeSystem->setServerVersion(serverVersion); } @@ -506,6 +528,10 @@ void DataParser::xmlParser(QByteArray array) data->setName(value); else if(name == "Created") data->setCreateData(QDateTime::fromString(value)); + else if(name == "isChangeable") + { + data->setIsChangeable(value.toInt()); + } } serverStreamingVersionDataList->append(data); diff --git a/Core/dataparser.h b/Core/dataparser.h index c901ee4..0b47d14 100644 --- a/Core/dataparser.h +++ b/Core/dataparser.h @@ -15,6 +15,8 @@ class RecognizeSystem; class NotifyController; +class UpdateController; +class HashComparer; class DataParser : public QObject { @@ -23,7 +25,11 @@ class DataParser : public QObject public: explicit DataParser(QObject *parent = 0); - void initialize(RecognizeSystem *recognizeSystem,NotifyController *notifyController); + void initialize(RecognizeSystem *recognizeSystem, + NotifyController *notifyController, + UpdateController *updateController, + HashComparer *hashComparer); + ~DataParser(); ServerSettings* getServerSettings(); void createServerSettings(ServerSettings* serverSettings); @@ -41,6 +47,7 @@ public: signals: void sigNotify(QString notify); + void sigUpdateFilesOnServer(QList *fileSendList); public slots: QByteArray xmlAnswer_notify(QString code); @@ -51,6 +58,7 @@ private: ClientAutorization *authPassCache; RecognizeSystem *recognizeSystem; NotifyController *notifyController; + HashComparer *hashComparer; }; diff --git a/Core/recognizesystem.cpp b/Core/recognizesystem.cpp index 15b6af1..ca75671 100644 --- a/Core/recognizesystem.cpp +++ b/Core/recognizesystem.cpp @@ -41,6 +41,7 @@ void RecognizeSystem::initialize(UpdateController *updateController, connect(this,&RecognizeSystem::sigServerBlocked,mainWindow,&MainWindow::serverBlocked); connect(this,&RecognizeSystem::sigShowServerList,mainWindow,&MainWindow::showServerListWidget); connect(this,&RecognizeSystem::sigAnimationActivated,mainWindow,&MainWindow::activateLoadingAnimation,Qt::AutoConnection); + connect(this,&RecognizeSystem::sigShowUpdateList,mainWindow,&MainWindow::showUpdateInfo,Qt::AutoConnection); } void RecognizeSystem::recognize(QTcpSocket *socket) diff --git a/Core/recognizesystem.h b/Core/recognizesystem.h index 15c6a85..e08cfaa 100644 --- a/Core/recognizesystem.h +++ b/Core/recognizesystem.h @@ -48,6 +48,7 @@ signals: void sigStartCompare(); void sigShowServerList(QList *serverDatas); void sigAnimationActivated(bool flag); + void sigShowUpdateList(); private: QList *folderList; diff --git a/Core/sendsystem.cpp b/Core/sendsystem.cpp index efac325..3deb6aa 100644 --- a/Core/sendsystem.cpp +++ b/Core/sendsystem.cpp @@ -71,7 +71,7 @@ void SendSystem::sendFileBlock(QString path) while(!file.atEnd()){ QByteArray data = file.read(1025*250); stream << data; - socket->waitForBytesWritten(); + socket->waitForBytesWritten(20); countSend++; } @@ -122,7 +122,7 @@ void SendSystem::sendFileBlockWithVersion(QString localPath,QString serverPath) while(!file.atEnd()){ QByteArray data = file.read(1025*250); stream << data; - socket->waitForBytesWritten(); + socket->waitForBytesWritten(10); countSend++; } @@ -217,16 +217,6 @@ void SendSystem::sendCheckHash() socket->waitForReadyRead(2000); stream << PacketType::TYPE_CHECK_VERSION; - //socket->waitForReadyRead(1000); - -// else if(command == "update") -// { -// qDebug() << ("Update started"); -// stream << PacketType::TYPE_COMMAND; -// stream << command; -// socket->waitForReadyRead(1000); -// } - } SendSystem::~SendSystem() diff --git a/Data/streamingversiondata.h b/Data/streamingversiondata.h index f909ef1..d190385 100644 --- a/Data/streamingversiondata.h +++ b/Data/streamingversiondata.h @@ -50,11 +50,25 @@ public: 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 + + + diff --git a/RRJClient.pro.user b/RRJClient.pro.user index 7bda73f..71be105 100644 --- a/RRJClient.pro.user +++ b/RRJClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/StaticData/serverHash.xml b/StaticData/serverHash.xml index 5552bc7..67fc33c 100644 --- a/StaticData/serverHash.xml +++ b/StaticData/serverHash.xml @@ -181,7148 +181,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/StaticData/settings.xml b/StaticData/settings.xml index a377670..8877b7c 100644 --- a/StaticData/settings.xml +++ b/StaticData/settings.xml @@ -1,5 +1,5 @@ - + - + diff --git a/StaticData/temp.xml b/StaticData/temp.xml index ed93f70..021a729 100644 --- a/StaticData/temp.xml +++ b/StaticData/temp.xml @@ -1,2 +1,2 @@ - + diff --git a/Widgets/updatenotifywidget.cpp b/Widgets/updatenotifywidget.cpp index 99ae6be..a74120d 100644 --- a/Widgets/updatenotifywidget.cpp +++ b/Widgets/updatenotifywidget.cpp @@ -46,12 +46,6 @@ void UpdateNotifyWidget::showWithFill() void UpdateNotifyWidget::on_loadToServerButton_clicked() { -// if(versionContainer->getServerVersion() == baseNamePackage) -// { -// showWarning("В базовую версию загрузка невозможна!"); -// return; -// } - mainWindow->loadToServer(); } diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe index 3e56268..f523613 100644 Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ diff --git a/debug/dataparser.o b/debug/dataparser.o index f3d9961..ecb0949 100644 Binary files a/debug/dataparser.o and b/debug/dataparser.o differ diff --git a/debug/mainwindow.o b/debug/mainwindow.o index ffba6ba..6a0a0b6 100644 Binary files a/debug/mainwindow.o and b/debug/mainwindow.o differ diff --git a/debug/moc_dataparser.cpp b/debug/moc_dataparser.cpp index 866722d..c4ad1f3 100644 --- a/debug/moc_dataparser.cpp +++ b/debug/moc_dataparser.cpp @@ -10,6 +10,7 @@ #include "../Core/dataparser.h" #include #include +#include #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'dataparser.h' doesn't include ." #elif Q_MOC_OUTPUT_REVISION != 67 @@ -22,8 +23,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_DataParser_t { - QByteArrayData data[6]; - char stringdata0[51]; + QByteArrayData data[9]; + char stringdata0[104]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -36,12 +37,16 @@ QT_MOC_LITERAL(0, 0, 10), // "DataParser" QT_MOC_LITERAL(1, 11, 9), // "sigNotify" QT_MOC_LITERAL(2, 21, 0), // "" QT_MOC_LITERAL(3, 22, 6), // "notify" -QT_MOC_LITERAL(4, 29, 16), // "xmlAnswer_notify" -QT_MOC_LITERAL(5, 46, 4) // "code" +QT_MOC_LITERAL(4, 29, 22), // "sigUpdateFilesOnServer" +QT_MOC_LITERAL(5, 52, 16), // "QList*" +QT_MOC_LITERAL(6, 69, 12), // "fileSendList" +QT_MOC_LITERAL(7, 82, 16), // "xmlAnswer_notify" +QT_MOC_LITERAL(8, 99, 4) // "code" }, "DataParser\0sigNotify\0\0notify\0" - "xmlAnswer_notify\0code" + "sigUpdateFilesOnServer\0QList*\0" + "fileSendList\0xmlAnswer_notify\0code" }; #undef QT_MOC_LITERAL @@ -51,24 +56,26 @@ static const uint qt_meta_data_DataParser[] = { 8, // revision 0, // classname 0, 0, // classinfo - 2, 14, // methods + 3, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags - 1, // signalCount + 2, // signalCount // signals: name, argc, parameters, tag, flags - 1, 1, 24, 2, 0x06 /* Public */, + 1, 1, 29, 2, 0x06 /* Public */, + 4, 1, 32, 2, 0x06 /* Public */, // slots: name, argc, parameters, tag, flags - 4, 1, 27, 2, 0x0a /* Public */, + 7, 1, 35, 2, 0x0a /* Public */, // signals: parameters QMetaType::Void, QMetaType::QString, 3, + QMetaType::Void, 0x80000000 | 5, 6, // slots: parameters - QMetaType::QByteArray, QMetaType::QString, 5, + QMetaType::QByteArray, QMetaType::QString, 8, 0 // eod }; @@ -80,7 +87,8 @@ void DataParser::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, Q_UNUSED(_t) switch (_id) { case 0: _t->sigNotify((*reinterpret_cast< QString(*)>(_a[1]))); break; - case 1: { QByteArray _r = _t->xmlAnswer_notify((*reinterpret_cast< QString(*)>(_a[1]))); + case 1: _t->sigUpdateFilesOnServer((*reinterpret_cast< QList*(*)>(_a[1]))); break; + case 2: { QByteArray _r = _t->xmlAnswer_notify((*reinterpret_cast< QString(*)>(_a[1]))); if (_a[0]) *reinterpret_cast< QByteArray*>(_a[0]) = std::move(_r); } break; default: ; } @@ -93,6 +101,13 @@ void DataParser::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, return; } } + { + using _t = void (DataParser::*)(QList * ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&DataParser::sigUpdateFilesOnServer)) { + *result = 1; + return; + } + } } } @@ -125,13 +140,13 @@ int DataParser::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 2) + if (_id < 3) qt_static_metacall(this, _c, _id, _a); - _id -= 2; + _id -= 3; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 2) + if (_id < 3) *reinterpret_cast(_a[0]) = -1; - _id -= 2; + _id -= 3; } return _id; } @@ -142,5 +157,12 @@ void DataParser::sigNotify(QString _t1) void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))) }; QMetaObject::activate(this, &staticMetaObject, 0, _a); } + +// SIGNAL 1 +void DataParser::sigUpdateFilesOnServer(QList * _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))) }; + QMetaObject::activate(this, &staticMetaObject, 1, _a); +} QT_WARNING_POP QT_END_MOC_NAMESPACE diff --git a/debug/moc_dataparser.o b/debug/moc_dataparser.o index ea3ec39..c63b7cd 100644 Binary files a/debug/moc_dataparser.o and b/debug/moc_dataparser.o differ diff --git a/debug/moc_mainwindow.cpp b/debug/moc_mainwindow.cpp index 5b2bde2..2ab707a 100644 --- a/debug/moc_mainwindow.cpp +++ b/debug/moc_mainwindow.cpp @@ -23,8 +23,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_MainWindow_t { - QByteArrayData data[63]; - char stringdata0[961]; + QByteArrayData data[61]; + char stringdata0[927]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -60,42 +60,40 @@ QT_MOC_LITERAL(23, 296, 10), // "PacketType" QT_MOC_LITERAL(24, 307, 10), // "packetType" QT_MOC_LITERAL(25, 318, 16), // "sigSendXMLAnswer" QT_MOC_LITERAL(26, 335, 6), // "answer" -QT_MOC_LITERAL(27, 342, 22), // "sigUpdateFilesOnServer" -QT_MOC_LITERAL(28, 365, 16), // "QList*" -QT_MOC_LITERAL(29, 382, 12), // "fileSendList" -QT_MOC_LITERAL(30, 395, 13), // "sigSetConnect" -QT_MOC_LITERAL(31, 409, 15), // "ServerSettings*" -QT_MOC_LITERAL(32, 425, 14), // "serverSettings" -QT_MOC_LITERAL(33, 440, 16), // "sigCalculateHash" -QT_MOC_LITERAL(34, 457, 19), // "sigSendAutorization" -QT_MOC_LITERAL(35, 477, 12), // "sigSendCheck" -QT_MOC_LITERAL(36, 490, 15), // "sigGetConnected" -QT_MOC_LITERAL(37, 506, 14), // "showUpdateInfo" -QT_MOC_LITERAL(38, 521, 21), // "showCompleteDialogBox" -QT_MOC_LITERAL(39, 543, 19), // "slotConnectionState" -QT_MOC_LITERAL(40, 563, 4), // "flag" -QT_MOC_LITERAL(41, 568, 20), // "slotServerDisconnect" -QT_MOC_LITERAL(42, 589, 14), // "updateProgress" -QT_MOC_LITERAL(43, 604, 12), // "loadComplete" -QT_MOC_LITERAL(44, 617, 14), // "lostConnection" -QT_MOC_LITERAL(45, 632, 13), // "serverBlocked" -QT_MOC_LITERAL(46, 646, 16), // "checkLoginResult" -QT_MOC_LITERAL(47, 663, 20), // "ServerAuthorization*" -QT_MOC_LITERAL(48, 684, 10), // "serverAuth" -QT_MOC_LITERAL(49, 695, 13), // "setNeedUpdate" -QT_MOC_LITERAL(50, 709, 4), // "size" -QT_MOC_LITERAL(51, 714, 9), // "fileCount" -QT_MOC_LITERAL(52, 724, 11), // "deleteCount" -QT_MOC_LITERAL(53, 736, 20), // "showServerListWidget" -QT_MOC_LITERAL(54, 757, 29), // "QList*" -QT_MOC_LITERAL(55, 787, 10), // "serverData" -QT_MOC_LITERAL(56, 798, 25), // "on_settingsButton_clicked" -QT_MOC_LITERAL(57, 824, 29), // "on_languageComboBox_activated" -QT_MOC_LITERAL(58, 854, 4), // "arg1" -QT_MOC_LITERAL(59, 859, 17), // "slotDisableNotify" -QT_MOC_LITERAL(60, 877, 21), // "on_exitButton_clicked" -QT_MOC_LITERAL(61, 899, 29), // "on_offlineStartButton_clicked" -QT_MOC_LITERAL(62, 929, 31) // "on_unsafeChangingButton_clicked" +QT_MOC_LITERAL(27, 342, 13), // "sigSetConnect" +QT_MOC_LITERAL(28, 356, 15), // "ServerSettings*" +QT_MOC_LITERAL(29, 372, 14), // "serverSettings" +QT_MOC_LITERAL(30, 387, 16), // "sigCalculateHash" +QT_MOC_LITERAL(31, 404, 19), // "sigSendAutorization" +QT_MOC_LITERAL(32, 424, 12), // "sigSendCheck" +QT_MOC_LITERAL(33, 437, 15), // "sigGetConnected" +QT_MOC_LITERAL(34, 453, 18), // "sigSendCheckUpdate" +QT_MOC_LITERAL(35, 472, 14), // "showUpdateInfo" +QT_MOC_LITERAL(36, 487, 21), // "showCompleteDialogBox" +QT_MOC_LITERAL(37, 509, 19), // "slotConnectionState" +QT_MOC_LITERAL(38, 529, 4), // "flag" +QT_MOC_LITERAL(39, 534, 20), // "slotServerDisconnect" +QT_MOC_LITERAL(40, 555, 14), // "updateProgress" +QT_MOC_LITERAL(41, 570, 12), // "loadComplete" +QT_MOC_LITERAL(42, 583, 14), // "lostConnection" +QT_MOC_LITERAL(43, 598, 13), // "serverBlocked" +QT_MOC_LITERAL(44, 612, 16), // "checkLoginResult" +QT_MOC_LITERAL(45, 629, 20), // "ServerAuthorization*" +QT_MOC_LITERAL(46, 650, 10), // "serverAuth" +QT_MOC_LITERAL(47, 661, 13), // "setNeedUpdate" +QT_MOC_LITERAL(48, 675, 4), // "size" +QT_MOC_LITERAL(49, 680, 9), // "fileCount" +QT_MOC_LITERAL(50, 690, 11), // "deleteCount" +QT_MOC_LITERAL(51, 702, 20), // "showServerListWidget" +QT_MOC_LITERAL(52, 723, 29), // "QList*" +QT_MOC_LITERAL(53, 753, 10), // "serverData" +QT_MOC_LITERAL(54, 764, 25), // "on_settingsButton_clicked" +QT_MOC_LITERAL(55, 790, 29), // "on_languageComboBox_activated" +QT_MOC_LITERAL(56, 820, 4), // "arg1" +QT_MOC_LITERAL(57, 825, 17), // "slotDisableNotify" +QT_MOC_LITERAL(58, 843, 21), // "on_exitButton_clicked" +QT_MOC_LITERAL(59, 865, 29), // "on_offlineStartButton_clicked" +QT_MOC_LITERAL(60, 895, 31) // "on_unsafeChangingButton_clicked" }, "MainWindow\0sigInitializeClient\0\0" @@ -107,12 +105,11 @@ QT_MOC_LITERAL(62, 929, 31) // "on_unsafeChangingButton_clicked" "DataParser*\0dataParser\0HashComparer*\0" "hashComparer\0TCPClient*\0tcpClient\0" "sigSendCommand\0PacketType\0packetType\0" - "sigSendXMLAnswer\0answer\0sigUpdateFilesOnServer\0" - "QList*\0fileSendList\0" - "sigSetConnect\0ServerSettings*\0" - "serverSettings\0sigCalculateHash\0" - "sigSendAutorization\0sigSendCheck\0" - "sigGetConnected\0showUpdateInfo\0" + "sigSendXMLAnswer\0answer\0sigSetConnect\0" + "ServerSettings*\0serverSettings\0" + "sigCalculateHash\0sigSendAutorization\0" + "sigSendCheck\0sigGetConnected\0" + "sigSendCheckUpdate\0showUpdateInfo\0" "showCompleteDialogBox\0slotConnectionState\0" "flag\0slotServerDisconnect\0updateProgress\0" "loadComplete\0lostConnection\0serverBlocked\0" @@ -146,58 +143,58 @@ static const uint qt_meta_data_MainWindow[] = { 13, 5, 160, 2, 0x06 /* Public */, 22, 1, 171, 2, 0x06 /* Public */, 25, 1, 174, 2, 0x06 /* Public */, - 27, 1, 177, 2, 0x06 /* Public */, - 30, 2, 180, 2, 0x06 /* Public */, + 27, 2, 177, 2, 0x06 /* Public */, + 30, 0, 182, 2, 0x06 /* Public */, + 31, 0, 183, 2, 0x06 /* Public */, + 32, 0, 184, 2, 0x06 /* Public */, 33, 0, 185, 2, 0x06 /* Public */, 34, 0, 186, 2, 0x06 /* Public */, - 35, 0, 187, 2, 0x06 /* Public */, - 36, 0, 188, 2, 0x06 /* Public */, // slots: name, argc, parameters, tag, flags - 37, 0, 189, 2, 0x0a /* Public */, - 38, 0, 190, 2, 0x0a /* Public */, - 39, 1, 191, 2, 0x0a /* Public */, + 35, 0, 187, 2, 0x0a /* Public */, + 36, 0, 188, 2, 0x0a /* Public */, + 37, 1, 189, 2, 0x0a /* Public */, + 39, 0, 192, 2, 0x0a /* Public */, + 40, 0, 193, 2, 0x0a /* Public */, 41, 0, 194, 2, 0x0a /* Public */, 42, 0, 195, 2, 0x0a /* Public */, 43, 0, 196, 2, 0x0a /* Public */, - 44, 0, 197, 2, 0x0a /* Public */, - 45, 0, 198, 2, 0x0a /* Public */, - 46, 1, 199, 2, 0x0a /* Public */, - 49, 4, 202, 2, 0x0a /* Public */, - 53, 1, 211, 2, 0x0a /* Public */, - 56, 0, 214, 2, 0x08 /* Private */, - 57, 1, 215, 2, 0x08 /* Private */, + 44, 1, 197, 2, 0x0a /* Public */, + 47, 4, 200, 2, 0x0a /* Public */, + 51, 1, 209, 2, 0x0a /* Public */, + 54, 0, 212, 2, 0x08 /* Private */, + 55, 1, 213, 2, 0x08 /* Private */, + 57, 0, 216, 2, 0x08 /* Private */, + 58, 0, 217, 2, 0x08 /* Private */, 59, 0, 218, 2, 0x08 /* Private */, 60, 0, 219, 2, 0x08 /* Private */, - 61, 0, 220, 2, 0x08 /* Private */, - 62, 0, 221, 2, 0x08 /* Private */, // signals: parameters QMetaType::Void, 0x80000000 | 3, 0x80000000 | 5, 0x80000000 | 7, 0x80000000 | 9, 0x80000000 | 11, 4, 6, 8, 10, 12, QMetaType::Void, 0x80000000 | 14, 0x80000000 | 16, 0x80000000 | 3, 0x80000000 | 18, 0x80000000 | 20, 15, 17, 4, 19, 21, QMetaType::Void, 0x80000000 | 23, 24, QMetaType::Void, QMetaType::QString, 26, - QMetaType::Void, 0x80000000 | 28, 29, - QMetaType::Void, 0x80000000 | 31, 0x80000000 | 11, 32, 12, + QMetaType::Void, 0x80000000 | 28, 0x80000000 | 11, 29, 12, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Bool, + QMetaType::Void, // slots: parameters QMetaType::Void, QMetaType::Void, - QMetaType::Void, QMetaType::Bool, 40, + QMetaType::Void, QMetaType::Bool, 38, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, - QMetaType::Void, 0x80000000 | 47, 48, - QMetaType::Void, QMetaType::Bool, QMetaType::ULongLong, QMetaType::ULongLong, QMetaType::ULongLong, 40, 50, 51, 52, - QMetaType::Void, 0x80000000 | 54, 55, + QMetaType::Void, 0x80000000 | 45, 46, + QMetaType::Void, QMetaType::Bool, QMetaType::ULongLong, QMetaType::ULongLong, QMetaType::ULongLong, 38, 48, 49, 50, + QMetaType::Void, 0x80000000 | 52, 53, QMetaType::Void, - QMetaType::Void, QMetaType::QString, 58, + QMetaType::Void, QMetaType::QString, 56, QMetaType::Void, QMetaType::Void, QMetaType::Void, @@ -216,13 +213,13 @@ void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, case 1: _t->sigRecognize((*reinterpret_cast< UpdateController*(*)>(_a[1])),(*reinterpret_cast< DataParser*(*)>(_a[2])),(*reinterpret_cast< MainWindow*(*)>(_a[3])),(*reinterpret_cast< HashComparer*(*)>(_a[4])),(*reinterpret_cast< TCPClient*(*)>(_a[5]))); break; case 2: _t->sigSendCommand((*reinterpret_cast< PacketType(*)>(_a[1]))); break; case 3: _t->sigSendXMLAnswer((*reinterpret_cast< QString(*)>(_a[1]))); break; - case 4: _t->sigUpdateFilesOnServer((*reinterpret_cast< QList*(*)>(_a[1]))); break; - case 5: _t->sigSetConnect((*reinterpret_cast< ServerSettings*(*)>(_a[1])),(*reinterpret_cast< QThread*(*)>(_a[2]))); break; - case 6: _t->sigCalculateHash(); break; - case 7: _t->sigSendAutorization(); break; - case 8: _t->sigSendCheck(); break; - case 9: { bool _r = _t->sigGetConnected(); + case 4: _t->sigSetConnect((*reinterpret_cast< ServerSettings*(*)>(_a[1])),(*reinterpret_cast< QThread*(*)>(_a[2]))); break; + case 5: _t->sigCalculateHash(); break; + case 6: _t->sigSendAutorization(); break; + case 7: _t->sigSendCheck(); break; + case 8: { bool _r = _t->sigGetConnected(); if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = std::move(_r); } break; + case 9: _t->sigSendCheckUpdate(); break; case 10: _t->showUpdateInfo(); break; case 11: _t->showCompleteDialogBox(); break; case 12: _t->slotConnectionState((*reinterpret_cast< bool(*)>(_a[1]))); break; @@ -275,7 +272,7 @@ void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, *reinterpret_cast(_a[0]) = qRegisterMetaType< UpdateController* >(); break; } break; - case 5: + case 4: switch (*reinterpret_cast(_a[1])) { default: *reinterpret_cast(_a[0]) = -1; break; case 1: @@ -313,44 +310,44 @@ void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, return; } } - { - using _t = void (MainWindow::*)(QList * ); - if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::sigUpdateFilesOnServer)) { - *result = 4; - return; - } - } { using _t = void (MainWindow::*)(ServerSettings * , QThread * ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::sigSetConnect)) { - *result = 5; + *result = 4; return; } } { using _t = void (MainWindow::*)(); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::sigCalculateHash)) { - *result = 6; + *result = 5; return; } } { using _t = void (MainWindow::*)(); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::sigSendAutorization)) { - *result = 7; + *result = 6; return; } } { using _t = void (MainWindow::*)(); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::sigSendCheck)) { - *result = 8; + *result = 7; return; } } { using _t = bool (MainWindow::*)(); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::sigGetConnected)) { + *result = 8; + return; + } + } + { + using _t = void (MainWindow::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&MainWindow::sigSendCheckUpdate)) { *result = 9; return; } @@ -427,44 +424,43 @@ void MainWindow::sigSendXMLAnswer(QString _t1) } // SIGNAL 4 -void MainWindow::sigUpdateFilesOnServer(QList * _t1) +void MainWindow::sigSetConnect(ServerSettings * _t1, QThread * _t2) { - void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))) }; + void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))), const_cast(reinterpret_cast(std::addressof(_t2))) }; QMetaObject::activate(this, &staticMetaObject, 4, _a); } // SIGNAL 5 -void MainWindow::sigSetConnect(ServerSettings * _t1, QThread * _t2) +void MainWindow::sigCalculateHash() { - void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))), const_cast(reinterpret_cast(std::addressof(_t2))) }; - QMetaObject::activate(this, &staticMetaObject, 5, _a); + QMetaObject::activate(this, &staticMetaObject, 5, nullptr); } // SIGNAL 6 -void MainWindow::sigCalculateHash() +void MainWindow::sigSendAutorization() { QMetaObject::activate(this, &staticMetaObject, 6, nullptr); } // SIGNAL 7 -void MainWindow::sigSendAutorization() +void MainWindow::sigSendCheck() { QMetaObject::activate(this, &staticMetaObject, 7, nullptr); } // SIGNAL 8 -void MainWindow::sigSendCheck() -{ - QMetaObject::activate(this, &staticMetaObject, 8, nullptr); -} - -// SIGNAL 9 bool MainWindow::sigGetConnected() { bool _t0{}; void *_a[] = { const_cast(reinterpret_cast(std::addressof(_t0))) }; - QMetaObject::activate(this, &staticMetaObject, 9, _a); + QMetaObject::activate(this, &staticMetaObject, 8, _a); return _t0; } + +// SIGNAL 9 +void MainWindow::sigSendCheckUpdate() +{ + QMetaObject::activate(this, &staticMetaObject, 9, nullptr); +} QT_WARNING_POP QT_END_MOC_NAMESPACE diff --git a/debug/moc_mainwindow.o b/debug/moc_mainwindow.o index a872ed3..72f7a7d 100644 Binary files a/debug/moc_mainwindow.o and b/debug/moc_mainwindow.o differ diff --git a/debug/moc_recognizesystem.cpp b/debug/moc_recognizesystem.cpp index 26803f7..3aad677 100644 --- a/debug/moc_recognizesystem.cpp +++ b/debug/moc_recognizesystem.cpp @@ -23,8 +23,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_RecognizeSystem_t { - QByteArrayData data[23]; - char stringdata0[343]; + QByteArrayData data[24]; + char stringdata0[361]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -55,7 +55,8 @@ QT_MOC_LITERAL(18, 245, 15), // "sigStartCompare" QT_MOC_LITERAL(19, 261, 17), // "sigShowServerList" QT_MOC_LITERAL(20, 279, 29), // "QList*" QT_MOC_LITERAL(21, 309, 11), // "serverDatas" -QT_MOC_LITERAL(22, 321, 21) // "sigAnimationActivated" +QT_MOC_LITERAL(22, 321, 21), // "sigAnimationActivated" +QT_MOC_LITERAL(23, 343, 17) // "sigShowUpdateList" }, "RecognizeSystem\0sigUpdateBytesAvailable\0" @@ -66,7 +67,7 @@ QT_MOC_LITERAL(22, 321, 21) // "sigAnimationActivated" "serverAuth\0sigSocketWaitForReadyRead\0" "waitTime\0sigStartCompare\0sigShowServerList\0" "QList*\0serverDatas\0" - "sigAnimationActivated" + "sigAnimationActivated\0sigShowUpdateList" }; #undef QT_MOC_LITERAL @@ -76,25 +77,26 @@ static const uint qt_meta_data_RecognizeSystem[] = { 8, // revision 0, // classname 0, 0, // classinfo - 11, 14, // methods + 12, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags - 11, // signalCount + 12, // signalCount // signals: name, argc, parameters, tag, flags - 1, 0, 69, 2, 0x06 /* Public */, - 3, 0, 70, 2, 0x06 /* Public */, - 4, 4, 71, 2, 0x06 /* Public */, - 9, 1, 80, 2, 0x06 /* Public */, - 11, 0, 83, 2, 0x06 /* Public */, - 12, 0, 84, 2, 0x06 /* Public */, - 13, 1, 85, 2, 0x06 /* Public */, - 16, 1, 88, 2, 0x06 /* Public */, - 18, 0, 91, 2, 0x06 /* Public */, - 19, 1, 92, 2, 0x06 /* Public */, - 22, 1, 95, 2, 0x06 /* Public */, + 1, 0, 74, 2, 0x06 /* Public */, + 3, 0, 75, 2, 0x06 /* Public */, + 4, 4, 76, 2, 0x06 /* Public */, + 9, 1, 85, 2, 0x06 /* Public */, + 11, 0, 88, 2, 0x06 /* Public */, + 12, 0, 89, 2, 0x06 /* Public */, + 13, 1, 90, 2, 0x06 /* Public */, + 16, 1, 93, 2, 0x06 /* Public */, + 18, 0, 96, 2, 0x06 /* Public */, + 19, 1, 97, 2, 0x06 /* Public */, + 22, 1, 100, 2, 0x06 /* Public */, + 23, 0, 103, 2, 0x06 /* Public */, // signals: parameters QMetaType::Void, @@ -108,6 +110,7 @@ static const uint qt_meta_data_RecognizeSystem[] = { QMetaType::Void, QMetaType::Void, 0x80000000 | 20, 21, QMetaType::Void, QMetaType::Bool, 5, + QMetaType::Void, 0 // eod }; @@ -129,6 +132,7 @@ void RecognizeSystem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int case 8: _t->sigStartCompare(); break; case 9: _t->sigShowServerList((*reinterpret_cast< QList*(*)>(_a[1]))); break; case 10: _t->sigAnimationActivated((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 11: _t->sigShowUpdateList(); break; default: ; } } else if (_c == QMetaObject::IndexOfMethod) { @@ -210,6 +214,13 @@ void RecognizeSystem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int return; } } + { + using _t = void (RecognizeSystem::*)(); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&RecognizeSystem::sigShowUpdateList)) { + *result = 11; + return; + } + } } } @@ -242,13 +253,13 @@ int RecognizeSystem::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 11) + if (_id < 12) qt_static_metacall(this, _c, _id, _a); - _id -= 11; + _id -= 12; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 11) + if (_id < 12) *reinterpret_cast(_a[0]) = -1; - _id -= 11; + _id -= 12; } return _id; } @@ -324,5 +335,11 @@ void RecognizeSystem::sigAnimationActivated(bool _t1) void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))) }; QMetaObject::activate(this, &staticMetaObject, 10, _a); } + +// SIGNAL 11 +void RecognizeSystem::sigShowUpdateList() +{ + QMetaObject::activate(this, &staticMetaObject, 11, nullptr); +} QT_WARNING_POP QT_END_MOC_NAMESPACE diff --git a/debug/moc_recognizesystem.o b/debug/moc_recognizesystem.o index c04d077..c031945 100644 Binary files a/debug/moc_recognizesystem.o and b/debug/moc_recognizesystem.o differ diff --git a/debug/moc_sendsystem.o b/debug/moc_sendsystem.o index a970aa9..cf96001 100644 Binary files a/debug/moc_sendsystem.o and b/debug/moc_sendsystem.o differ diff --git a/debug/moc_updatecontroller.o b/debug/moc_updatecontroller.o index 8399e6e..70cd89d 100644 Binary files a/debug/moc_updatecontroller.o and b/debug/moc_updatecontroller.o differ diff --git a/debug/moc_versioncontainer.o b/debug/moc_versioncontainer.o index 5255491..97887bd 100644 Binary files a/debug/moc_versioncontainer.o and b/debug/moc_versioncontainer.o differ diff --git a/debug/moc_versionselectwidget.o b/debug/moc_versionselectwidget.o index 12d74fe..07a33c6 100644 Binary files a/debug/moc_versionselectwidget.o and b/debug/moc_versionselectwidget.o differ diff --git a/debug/qrc_resources.cpp b/debug/qrc_resources.cpp index 254888e..fe3b4af 100644 --- a/debug/qrc_resources.cpp +++ b/debug/qrc_resources.cpp @@ -328148,7 +328148,7 @@ static const unsigned char qt_resource_struct[] = { 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, // :/style.css 0x0,0x0,0x0,0x16,0x0,0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, -0x0,0x0,0x1,0x94,0x6e,0x89,0xce,0xcb, +0x0,0x0,0x1,0x94,0x73,0x3d,0x42,0x61, // :/resource 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0x3, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, @@ -328166,13 +328166,13 @@ static const unsigned char qt_resource_struct[] = { 0x0,0x0,0x1,0x92,0x4d,0x0,0xce,0xbb, // :/resource/SSJ_backgroundDarkSM.png 0x0,0x0,0x0,0x60,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x22,0x2d,0x97, -0x0,0x0,0x1,0x93,0xf7,0x6c,0xa6,0xcf, +0x0,0x0,0x1,0x94,0x73,0x3d,0x42,0x5c, // :/resource/SSJ_backgroundDark.png 0x0,0x0,0x0,0x2e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x3,0x64, -0x0,0x0,0x1,0x93,0xf7,0x67,0xfd,0xc6, +0x0,0x0,0x1,0x94,0x73,0x3d,0x42,0x32, // :/resource/Icons/caution.png 0x0,0x0,0x1,0x90,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x4f,0x5,0x71, -0x0,0x0,0x1,0x93,0xf8,0xc4,0xe,0x70, +0x0,0x0,0x1,0x94,0x73,0x3d,0x41,0xee, // :/resource/Icons/setting.png 0x0,0x0,0x2,0x34,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x4f,0xa6,0x74, 0x0,0x0,0x1,0x92,0x47,0x9,0xdd,0xaa, diff --git a/debug/qrc_resources.o b/debug/qrc_resources.o index e880a9b..d6c5814 100644 Binary files a/debug/qrc_resources.o and b/debug/qrc_resources.o differ diff --git a/debug/recognizesystem.o b/debug/recognizesystem.o index 402b879..3ebfe42 100644 Binary files a/debug/recognizesystem.o and b/debug/recognizesystem.o differ diff --git a/debug/sendsystem.o b/debug/sendsystem.o index 3b143d3..d422357 100644 Binary files a/debug/sendsystem.o and b/debug/sendsystem.o differ diff --git a/debug/tools.o b/debug/tools.o index ff9f0d1..a13d79c 100644 Binary files a/debug/tools.o and b/debug/tools.o differ diff --git a/debug/updatecontroller.o b/debug/updatecontroller.o index 6533f0e..45e8e06 100644 Binary files a/debug/updatecontroller.o and b/debug/updatecontroller.o differ diff --git a/debug/updatenotifywidget.o b/debug/updatenotifywidget.o index 297d4a8..460ea4f 100644 Binary files a/debug/updatenotifywidget.o and b/debug/updatenotifywidget.o differ diff --git a/debug/versioncontainer.o b/debug/versioncontainer.o index faef12c..66bc7e5 100644 Binary files a/debug/versioncontainer.o and b/debug/versioncontainer.o differ diff --git a/debug/versionselectwidget.o b/debug/versionselectwidget.o index 4ace619..1ba9f23 100644 Binary files a/debug/versionselectwidget.o and b/debug/versionselectwidget.o differ diff --git a/mainwindow.cpp b/mainwindow.cpp index c7262a6..4a8233a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -84,7 +84,7 @@ void MainWindow::initialize() hashComparer->initialize(this,versionContainer); updateController->initialize(this,versionContainer); sendSystem->initialize(this,dataParser); - dataParser->initialize(recognizeSystem,notifyController); + dataParser->initialize(recognizeSystem,notifyController,updateController,hashComparer); recognizeSystem->initialize(updateController,dataParser,this,hashComparer,client,versionContainer); resourceManager->painting(); commonButtonGroupWidget->initialize(this,externalExecuter,sendSystem,client); @@ -110,14 +110,13 @@ void MainWindow::bindConnection() { connect(timer,&QTimer::timeout,this,&MainWindow::slotDisableNotify); - connect(this,&MainWindow::sigUpdateFilesOnServer,updateController,&UpdateController::updateFilesOnServer,Qt::AutoConnection); connect(this,&MainWindow::sigInitializeClient,client,&TCPClient::initialize,Qt::AutoConnection); connect(this,&MainWindow::sigSetConnect,client,&TCPClient::setConnect,Qt::AutoConnection); connect(this,&MainWindow::sigSendCommand,sendSystem,&SendSystem::sendPacketType,Qt::AutoConnection); connect(this,&MainWindow::sigSendCheck,sendSystem,&SendSystem::sendCheckHash,Qt::AutoConnection); connect(this,&MainWindow::sigSendXMLAnswer,sendSystem,&SendSystem::xmlAnswer,Qt::AutoConnection); connect(this,&MainWindow::sigSendAutorization,sendSystem,&SendSystem::sendClientAutorization); - + connect(this,&MainWindow::sigSendCheckUpdate,updateController,&UpdateController::checkCanUpdate,Qt::AutoConnection); connect(this,&MainWindow::sigGetConnected,client,&TCPClient::getIsConnected); connect(this,&MainWindow::sigCalculateHash,updateController,&UpdateController::calculateCommonHash); } @@ -428,7 +427,8 @@ void MainWindow::loadToServer() ui->offlineStartButton->setEnabled(false); updateWidget->hide(); ui->unsafeChangingButton->hide(); - emit sigUpdateFilesOnServer(hashComparer->getFilesForUpdate()); + + emit sigSendCheckUpdate(); } void MainWindow::undoCurrentChanges() @@ -469,6 +469,8 @@ void MainWindow::on_offlineStartButton_clicked() void MainWindow::on_unsafeChangingButton_clicked() { + checkUpdate(); + showUpdateInfo(); updateWidget->show(); } diff --git a/mainwindow.h b/mainwindow.h index ca4e684..37f9682 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -75,12 +75,12 @@ signals: void sigSendCommand(PacketType packetType); void sigSendXMLAnswer(QString answer); - void sigUpdateFilesOnServer(QList *fileSendList); void sigSetConnect(ServerSettings* serverSettings,QThread *thread); void sigCalculateHash(); void sigSendAutorization(); void sigSendCheck(); bool sigGetConnected(); + void sigSendCheckUpdate(); public slots: