diff --git a/Core/UpdateController.cpp b/Core/UpdateController.cpp index cd79658..ff6d001 100644 --- a/Core/UpdateController.cpp +++ b/Core/UpdateController.cpp @@ -8,6 +8,7 @@ UpdateController::UpdateController(DataParser *parser,SendSystem *sendSystem, QO this->dataParser = parser; this->sendSystem = sendSystem; localPath = QDir::currentPath() + applicationFolderName; + calculateStreamingHash(); } void UpdateController::calculateCommonHash() @@ -69,12 +70,13 @@ void UpdateController::calculateHash(QString path) readSize = qMin(fileSize,bufferSize); } - file.close(); + hashString = QString(hash.result().toHex()); currentFile.path = Tools::createLocalPath(fileInfo.absoluteFilePath()); currentFile.hash = hashString; files->push_back(currentFile); + file.close(); } else if (fileInfo.isDir() && !fileInfo.isRoot() && fileInfo.fileName() != "..") { diff --git a/Core/hashcomparer.cpp b/Core/hashcomparer.cpp index ce1aa79..e7c1469 100644 --- a/Core/hashcomparer.cpp +++ b/Core/hashcomparer.cpp @@ -13,6 +13,7 @@ void HashComparer::CompareDeltas() { QList *serverStreamingHash = new QList; QList *localStreamingHash = new QList; + QList *files = new QList; QFile file(serverHash); file.open(QIODevice::ReadOnly | QIODevice::Text); @@ -30,14 +31,13 @@ void HashComparer::CompareDeltas() for (auto &item:*localStreamingHash) { - if(serverStreamingHash->contains(item)) + if(!serverStreamingHash->contains(item)) { - serverStreamingHash->removeOne(item); - localStreamingHash->removeOne(item); + files->append(item); } } - filesForUpdate = localStreamingHash; + filesForUpdate = files; showDeltas(); } diff --git a/Core/recognizesystem.cpp b/Core/recognizesystem.cpp index cf52102..e12206b 100644 --- a/Core/recognizesystem.cpp +++ b/Core/recognizesystem.cpp @@ -12,6 +12,7 @@ RecognizeSystem::RecognizeSystem(QObject *parent): sizeReceiveData = 0; tmpBlock.clear(); countSend = 0; + folderList = new QList; } RecognizeSystem::~RecognizeSystem() @@ -82,7 +83,6 @@ void RecognizeSystem::recognize(QTcpSocket *socket) if(packetType == PacketType::TYPE_FILE) //загрузка файлов { - //ПОЛУЧЕНИЕ ПУТИ //ПОЛУЧЕНИЕ РАЗМЕРА ФАЙЛА forever @@ -107,7 +107,7 @@ void RecognizeSystem::recognize(QTcpSocket *socket) emit sigSendDebugLog("CLIENT: filesize: " + QString::number(fileSize)); emit sigSendDebugLog("CLIENT: filePath: " + filePath); - emit sigSocketWaitForReadyRead(100); + socket->waitForReadyRead(100); break; } @@ -122,6 +122,7 @@ void RecognizeSystem::recognize(QTcpSocket *socket) { file.remove(); //удаление файла, если он уже есть, но необходимо обновить emit sigSendDebugLog(Tools::getTime() + "Delete exist file: " + filePath); + socket->waitForReadyRead(100); } @@ -191,7 +192,8 @@ void RecognizeSystem::recognize(QTcpSocket *socket) if(fileInfo.exists()) { - if(fileInfo.isFile()){ + if(fileInfo.isFile()) + { QFile file(filePath); file.remove(); } @@ -226,6 +228,10 @@ void RecognizeSystem::recognize(QTcpSocket *socket) stream >> size; stream >> fileCount; + if(!stream.commitTransaction()){ + continue; + } + emit sigNeedUpdate(flag,size,fileCount); packetType = PacketType::TYPE_NONE; } @@ -326,7 +332,6 @@ void RecognizeSystem::checkAccessType(QString type) { if(type == "instructor") { - updateController->calculateStreamingHash(); mainWindow->callUpdateList(); } } diff --git a/Core/recognizesystem.h b/Core/recognizesystem.h index ec595e1..bb63e6e 100644 --- a/Core/recognizesystem.h +++ b/Core/recognizesystem.h @@ -34,6 +34,7 @@ signals: void sigStartCompare(); private: + QList *folderList; MainWindow *mainWindow; UpdateController *updateController; DataParser *dataParser; diff --git a/Core/tcpclient.cpp b/Core/tcpclient.cpp index 65ee5dc..4ead986 100644 --- a/Core/tcpclient.cpp +++ b/Core/tcpclient.cpp @@ -96,7 +96,7 @@ void TCPClient::slotSendCommand(QString command) emit sigSendDebugLog("Update started"); stream << PacketType::TYPE_COMMAND; stream << command; - socket->waitForBytesWritten(); + socket->waitForReadyRead(1000); } else if(command == "run"){ externalExecuter->callApp(); diff --git a/Core/tools.h b/Core/tools.h index b97cf75..d0b3ed2 100644 --- a/Core/tools.h +++ b/Core/tools.h @@ -5,7 +5,7 @@ #include #include -#define TCP_READ_TIMEOUT 1000 +#define TCP_READ_TIMEOUT 2000 static QString applicationEXEName = "RRJ.exe"; static QString applicationFolderName = "/Application"; diff --git a/RRJClient.pro.user b/RRJClient.pro.user index 712ee4d..bb18a6a 100644 --- a/RRJClient.pro.user +++ b/RRJClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/StaticData/clientHash.xml b/StaticData/clientHash.xml index 6fe87cb..c3733ad 100644 --- a/StaticData/clientHash.xml +++ b/StaticData/clientHash.xml @@ -24,69 +24,176 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StaticData/streamingHash.xml b/StaticData/streamingHash.xml index 6bb9b90..808f6e3 100644 --- a/StaticData/streamingHash.xml +++ b/StaticData/streamingHash.xml @@ -5,4 +5,13 @@ + + + + + + + + + diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe index 489b392..43401c8 100644 Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ diff --git a/debug/UpdateController.o b/debug/UpdateController.o index 15ea6f4..f490ffa 100644 Binary files a/debug/UpdateController.o and b/debug/UpdateController.o differ diff --git a/debug/hashcomparer.o b/debug/hashcomparer.o index ed63e73..b02668c 100644 Binary files a/debug/hashcomparer.o and b/debug/hashcomparer.o differ diff --git a/debug/mainwindow.o b/debug/mainwindow.o index 3155f0c..271420a 100644 Binary files a/debug/mainwindow.o and b/debug/mainwindow.o differ diff --git a/debug/moc_recognizesystem.o b/debug/moc_recognizesystem.o index 034f217..4caa809 100644 Binary files a/debug/moc_recognizesystem.o and b/debug/moc_recognizesystem.o differ diff --git a/debug/qrc_resources.cpp b/debug/qrc_resources.cpp index f3efdbc..055036e 100644 --- a/debug/qrc_resources.cpp +++ b/debug/qrc_resources.cpp @@ -10,48 +10,48 @@ static const unsigned char qt_resource_data[] = { // E:/Projects/QT/GUIProj/RRJClient/RRJClient/style.css 0x0,0x0,0x2,0x99, 0x0, - 0x0,0xb,0x56,0x78,0x9c,0xd5,0x56,0x5b,0x6f,0xda,0x30,0x18,0x7d,0x47,0xe2,0x3f, - 0x58,0xe5,0x85,0x4a,0xa1,0x24,0x1,0x5a,0x94,0xbe,0xd1,0x4e,0xbb,0xa8,0x4c,0x43, - 0x45,0xeb,0xb3,0x13,0x9b,0xe4,0x13,0xc6,0x46,0xb6,0x23,0x40,0xd3,0xfe,0xfb,0x4c, - 0x12,0x32,0x72,0x81,0x86,0x8e,0x97,0x11,0x89,0x44,0x89,0x7d,0xce,0xf9,0xee,0x6e, - 0xb7,0x66,0x53,0xc,0xfc,0xd,0x38,0x11,0x9b,0x76,0xeb,0x57,0xbb,0x85,0xcc,0xcf, - 0xc7,0xc1,0x32,0x94,0x22,0xe6,0xa4,0x7,0x2b,0x1c,0x52,0xf,0xc5,0x92,0x75,0xbd, - 0xbe,0xa4,0x4a,0xc4,0x32,0xa0,0xfd,0xd7,0xd7,0x6f,0x3d,0xc7,0xb6,0x9f,0xb1,0x5c, - 0xde,0xad,0x79,0x78,0xfb,0x58,0xd9,0xb7,0x16,0xa,0x34,0x8,0xee,0xa1,0x80,0x72, - 0x4d,0xa5,0x59,0xf1,0xbb,0xdd,0x6a,0xb7,0x66,0x4f,0x62,0xe5,0x8b,0x89,0xd8,0xd6, - 0x91,0x5,0x82,0x9,0xe9,0x21,0x19,0xfa,0x5d,0xd7,0x1e,0x58,0xae,0x3b,0xb6,0xdc, - 0xd1,0x28,0x47,0x17,0x92,0x50,0xd9,0x53,0x7a,0xc7,0x8c,0x22,0x11,0x6b,0x45,0x75, - 0xf1,0x93,0xc4,0x4,0x62,0xe5,0xa1,0xc1,0x7a,0x9b,0x7d,0x58,0x8,0xae,0x7b,0xb, - 0xbc,0x2,0xb6,0xf3,0xd0,0xcd,0x13,0x66,0xe0,0x4b,0xb8,0x39,0xfa,0xe8,0x21,0xe7, - 0x3e,0x5f,0x7d,0xc4,0x3f,0x1c,0x59,0xe3,0xa1,0xe5,0xc,0xec,0xdb,0x5c,0xf9,0x8f, - 0x58,0x45,0x93,0x58,0x6b,0xc1,0xff,0x67,0xed,0x1e,0x1,0x85,0x7d,0x46,0xc9,0x19, - 0x23,0x18,0x84,0x91,0xfe,0x2c,0xf1,0xae,0x88,0x1d,0x9a,0x37,0x7,0xc0,0x29,0x55, - 0xca,0x64,0xc6,0xf9,0x40,0x6e,0x22,0xd0,0xf4,0xb1,0xba,0x5,0xcd,0x5e,0xb0,0x4f, - 0x59,0xbe,0xb3,0x81,0xa5,0xae,0x5d,0xb6,0xd4,0x67,0x86,0xaf,0x16,0xbc,0x2e,0x50, - 0x45,0x27,0xbb,0x39,0xd8,0x1a,0x13,0x2,0x3c,0xf4,0x90,0x7d,0xe7,0xd2,0x55,0xfe, - 0x3f,0x38,0x3c,0x67,0xcb,0x56,0xc0,0x7b,0x1b,0x20,0x3a,0xf2,0xd0,0x43,0xaa,0x24, - 0xa5,0x7d,0x1,0x4e,0x3f,0x11,0xd0,0x65,0xa2,0xc6,0x81,0xce,0xc2,0x23,0x45,0x68, - 0x8a,0x4b,0x4d,0xb0,0x2c,0x21,0x25,0x5a,0x91,0x12,0xc,0x48,0x35,0xb6,0x35,0xa8, - 0xa3,0x53,0x6e,0x6a,0x9a,0x51,0x6,0xc0,0x60,0x32,0x92,0xbd,0xd5,0x74,0xab,0x7b, - 0x66,0x61,0x58,0xa9,0xe4,0xa2,0x6c,0xcf,0xb,0xa2,0x98,0x2f,0x4f,0x39,0xfc,0xaf, - 0xac,0x46,0x25,0x93,0xb5,0x8a,0x88,0x6,0xcb,0xe3,0xc,0x3b,0xd6,0x7f,0x42,0xfe, - 0xb8,0x6c,0x7f,0x31,0x7,0xdf,0x80,0x84,0x54,0x77,0x20,0x10,0x3c,0x7d,0x2c,0xb, - 0xae,0xef,0x77,0x5f,0xcd,0x7a,0xd5,0x5f,0x33,0xcc,0x69,0xd2,0xef,0x90,0x9d,0x5d, - 0x4a,0x4b,0xaa,0x83,0xe8,0x70,0x3f,0x24,0xd5,0xa9,0xe6,0x77,0x85,0xb4,0x2f,0xda, - 0x93,0x0,0x76,0x80,0x33,0x93,0x87,0x73,0x13,0xaa,0x67,0xea,0xc7,0xe1,0x25,0x4, - 0x99,0xc3,0xa,0xde,0x89,0x28,0x36,0xae,0x28,0xfb,0xa7,0x1c,0xb7,0x2b,0x75,0xba, - 0x2,0x73,0xbc,0x26,0x58,0xd3,0xf7,0x98,0xf7,0x19,0x83,0x8f,0xb9,0x3f,0xc6,0xef, - 0xd8,0x15,0x1,0xe8,0xe3,0xa,0xec,0x72,0x45,0x5e,0x43,0xc1,0x55,0x1a,0x65,0xfd, - 0x48,0x98,0xee,0xcc,0xd0,0xff,0x92,0x44,0x3a,0xb,0xf8,0xc5,0x54,0xd5,0x62,0x3b, - 0x31,0x7d,0xd2,0x2c,0x35,0xd5,0x13,0xc6,0xa6,0xba,0xe6,0xa0,0x19,0x6d,0xc6,0x73, - 0x26,0xe7,0xbf,0xb,0xd,0xb,0x8,0xf0,0xbe,0xce,0x2e,0x50,0x5e,0x3b,0x3c,0x52, - 0x44,0x7e,0x16,0x31,0xf7,0x6c,0xba,0x65,0x2e,0x4,0x4b,0x67,0x4c,0xc7,0xc,0x54, - 0xd3,0x19,0x76,0x3f,0x81,0x6e,0x2a,0xcd,0x7b,0xf8,0x4f,0xcd,0xbb,0x7e,0xcf,0x3b, - 0x63,0xb6,0x5e,0x99,0x69,0xcf,0xa6,0x99,0x9e,0x9d,0xfa,0x7b,0x36,0x67,0xe4,0x58, - 0xce,0xc3,0xbd,0x49,0x67,0x27,0xf,0xdf,0x69,0xcc,0x6,0x47,0x89,0x1a,0xd0,0x33, - 0xf6,0x25,0x8c,0x47,0xf3,0xbb,0x93,0xa9,0x4e,0xc2,0xd1,0xe4,0xec,0x85,0xbb,0xb6, - 0x95,0x5c,0x75,0x47,0x9f,0x8e,0xe9,0x92,0xcb,0x8b,0x51,0x1a,0xa6,0x94,0xcf,0xe2, - 0x3c,0x6,0x7f,0x0,0xd4,0x31,0x46,0xce, + 0x0,0xb,0x22,0x78,0x9c,0xd5,0x56,0x5b,0x6f,0xda,0x30,0x14,0x7e,0x47,0xe2,0x3f, + 0x58,0xe5,0x85,0x4a,0x50,0x92,0x0,0x2d,0x4a,0xdf,0x68,0xa7,0x5d,0x54,0xa6,0xa1, + 0xa2,0xf5,0xd9,0x89,0x4d,0x72,0x84,0xb1,0x91,0xed,0x8,0xd0,0xb4,0xff,0x3e,0x93, + 0x84,0x8c,0xdc,0x68,0xe8,0x78,0x19,0x91,0x48,0x94,0xd8,0xdf,0xf9,0xce,0xf9,0xce, + 0xc5,0xed,0xd6,0x7c,0x86,0x81,0xbf,0x1,0x27,0x62,0xdb,0x6e,0xfd,0x6a,0xb7,0x90, + 0xf9,0x79,0xd8,0x5f,0x5,0x52,0x44,0x9c,0xf4,0x61,0x8d,0x3,0xea,0xa2,0x48,0xb2, + 0xae,0x3b,0x90,0x54,0x89,0x48,0xfa,0x74,0xf0,0xfa,0xfa,0xad,0x6f,0x5b,0xd6,0x33, + 0x96,0xab,0xbb,0xd,0xf,0x6e,0x1f,0x4b,0xfb,0x36,0x42,0x81,0x6,0xc1,0x5d,0xe4, + 0x53,0xae,0xa9,0x34,0x2b,0x7e,0xb7,0x5b,0xed,0xd6,0xfc,0x49,0xac,0x3d,0x31,0x15, + 0xbb,0x2a,0x63,0xbe,0x60,0x42,0xba,0x48,0x6,0x5e,0xd7,0xb1,0x86,0x3d,0xc7,0x99, + 0xf4,0x9c,0xf1,0x38,0x43,0x17,0x92,0x50,0xd9,0x57,0x7a,0xcf,0xc,0x23,0x11,0x69, + 0x45,0x75,0xfe,0x93,0xc4,0x4,0x22,0xe5,0xa2,0xe1,0x66,0x97,0x7e,0x58,0xa,0xae, + 0xfb,0x4b,0xbc,0x6,0xb6,0x77,0xd1,0xcd,0x13,0x66,0xe0,0x49,0xb8,0x39,0xf9,0xe8, + 0x22,0xfb,0x3e,0x5b,0x7d,0x62,0x7f,0x34,0xee,0x4d,0x46,0x3d,0x7b,0x68,0xdd,0x66, + 0xcc,0x7f,0x44,0x2a,0x9c,0x46,0x5a,0xb,0xfe,0x3f,0x73,0x77,0x9,0x28,0xec,0x31, + 0x4a,0xce,0x38,0xc1,0x20,0x8,0xf5,0x67,0x89,0xf7,0x79,0xec,0xc0,0xbc,0x39,0x2, + 0xce,0xa8,0x52,0x26,0x33,0xce,0xb,0xb9,0xd,0x41,0xd3,0xc7,0xf2,0x16,0x34,0x7f, + 0xc1,0x1e,0x65,0xd9,0xce,0x6,0x9e,0x3a,0x56,0xd1,0x53,0x8f,0x19,0x7b,0x95,0xe0, + 0x55,0x42,0xe5,0x83,0xec,0x64,0x60,0x1b,0x4c,0x8,0xf0,0xc0,0x45,0xd6,0x9d,0x43, + 0xd7,0xd9,0xff,0xf0,0xf8,0x9c,0x2e,0x5b,0x3,0xef,0x6f,0x81,0xe8,0xd0,0x45,0xf, + 0x9,0x93,0xc4,0xec,0xb,0x70,0xfa,0x89,0x80,0x2e,0x1a,0x6a,0x2c,0x74,0x2a,0x8f, + 0x14,0x81,0x29,0x2e,0x35,0xc5,0xb2,0x80,0x14,0x73,0x45,0x4a,0x30,0x20,0x65,0x6d, + 0x2b,0x50,0xc7,0x75,0x61,0x6a,0x9a,0x51,0x6,0xc0,0x60,0x32,0x92,0xbe,0xd5,0x74, + 0xa7,0xfb,0x66,0x61,0x50,0xaa,0xe4,0x3c,0x6d,0xd7,0xf5,0xc3,0x88,0xaf,0xea,0x2, + 0xfe,0x97,0x56,0xa3,0x92,0x49,0x5b,0x45,0x48,0xfd,0xd5,0x69,0x86,0x9d,0xf2,0xaf, + 0xa1,0x3f,0x29,0xfa,0x9f,0xcf,0xc1,0x37,0x20,0x1,0xd5,0x1d,0xf0,0x5,0x4f,0x1e, + 0x8b,0x84,0xab,0xfb,0xdd,0x57,0xb3,0x5e,0xd,0x36,0xc,0x73,0x1a,0xf7,0x3b,0x64, + 0xa5,0x97,0xd2,0x92,0x6a,0x3f,0x3c,0xde,0x8f,0x49,0x55,0xd7,0xfc,0xae,0x90,0xf6, + 0x79,0x7f,0x62,0xc0,0xe,0x70,0x66,0xf2,0x70,0x61,0xa4,0x7a,0xa6,0x5e,0x14,0x5c, + 0x62,0x20,0xd,0x58,0x2e,0x3a,0x21,0xc5,0x26,0x14,0xc5,0xf8,0x14,0x75,0xab,0x95, + 0x2d,0x45,0x89,0x36,0x4,0x6b,0xfa,0x1e,0xca,0x41,0x7d,0x7c,0x8a,0xf3,0xb1,0xae, + 0x69,0x5b,0x25,0x37,0xd0,0xc7,0x19,0x58,0xc5,0xea,0xba,0x6,0x83,0xab,0x34,0xbd, + 0xea,0xf6,0x3e,0xdb,0x9b,0x1,0xfe,0x25,0x56,0x2d,0x15,0xef,0x62,0x53,0xe5,0xc2, + 0xa9,0x99,0x24,0x49,0xc6,0x99,0x4a,0x8,0x22,0x53,0x29,0xb,0xd0,0x8c,0x36,0xb3, + 0x73,0x26,0x7f,0xbf,0xb,0xd,0x4b,0xf0,0xf1,0xa1,0x66,0x2e,0x60,0x5e,0x39,0x8, + 0x12,0x44,0x7e,0x16,0x31,0x8b,0x6c,0xb2,0x65,0x21,0x4,0x4b,0xe6,0x45,0xc7,0xc, + 0x47,0x53,0xe5,0xfb,0x9f,0x40,0xb7,0xa5,0x46,0x3c,0xfa,0xa7,0x46,0x5c,0xbd,0xe7, + 0x9d,0x91,0x59,0xcd,0xcc,0xb4,0x5a,0xd3,0x18,0xcf,0x4e,0xf0,0x83,0x35,0x7b,0x6c, + 0xf7,0xec,0x87,0x7b,0x93,0xce,0x76,0x26,0x5f,0x3d,0x66,0x83,0x63,0x41,0x5,0xe8, + 0x19,0xff,0x62,0x8b,0x27,0xb3,0xb8,0x93,0xb2,0x8e,0xe5,0x68,0x72,0x8e,0xc2,0x5d, + 0xab,0x17,0x5f,0x55,0xc7,0x98,0x8e,0xe9,0x78,0xab,0x8b,0x51,0x1a,0xa6,0x94,0xc7, + 0xa2,0x4c,0x83,0x3f,0xae,0x6e,0x36,0xa8, // E:/Projects/QT/GUIProj/RRJClient/RRJClient/resource/SSJ-100.png 0x0,0xc,0x7c,0xaa, 0x89, @@ -131984,7 +131984,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,0x92,0x56,0x7e,0x8f,0xe2, +0x0,0x0,0x1,0x92,0x56,0xb1,0xc1,0x4, // :/resource 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x3, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, diff --git a/debug/qrc_resources.o b/debug/qrc_resources.o index 4f9abcb..4a80fb5 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 bba1982..2bc6e3a 100644 Binary files a/debug/recognizesystem.o and b/debug/recognizesystem.o differ diff --git a/debug/tcpclient.o b/debug/tcpclient.o index 42172ad..3e4b3d5 100644 Binary files a/debug/tcpclient.o and b/debug/tcpclient.o differ diff --git a/mainwindow.cpp b/mainwindow.cpp index 1743d1e..79bc160 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -50,7 +50,6 @@ void MainWindow::initialize() emit sigInitializeClient(recognizeSystem,externalExecuter,sendSystem,connectionThread); recognizeSystem->initialize(updateController,dataParser,this); - screenChecker->check(); loadStaticData(); @@ -102,7 +101,7 @@ void MainWindow::bindConnection() connect(recognizeSystem,&RecognizeSystem::sigNeedUpdate,this,&MainWindow::setNeedUpdate); connect(recognizeSystem,&RecognizeSystem::sigSocketDisabled,this,&MainWindow::lostConnection); connect(recognizeSystem,&RecognizeSystem::sigSaveLoginData,this,&MainWindow::checkLoginResult); - connect(recognizeSystem,&RecognizeSystem::sigSocketWaitForReadyRead,client,&TCPClient::waitRead,Qt::AutoConnection); + connect(recognizeSystem,&RecognizeSystem::sigSocketWaitForReadyRead,client,&TCPClient::waitRead,Qt::DirectConnection); connect(recognizeSystem,&RecognizeSystem::sigServerBlocked,this,&MainWindow::serverBlocked); connect(updateController,&UpdateController::sigUpdateComplete,this,&MainWindow::showCompleteDialogBox); @@ -165,6 +164,9 @@ void MainWindow::setNeedUpdate(bool flag,quint64 size, quint64 fileCount) QString result = tr("Доступно обновление: ") + Tools::convertFileSize(size); result += tr("Количество файлов: ") + QString::number(fileCount); ui->inlineTextDebug->setText(result); + ui->startButton->show(); + ui->updateButton->setEnabled(flag); + ui->startButton->setEnabled(true); ui->updateButton->show(); ui->autostartCheckBox->show(); stopLoadingMovie(); @@ -178,9 +180,6 @@ void MainWindow::setNeedUpdate(bool flag,quint64 size, quint64 fileCount) ui->offlineStartButton->setEnabled(true); stopLoadingMovie(); } - - ui->updateButton->setEnabled(flag); - ui->startButton->setEnabled(!flag); } void MainWindow::lostConnection() @@ -336,7 +335,6 @@ void MainWindow::slotDisableNotify() void MainWindow::callUpdateList() { - updateController->calculateStreamingHash(); hashComparer->setWidget(updateWidget); QByteArray answer = dataParser->xmlAnswer_notify("GETSERVERDATALIST"); @@ -375,6 +373,7 @@ void MainWindow::on_updateButton_clicked() emit sigSendCommand("update"); ui->updateButton->hide(); + ui->startButton->hide(); ui->loadingProgressBar->setValue(0); ui->loadingProgressBar->show(); } @@ -510,7 +509,7 @@ void MainWindow::showUpdateInfo() ui->updateWidget->show(); ui->updateButtonGroup_2->show(); - ui->offlineStartButton->setGeometry(570,552,250,35); + ui->offlineStartButton->setGeometry(540,552,250,35); fileCountForUpdate = hashComparer->getFilesForUpdate()->length(); filesLoaded = 0; diff --git a/mainwindow.ui b/mainwindow.ui index a16a80a..fbcaed3 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -49,7 +49,7 @@ 0 541 - 550 + 540 50 @@ -73,7 +73,7 @@ - 1 + 10 @@ -923,9 +923,9 @@ - 10 + 0 541 - 551 + 540 50 @@ -1104,8 +1104,8 @@ false - mainFrame downLayout + mainFrame horizontalWidget notificationLabel debugWidget diff --git a/style.css b/style.css index 73e340a..cc85b48 100644 --- a/style.css +++ b/style.css @@ -102,8 +102,6 @@ QLabel#inlineTextDebug QWidget#headerWidget { background-color:rgb(203,228,255); - border-style: outset; - border-radius: 3px; } QWidget#updateWidget diff --git a/ui_mainwindow.h b/ui_mainwindow.h index e031117..9a37710 100644 --- a/ui_mainwindow.h +++ b/ui_mainwindow.h @@ -107,13 +107,13 @@ public: centralwidget->setMaximumSize(QSize(800, 600)); downLayout = new QWidget(centralwidget); downLayout->setObjectName(QString::fromUtf8("downLayout")); - downLayout->setGeometry(QRect(0, 541, 550, 50)); + downLayout->setGeometry(QRect(0, 541, 540, 50)); sizePolicy.setHeightForWidth(downLayout->sizePolicy().hasHeightForWidth()); downLayout->setSizePolicy(sizePolicy); downLayout->setMinimumSize(QSize(0, 40)); downLayout->setMaximumSize(QSize(16777215, 60)); downlayout = new QHBoxLayout(downLayout); - downlayout->setSpacing(1); + downlayout->setSpacing(10); downlayout->setObjectName(QString::fromUtf8("downlayout")); loadingProgressBar = new QProgressBar(downLayout); loadingProgressBar->setObjectName(QString::fromUtf8("loadingProgressBar")); @@ -460,7 +460,7 @@ public: updateButtonGroup_2 = new QWidget(centralwidget); updateButtonGroup_2->setObjectName(QString::fromUtf8("updateButtonGroup_2")); - updateButtonGroup_2->setGeometry(QRect(10, 541, 551, 50)); + updateButtonGroup_2->setGeometry(QRect(0, 541, 540, 50)); updateButtonGroup = new QHBoxLayout(updateButtonGroup_2); updateButtonGroup->setObjectName(QString::fromUtf8("updateButtonGroup")); loadToServerButton = new QPushButton(updateButtonGroup_2); @@ -524,8 +524,8 @@ public: offlineStartButton->setCheckable(false); offlineStartButton->setChecked(false); MainWindow->setCentralWidget(centralwidget); - mainFrame->raise(); downLayout->raise(); + mainFrame->raise(); horizontalWidget->raise(); notificationLabel->raise(); debugWidget->raise();