diff --git a/Core/UpdateController.cpp b/Core/UpdateController.cpp index b6d1e98..d248406 100644 --- a/Core/UpdateController.cpp +++ b/Core/UpdateController.cpp @@ -20,7 +20,7 @@ void UpdateController::calculateCommonHash() appDataList = calculateHash(applicationFolderPath,"StreamingAssets"); calculateStreamingHash(); appDataList.append(streamingDataList); - dataParser->createFileDataList(appDataList,hashFilename); + dataParser->createFileDataList(appDataList,QDir::currentPath() + hashFilename); qDebug() << "UpdateController threadID " << QThread::currentThreadId(); } @@ -29,7 +29,7 @@ void UpdateController::calculateStreamingHash() streamingDataList.clear(); streamingDataList = calculateHash(QDir::currentPath() + streamingAssetsPath,""); std::sort(streamingDataList.begin(),streamingDataList.end()); - dataParser->createFileDataList(streamingDataList,streamingHashFilename); + dataParser->createFileDataList(streamingDataList,QDir::currentPath() + streamingHashFilename); } void UpdateController::setServerVersion(StreamingVersionData *version) diff --git a/Core/dataparser.cpp b/Core/dataparser.cpp index ce7045e..b1f8c92 100644 --- a/Core/dataparser.cpp +++ b/Core/dataparser.cpp @@ -421,6 +421,39 @@ void DataParser::xmlParser(QByteArray array) recognizeSystem->setServerVersion(serverVersion); } + if(xmlReader.name() == "VersionList") + { + QList *serverStreamingVersionDataList = new QList; + 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)); + } + + serverStreamingVersionDataList->append(data); + } + } + + xmlReader.readNext(); + } + recognizeSystem->showServerDataList(serverStreamingVersionDataList); + } + xmlReader.readNext(); } } diff --git a/Core/recognizesystem.cpp b/Core/recognizesystem.cpp index a76e908..75b5812 100644 --- a/Core/recognizesystem.cpp +++ b/Core/recognizesystem.cpp @@ -41,6 +41,7 @@ void RecognizeSystem::initialize(UpdateController *updateController, connect(this,&RecognizeSystem::sigSaveLoginData,mainWindow,&MainWindow::checkLoginResult); //TODO: прибратся! 2 бинда на 1 сигнал connect(this,&RecognizeSystem::sigSocketWaitForReadyRead,client,&TCPClient::waitRead,Qt::DirectConnection); connect(this,&RecognizeSystem::sigServerBlocked,mainWindow,&MainWindow::serverBlocked); + connect(this,&RecognizeSystem::sigShowServerList,mainWindow,&MainWindow::showServerListWidget); } void RecognizeSystem::recognize(QTcpSocket *socket) @@ -280,4 +281,10 @@ void RecognizeSystem::checkAccessType(QString type) void RecognizeSystem::setServerVersion(StreamingVersionData *serverVersion) { updateController->setServerVersion(serverVersion); + mainWindow->setCurrentVersionName(serverVersion->getViewName()); +} + +void RecognizeSystem::showServerDataList(QList *showServerDataList) +{ + emit sigShowServerList(showServerDataList); } diff --git a/Core/recognizesystem.h b/Core/recognizesystem.h index 6d0ac42..471717c 100644 --- a/Core/recognizesystem.h +++ b/Core/recognizesystem.h @@ -31,6 +31,7 @@ public: void recognize(QTcpSocket *socket); void checkAccessType(QString type); void setServerVersion(StreamingVersionData *serverVersion); + void showServerDataList(QList *showServerDataList); signals: void sigUpdateBytesAvailable(); @@ -42,6 +43,7 @@ signals: void sigSaveLoginData(ServerAuthorization *serverAuth); void sigSocketWaitForReadyRead(int waitTime); void sigStartCompare(); + void sigShowServerList(QList *serverDatas); private: QList *folderList; diff --git a/Core/sendsystem.cpp b/Core/sendsystem.cpp index 637f5de..a9c2b54 100644 --- a/Core/sendsystem.cpp +++ b/Core/sendsystem.cpp @@ -33,6 +33,8 @@ void SendSystem::xmlAnswer(QString message) stream << PacketType::TYPE_XMLANSWER; stream << data; + + qDebug() << "Send answer " + message; socket->waitForBytesWritten(); } @@ -50,6 +52,7 @@ void SendSystem::sendClientAutorization() stream << array; socket->waitForBytesWritten(); + qDebug() << "Send client auth"; file.close(); } @@ -122,6 +125,8 @@ void SendSystem::sendXMLAnswer(QByteArray array) socket->waitForBytesWritten(); socket->waitForReadyRead(100); + + qDebug() << "Send XML answer in byte"; } void SendSystem::sendFinish() diff --git a/Core/tools.cpp b/Core/tools.cpp index dcac90d..285c088 100644 --- a/Core/tools.cpp +++ b/Core/tools.cpp @@ -43,6 +43,7 @@ QString Tools::createReceiveFullPath(QString path, StreamingVersionData *version //StreamingAssets section localPath = path.remove(0,pos + version->getViewName().length()); localPath.prepend(streamingAssetsPath); + fullPath = QDir::currentPath() + localPath; } } else diff --git a/Makefile.Debug b/Makefile.Debug index ccbffda..61dde3c 100644 --- a/Makefile.Debug +++ b/Makefile.Debug @@ -3016,6 +3016,9 @@ debug/moc_versionselectwidget.cpp: versionselectwidget.h \ E:/QT/5.14.2/mingw73_64/include/QtCore/qfiledevice.h \ E:/QT/5.14.2/mingw73_64/include/QtGui/qvector2d.h \ E:/QT/5.14.2/mingw73_64/include/QtGui/qtouchdevice.h \ + Core/streamingversiondata.h \ + E:/QT/5.14.2/mingw73_64/include/QtCore/QObject \ + E:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ debug/moc_predefs.h \ E:/QT/5.14.2/mingw73_64/bin/moc.exe E:\QT\5.14.2\mingw73_64\bin\moc.exe $(DEFINES) --include D:/QT/Projects/RRJClient/debug/moc_predefs.h -IE:/QT/5.14.2/mingw73_64/mkspecs/win32-g++ -ID:/QT/Projects/RRJClient -IE:/QT/5.14.2/mingw73_64/include -IE:/QT/5.14.2/mingw73_64/include/QtWidgets -IE:/QT/5.14.2/mingw73_64/include/QtGui -IE:/QT/5.14.2/mingw73_64/include/QtANGLE -IE:/QT/5.14.2/mingw73_64/include/QtNetwork -IE:/QT/5.14.2/mingw73_64/include/QtCore -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -ID:/QT/Tools/mingw730_32/i686-w64-mingw32/include versionselectwidget.h -o debug\moc_versionselectwidget.cpp @@ -6244,6 +6247,9 @@ debug/versionselectwidget.o: versionselectwidget.cpp versionselectwidget.h \ E:/QT/5.14.2/mingw73_64/include/QtCore/qfiledevice.h \ E:/QT/5.14.2/mingw73_64/include/QtGui/qvector2d.h \ E:/QT/5.14.2/mingw73_64/include/QtGui/qtouchdevice.h \ + Core/streamingversiondata.h \ + E:/QT/5.14.2/mingw73_64/include/QtCore/QObject \ + E:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ ui_versionselectwidget.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug\versionselectwidget.o versionselectwidget.cpp diff --git a/Makefile.Release b/Makefile.Release index ab58cfb..40d20da 100644 --- a/Makefile.Release +++ b/Makefile.Release @@ -3016,6 +3016,9 @@ release/moc_versionselectwidget.cpp: versionselectwidget.h \ E:/QT/5.14.2/mingw73_64/include/QtCore/qfiledevice.h \ E:/QT/5.14.2/mingw73_64/include/QtGui/qvector2d.h \ E:/QT/5.14.2/mingw73_64/include/QtGui/qtouchdevice.h \ + Core/streamingversiondata.h \ + E:/QT/5.14.2/mingw73_64/include/QtCore/QObject \ + E:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ release/moc_predefs.h \ E:/QT/5.14.2/mingw73_64/bin/moc.exe E:\QT\5.14.2\mingw73_64\bin\moc.exe $(DEFINES) --include D:/QT/Projects/RRJClient/release/moc_predefs.h -IE:/QT/5.14.2/mingw73_64/mkspecs/win32-g++ -ID:/QT/Projects/RRJClient -IE:/QT/5.14.2/mingw73_64/include -IE:/QT/5.14.2/mingw73_64/include/QtWidgets -IE:/QT/5.14.2/mingw73_64/include/QtGui -IE:/QT/5.14.2/mingw73_64/include/QtANGLE -IE:/QT/5.14.2/mingw73_64/include/QtNetwork -IE:/QT/5.14.2/mingw73_64/include/QtCore -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++ -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/i686-w64-mingw32 -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/backward -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include -ID:/QT/Tools/mingw730_32/lib/gcc/i686-w64-mingw32/7.3.0/include-fixed -ID:/QT/Tools/mingw730_32/i686-w64-mingw32/include versionselectwidget.h -o release\moc_versionselectwidget.cpp @@ -6244,6 +6247,9 @@ release/versionselectwidget.o: versionselectwidget.cpp versionselectwidget.h \ E:/QT/5.14.2/mingw73_64/include/QtCore/qfiledevice.h \ E:/QT/5.14.2/mingw73_64/include/QtGui/qvector2d.h \ E:/QT/5.14.2/mingw73_64/include/QtGui/qtouchdevice.h \ + Core/streamingversiondata.h \ + E:/QT/5.14.2/mingw73_64/include/QtCore/QObject \ + E:/QT/5.14.2/mingw73_64/include/QtCore/qdatetime.h \ ui_versionselectwidget.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release\versionselectwidget.o versionselectwidget.cpp diff --git a/RRJClient.pro.user b/RRJClient.pro.user index b746d78..9ad6033 100644 --- a/RRJClient.pro.user +++ b/RRJClient.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/debug/RRJClient.exe b/debug/RRJClient.exe index 04bacaf..75fe35a 100644 Binary files a/debug/RRJClient.exe and b/debug/RRJClient.exe differ diff --git a/debug/dataparser.o b/debug/dataparser.o index d67b6ed..a15b5ce 100644 Binary files a/debug/dataparser.o and b/debug/dataparser.o differ diff --git a/debug/mainwindow.o b/debug/mainwindow.o index 58e00e1..303cac1 100644 Binary files a/debug/mainwindow.o and b/debug/mainwindow.o differ diff --git a/debug/moc_mainwindow.cpp b/debug/moc_mainwindow.cpp index ce596bf..9fa966a 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[58]; - char stringdata0[871]; + QByteArrayData data[61]; + char stringdata0[933]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -83,14 +83,17 @@ QT_MOC_LITERAL(46, 657, 10), // "serverAuth" QT_MOC_LITERAL(47, 668, 13), // "setNeedUpdate" QT_MOC_LITERAL(48, 682, 4), // "size" QT_MOC_LITERAL(49, 687, 9), // "fileCount" -QT_MOC_LITERAL(50, 697, 25), // "on_settingsButton_clicked" -QT_MOC_LITERAL(51, 723, 29), // "on_languageComboBox_activated" -QT_MOC_LITERAL(52, 753, 4), // "arg1" -QT_MOC_LITERAL(53, 758, 17), // "slotDisableNotify" -QT_MOC_LITERAL(54, 776, 37), // "on_updateListGuideLabel_linkA..." -QT_MOC_LITERAL(55, 814, 4), // "link" -QT_MOC_LITERAL(56, 819, 21), // "on_exitButton_clicked" -QT_MOC_LITERAL(57, 841, 29) // "on_offlineStartButton_clicked" +QT_MOC_LITERAL(50, 697, 20), // "showServerListWidget" +QT_MOC_LITERAL(51, 718, 29), // "QList*" +QT_MOC_LITERAL(52, 748, 10), // "serverData" +QT_MOC_LITERAL(53, 759, 25), // "on_settingsButton_clicked" +QT_MOC_LITERAL(54, 785, 29), // "on_languageComboBox_activated" +QT_MOC_LITERAL(55, 815, 4), // "arg1" +QT_MOC_LITERAL(56, 820, 17), // "slotDisableNotify" +QT_MOC_LITERAL(57, 838, 37), // "on_updateListGuideLabel_linkA..." +QT_MOC_LITERAL(58, 876, 4), // "link" +QT_MOC_LITERAL(59, 881, 21), // "on_exitButton_clicked" +QT_MOC_LITERAL(60, 903, 29) // "on_offlineStartButton_clicked" }, "MainWindow\0sigInitializeClient\0\0" @@ -113,7 +116,8 @@ QT_MOC_LITERAL(57, 841, 29) // "on_offlineStartButton_clicked" "serverBlocked\0checkLoginResult\0" "ServerAuthorization*\0serverAuth\0" "setNeedUpdate\0size\0fileCount\0" - "on_settingsButton_clicked\0" + "showServerListWidget\0QList*\0" + "serverData\0on_settingsButton_clicked\0" "on_languageComboBox_activated\0arg1\0" "slotDisableNotify\0" "on_updateListGuideLabel_linkActivated\0" @@ -128,7 +132,7 @@ static const uint qt_meta_data_MainWindow[] = { 8, // revision 0, // classname 0, 0, // classinfo - 25, 14, // methods + 26, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors @@ -136,33 +140,34 @@ static const uint qt_meta_data_MainWindow[] = { 9, // signalCount // signals: name, argc, parameters, tag, flags - 1, 5, 139, 2, 0x06 /* Public */, - 13, 5, 150, 2, 0x06 /* Public */, - 22, 1, 161, 2, 0x06 /* Public */, - 24, 1, 164, 2, 0x06 /* Public */, - 26, 1, 167, 2, 0x06 /* Public */, - 29, 2, 170, 2, 0x06 /* Public */, - 32, 0, 175, 2, 0x06 /* Public */, - 33, 0, 176, 2, 0x06 /* Public */, - 34, 0, 177, 2, 0x06 /* Public */, + 1, 5, 144, 2, 0x06 /* Public */, + 13, 5, 155, 2, 0x06 /* Public */, + 22, 1, 166, 2, 0x06 /* Public */, + 24, 1, 169, 2, 0x06 /* Public */, + 26, 1, 172, 2, 0x06 /* Public */, + 29, 2, 175, 2, 0x06 /* Public */, + 32, 0, 180, 2, 0x06 /* Public */, + 33, 0, 181, 2, 0x06 /* Public */, + 34, 0, 182, 2, 0x06 /* Public */, // slots: name, argc, parameters, tag, flags - 35, 0, 178, 2, 0x0a /* Public */, - 36, 0, 179, 2, 0x0a /* Public */, - 37, 1, 180, 2, 0x0a /* Public */, - 39, 0, 183, 2, 0x0a /* Public */, - 40, 0, 184, 2, 0x0a /* Public */, - 41, 0, 185, 2, 0x0a /* Public */, - 42, 0, 186, 2, 0x0a /* Public */, - 43, 0, 187, 2, 0x0a /* Public */, - 44, 1, 188, 2, 0x0a /* Public */, - 47, 3, 191, 2, 0x0a /* Public */, - 50, 0, 198, 2, 0x08 /* Private */, - 51, 1, 199, 2, 0x08 /* Private */, - 53, 0, 202, 2, 0x08 /* Private */, - 54, 1, 203, 2, 0x08 /* Private */, - 56, 0, 206, 2, 0x08 /* Private */, - 57, 0, 207, 2, 0x08 /* Private */, + 35, 0, 183, 2, 0x0a /* Public */, + 36, 0, 184, 2, 0x0a /* Public */, + 37, 1, 185, 2, 0x0a /* Public */, + 39, 0, 188, 2, 0x0a /* Public */, + 40, 0, 189, 2, 0x0a /* Public */, + 41, 0, 190, 2, 0x0a /* Public */, + 42, 0, 191, 2, 0x0a /* Public */, + 43, 0, 192, 2, 0x0a /* Public */, + 44, 1, 193, 2, 0x0a /* Public */, + 47, 3, 196, 2, 0x0a /* Public */, + 50, 1, 203, 2, 0x0a /* Public */, + 53, 0, 206, 2, 0x08 /* Private */, + 54, 1, 207, 2, 0x08 /* Private */, + 56, 0, 210, 2, 0x08 /* Private */, + 57, 1, 211, 2, 0x08 /* Private */, + 59, 0, 214, 2, 0x08 /* Private */, + 60, 0, 215, 2, 0x08 /* Private */, // signals: parameters QMetaType::Void, 0x80000000 | 3, 0x80000000 | 5, 0x80000000 | 7, 0x80000000 | 9, 0x80000000 | 11, 4, 6, 8, 10, 12, @@ -186,11 +191,12 @@ static const uint qt_meta_data_MainWindow[] = { QMetaType::Void, QMetaType::Void, 0x80000000 | 45, 46, QMetaType::Void, QMetaType::Bool, QMetaType::ULongLong, QMetaType::ULongLong, 38, 48, 49, - QMetaType::Void, - QMetaType::Void, QMetaType::QString, 52, + QMetaType::Void, 0x80000000 | 51, 52, QMetaType::Void, QMetaType::Void, QMetaType::QString, 55, QMetaType::Void, + QMetaType::Void, QMetaType::QString, 58, + QMetaType::Void, QMetaType::Void, 0 // eod @@ -222,12 +228,13 @@ void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, case 16: _t->serverBlocked(); break; case 17: _t->checkLoginResult((*reinterpret_cast< ServerAuthorization*(*)>(_a[1]))); break; case 18: _t->setNeedUpdate((*reinterpret_cast< bool(*)>(_a[1])),(*reinterpret_cast< quint64(*)>(_a[2])),(*reinterpret_cast< quint64(*)>(_a[3]))); break; - case 19: _t->on_settingsButton_clicked(); break; - case 20: _t->on_languageComboBox_activated((*reinterpret_cast< const QString(*)>(_a[1]))); break; - case 21: _t->slotDisableNotify(); break; - case 22: _t->on_updateListGuideLabel_linkActivated((*reinterpret_cast< const QString(*)>(_a[1]))); break; - case 23: _t->on_exitButton_clicked(); break; - case 24: _t->on_offlineStartButton_clicked(); break; + case 19: _t->showServerListWidget((*reinterpret_cast< QList*(*)>(_a[1]))); break; + case 20: _t->on_settingsButton_clicked(); break; + case 21: _t->on_languageComboBox_activated((*reinterpret_cast< const QString(*)>(_a[1]))); break; + case 22: _t->slotDisableNotify(); break; + case 23: _t->on_updateListGuideLabel_linkActivated((*reinterpret_cast< const QString(*)>(_a[1]))); break; + case 24: _t->on_exitButton_clicked(); break; + case 25: _t->on_offlineStartButton_clicked(); break; default: ; } } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { @@ -368,13 +375,13 @@ int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 25) + if (_id < 26) qt_static_metacall(this, _c, _id, _a); - _id -= 25; + _id -= 26; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 25) + if (_id < 26) qt_static_metacall(this, _c, _id, _a); - _id -= 25; + _id -= 26; } return _id; } diff --git a/debug/moc_mainwindow.o b/debug/moc_mainwindow.o index c3b2c29..1a33215 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 d2e5d25..b00458d 100644 --- a/debug/moc_recognizesystem.cpp +++ b/debug/moc_recognizesystem.cpp @@ -10,6 +10,7 @@ #include "../Core/recognizesystem.h" #include #include +#include #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'recognizesystem.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_RecognizeSystem_t { - QByteArrayData data[18]; - char stringdata0[250]; + QByteArrayData data[21]; + char stringdata0[310]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -49,7 +50,10 @@ QT_MOC_LITERAL(13, 167, 20), // "ServerAuthorization*" QT_MOC_LITERAL(14, 188, 10), // "serverAuth" QT_MOC_LITERAL(15, 199, 25), // "sigSocketWaitForReadyRead" QT_MOC_LITERAL(16, 225, 8), // "waitTime" -QT_MOC_LITERAL(17, 234, 15) // "sigStartCompare" +QT_MOC_LITERAL(17, 234, 15), // "sigStartCompare" +QT_MOC_LITERAL(18, 250, 17), // "sigShowServerList" +QT_MOC_LITERAL(19, 268, 29), // "QList*" +QT_MOC_LITERAL(20, 298, 11) // "serverDatas" }, "RecognizeSystem\0sigUpdateBytesAvailable\0" @@ -58,7 +62,8 @@ QT_MOC_LITERAL(17, 234, 15) // "sigStartCompare" "sigSocketDisabled\0sigServerBlocked\0" "sigSaveLoginData\0ServerAuthorization*\0" "serverAuth\0sigSocketWaitForReadyRead\0" - "waitTime\0sigStartCompare" + "waitTime\0sigStartCompare\0sigShowServerList\0" + "QList*\0serverDatas" }; #undef QT_MOC_LITERAL @@ -68,23 +73,24 @@ static const uint qt_meta_data_RecognizeSystem[] = { 8, // revision 0, // classname 0, 0, // classinfo - 9, 14, // methods + 10, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags - 9, // signalCount + 10, // signalCount // signals: name, argc, parameters, tag, flags - 1, 0, 59, 2, 0x06 /* Public */, - 3, 0, 60, 2, 0x06 /* Public */, - 4, 3, 61, 2, 0x06 /* Public */, - 8, 1, 68, 2, 0x06 /* Public */, - 10, 0, 71, 2, 0x06 /* Public */, - 11, 0, 72, 2, 0x06 /* Public */, - 12, 1, 73, 2, 0x06 /* Public */, - 15, 1, 76, 2, 0x06 /* Public */, - 17, 0, 79, 2, 0x06 /* Public */, + 1, 0, 64, 2, 0x06 /* Public */, + 3, 0, 65, 2, 0x06 /* Public */, + 4, 3, 66, 2, 0x06 /* Public */, + 8, 1, 73, 2, 0x06 /* Public */, + 10, 0, 76, 2, 0x06 /* Public */, + 11, 0, 77, 2, 0x06 /* Public */, + 12, 1, 78, 2, 0x06 /* Public */, + 15, 1, 81, 2, 0x06 /* Public */, + 17, 0, 84, 2, 0x06 /* Public */, + 18, 1, 85, 2, 0x06 /* Public */, // signals: parameters QMetaType::Void, @@ -96,6 +102,7 @@ static const uint qt_meta_data_RecognizeSystem[] = { QMetaType::Void, 0x80000000 | 13, 14, QMetaType::Void, QMetaType::Int, 16, QMetaType::Void, + QMetaType::Void, 0x80000000 | 19, 20, 0 // eod }; @@ -115,6 +122,7 @@ void RecognizeSystem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int case 6: _t->sigSaveLoginData((*reinterpret_cast< ServerAuthorization*(*)>(_a[1]))); break; case 7: _t->sigSocketWaitForReadyRead((*reinterpret_cast< int(*)>(_a[1]))); break; case 8: _t->sigStartCompare(); break; + case 9: _t->sigShowServerList((*reinterpret_cast< QList*(*)>(_a[1]))); break; default: ; } } else if (_c == QMetaObject::IndexOfMethod) { @@ -182,6 +190,13 @@ void RecognizeSystem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int return; } } + { + using _t = void (RecognizeSystem::*)(QList * ); + if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&RecognizeSystem::sigShowServerList)) { + *result = 9; + return; + } + } } } @@ -214,13 +229,13 @@ int RecognizeSystem::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 9) + if (_id < 10) qt_static_metacall(this, _c, _id, _a); - _id -= 9; + _id -= 10; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 9) + if (_id < 10) *reinterpret_cast(_a[0]) = -1; - _id -= 9; + _id -= 10; } return _id; } @@ -282,5 +297,12 @@ void RecognizeSystem::sigStartCompare() { QMetaObject::activate(this, &staticMetaObject, 8, nullptr); } + +// SIGNAL 9 +void RecognizeSystem::sigShowServerList(QList * _t1) +{ + void *_a[] = { nullptr, const_cast(reinterpret_cast(std::addressof(_t1))) }; + QMetaObject::activate(this, &staticMetaObject, 9, _a); +} QT_WARNING_POP QT_END_MOC_NAMESPACE diff --git a/debug/moc_recognizesystem.o b/debug/moc_recognizesystem.o index b4fd7a2..cf4363a 100644 Binary files a/debug/moc_recognizesystem.o and b/debug/moc_recognizesystem.o differ diff --git a/debug/moc_versionselectwidget.o b/debug/moc_versionselectwidget.o index 06218f3..0f9b753 100644 Binary files a/debug/moc_versionselectwidget.o and b/debug/moc_versionselectwidget.o differ diff --git a/debug/recognizesystem.o b/debug/recognizesystem.o index 3218c7d..b9cccc7 100644 Binary files a/debug/recognizesystem.o and b/debug/recognizesystem.o differ diff --git a/debug/sendsystem.o b/debug/sendsystem.o index bc23fbc..8c37018 100644 Binary files a/debug/sendsystem.o and b/debug/sendsystem.o differ diff --git a/debug/tools.o b/debug/tools.o index 0c1291e..6a1769d 100644 Binary files a/debug/tools.o and b/debug/tools.o differ diff --git a/debug/updatecontroller.o b/debug/updatecontroller.o index 633b325..9229c08 100644 Binary files a/debug/updatecontroller.o and b/debug/updatecontroller.o differ diff --git a/debug/versionselectwidget.o b/debug/versionselectwidget.o index 5d6e421..437a887 100644 Binary files a/debug/versionselectwidget.o and b/debug/versionselectwidget.o differ diff --git a/mainwindow.cpp b/mainwindow.cpp index d53fcfc..fbcde05 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -172,6 +172,15 @@ void MainWindow::setNeedUpdate(bool flag,quint64 size, quint64 fileCount) } } +void MainWindow::showServerListWidget(QList *serverData) +{ + entryWidget->hide(); + stopLoadingMovie(); + versionSelectWidget->initialize(); + versionSelectWidget->fillView(serverData); + checkUpdate(); +} + void MainWindow::lostConnection() { commonButtonGroupWidget->updateProgressBar(0); @@ -326,7 +335,6 @@ void MainWindow::slotDisableNotify() void MainWindow::callUpdateList() { hashComparer->setWidget(updateWidget); - //QByteArray answer = dataParser->xmlAnswer_notify("GETSERVERDATALIST"); emit sigSendXMLAnswer("GETSERVERDATALIST"); updateWidget->initialize(this); } @@ -474,6 +482,11 @@ void MainWindow::startUnityClient() emit sigSendXMLAnswer("DISABLE"); } +void MainWindow::setCurrentVersionName(QString versionName) +{ + versionSelectWidget->fillCurrentVersionName(versionName); +} + void MainWindow::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) diff --git a/mainwindow.h b/mainwindow.h index 3538b6a..389e8d6 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -79,6 +79,7 @@ public slots: void serverBlocked(); void checkLoginResult(ServerAuthorization * serverAuth); void setNeedUpdate(bool flag,quint64 size,quint64 fileCount); + void showServerListWidget(QList *serverData); private slots: @@ -139,6 +140,7 @@ public: void loadToServer(); void undoCurrentChanges(); void startUnityClient(); + void setCurrentVersionName(QString versionName); protected: virtual void keyPressEvent(QKeyEvent *event); diff --git a/ui_versionselectwidget.h b/ui_versionselectwidget.h index d373ccd..0a90a76 100644 --- a/ui_versionselectwidget.h +++ b/ui_versionselectwidget.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -24,39 +24,39 @@ public: QPushButton *confirmVerButton; QLabel *verTitle; QLabel *verValue; - QListView *verListView; QLabel *verListTitle; QLabel *infoViewTitle; QLabel *infoValue; + QListWidget *verListView; void setupUi(QWidget *VersionSelectWidget) { if (VersionSelectWidget->objectName().isEmpty()) VersionSelectWidget->setObjectName(QString::fromUtf8("VersionSelectWidget")); - VersionSelectWidget->resize(584, 300); + VersionSelectWidget->resize(730, 171); confirmVerButton = new QPushButton(VersionSelectWidget); confirmVerButton->setObjectName(QString::fromUtf8("confirmVerButton")); - confirmVerButton->setGeometry(QRect(10, 250, 151, 41)); + confirmVerButton->setGeometry(QRect(320, 120, 151, 41)); verTitle = new QLabel(VersionSelectWidget); verTitle->setObjectName(QString::fromUtf8("verTitle")); - verTitle->setGeometry(QRect(170, 250, 101, 16)); + verTitle->setGeometry(QRect(320, 100, 241, 16)); verValue = new QLabel(VersionSelectWidget); verValue->setObjectName(QString::fromUtf8("verValue")); - verValue->setGeometry(QRect(280, 250, 55, 16)); - verListView = new QListView(VersionSelectWidget); - verListView->setObjectName(QString::fromUtf8("verListView")); - verListView->setGeometry(QRect(20, 30, 281, 211)); + verValue->setGeometry(QRect(570, 100, 55, 16)); verListTitle = new QLabel(VersionSelectWidget); verListTitle->setObjectName(QString::fromUtf8("verListTitle")); - verListTitle->setGeometry(QRect(20, 10, 121, 16)); + verListTitle->setGeometry(QRect(20, 10, 171, 16)); verListTitle->setContextMenuPolicy(Qt::PreventContextMenu); infoViewTitle = new QLabel(VersionSelectWidget); infoViewTitle->setObjectName(QString::fromUtf8("infoViewTitle")); - infoViewTitle->setGeometry(QRect(320, 10, 91, 16)); + infoViewTitle->setGeometry(QRect(320, 10, 191, 16)); infoValue = new QLabel(VersionSelectWidget); infoValue->setObjectName(QString::fromUtf8("infoValue")); - infoValue->setGeometry(QRect(320, 30, 241, 211)); + infoValue->setGeometry(QRect(320, 30, 381, 71)); infoValue->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); + verListView = new QListWidget(VersionSelectWidget); + verListView->setObjectName(QString::fromUtf8("verListView")); + verListView->setGeometry(QRect(20, 40, 281, 111)); retranslateUi(VersionSelectWidget); @@ -67,8 +67,8 @@ public: { VersionSelectWidget->setWindowTitle(QCoreApplication::translate("VersionSelectWidget", "Form", nullptr)); confirmVerButton->setText(QCoreApplication::translate("VersionSelectWidget", "\320\230\320\267\320\274\320\265\320\275\320\270\321\202\321\214 \320\262\320\265\321\200\321\201\320\270\321\216", nullptr)); - verTitle->setText(QCoreApplication::translate("VersionSelectWidget", "\320\242\320\265\320\272\321\203\321\211\320\260\321\217 \320\262\320\265\321\200\321\201\320\270\321\217:", nullptr)); - verValue->setText(QCoreApplication::translate("VersionSelectWidget", "base", nullptr)); + verTitle->setText(QCoreApplication::translate("VersionSelectWidget", "\320\242\320\265\320\272\321\203\321\211\320\260\321\217 \320\262\320\265\321\200\321\201\320\270\321\217 \321\201\320\265\321\200\320\262\320\265\321\200\320\260:", nullptr)); + verValue->setText(QCoreApplication::translate("VersionSelectWidget", "none", nullptr)); verListTitle->setText(QCoreApplication::translate("VersionSelectWidget", "\320\224\320\276\321\201\321\202\321\203\320\277\320\275\321\213\320\265 \320\262\320\265\321\200\321\201\320\270\320\270", nullptr)); infoViewTitle->setText(QCoreApplication::translate("VersionSelectWidget", "\320\230\320\275\321\204\320\276\321\200\320\274\320\260\321\206\320\270\321\217:", nullptr)); infoValue->setText(QCoreApplication::translate("VersionSelectWidget", "\320\242\321\203\321\202 \320\261\321\203\320\264\320\265\321\202 \320\270\320\275\321\204\320\276\321\200\320\274\320\260\321\206\320\270\321\217 \320\276 \320\262\320\265\321\200\321\201\320\270\320\270...", nullptr)); diff --git a/versionselectwidget.cpp b/versionselectwidget.cpp index 9880f5d..2340df5 100644 --- a/versionselectwidget.cpp +++ b/versionselectwidget.cpp @@ -13,6 +13,20 @@ void VersionSelectWidget::initialize() hide(); } +void VersionSelectWidget::fillView(QList *serverData) +{ + show(); + foreach(StreamingVersionData *data,*serverData) + { + ui->verListView->addItem(data->getViewName()); + } +} + +void VersionSelectWidget::fillCurrentVersionName(QString versionName) +{ + ui->verValue->setText(versionName); +} + VersionSelectWidget::~VersionSelectWidget() { delete ui; diff --git a/versionselectwidget.h b/versionselectwidget.h index b13f12c..1b1c9b2 100644 --- a/versionselectwidget.h +++ b/versionselectwidget.h @@ -3,6 +3,8 @@ #include +#include + namespace Ui { class VersionSelectWidget; } @@ -14,8 +16,10 @@ class VersionSelectWidget : public QWidget public: explicit VersionSelectWidget(QWidget *parent = nullptr); void initialize(); + void fillView(QList *serverData); ~VersionSelectWidget(); + void fillCurrentVersionName(QString versuionName); private: Ui::VersionSelectWidget *ui; }; diff --git a/versionselectwidget.ui b/versionselectwidget.ui index 44ebfed..b77ba6e 100644 --- a/versionselectwidget.ui +++ b/versionselectwidget.ui @@ -6,8 +6,8 @@ 0 0 - 584 - 300 + 730 + 171 @@ -16,8 +16,8 @@ - 10 - 250 + 320 + 120 151 41 @@ -29,37 +29,27 @@ - 170 - 250 - 101 + 320 + 100 + 241 16 - Текущая версия: + Текущая версия сервера: - 280 - 250 + 570 + 100 55 16 - base - - - - - - 20 - 30 - 281 - 211 - + none @@ -67,7 +57,7 @@ 20 10 - 121 + 171 16 @@ -83,7 +73,7 @@ 320 10 - 91 + 191 16 @@ -96,8 +86,8 @@ 320 30 - 241 - 211 + 381 + 71 @@ -107,6 +97,16 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + 20 + 40 + 281 + 111 + + +