feat: fix entryWidget button behaviour

This commit is contained in:
semenov
2025-08-15 14:19:33 +03:00
parent 0c805708ef
commit 87db4d0ef4
26 changed files with 5292 additions and 5219 deletions

View File

@@ -45,6 +45,8 @@ QList<FileData> UpdateController::calculateHash(const QString& path,const QStrin
}
QList<FileData> *hashes = new QList<FileData>;
QString fullSize = Tools::convertFileSize(getDirectorySize(path),false);
quint64 currentSize = 0;
QStringList filter;
filter << "*";
@@ -78,6 +80,9 @@ QList<FileData> UpdateController::calculateHash(const QString& path,const QStrin
FileData currentFile;
QFile file(fileInfo.absoluteFilePath());
currentSize += fileInfo.size();
emit sigSendHashInfo(fullSize,Tools::convertFileSize(currentSize,false));
quint64 fileSize = file.size(); //буффер для хэширования крупных файлов
const quint64 bufferSize = 10240;
@@ -110,6 +115,24 @@ QList<FileData> UpdateController::calculateHash(const QString& path,const QStrin
return *hashes;
}
quint64 UpdateController::getDirectorySize(const QString& path)
{
quint64 totalSize = 0;
QDirIterator iterator(path, QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
while (iterator.hasNext())
{
iterator.next();
QFileInfo fileInfo = iterator.fileInfo();
if (fileInfo.isFile())
{
totalSize += fileInfo.size();
}
}
return totalSize;
}
void UpdateController::updateFilesOnServer(QList<FileData> *fileSendList){
QListIterator<FileData> serverIterator(*fileSendList);
@@ -132,7 +155,6 @@ void UpdateController::updateFilesOnServer(QList<FileData> *fileSendList){
}
calculateCommonHash();
sendSystem->sendFinish();
emit sigUpdateComplete(true);

View File

@@ -38,6 +38,7 @@ public:
signals:
void sigUpdateComplete(bool flag);
void sigSendHashInfo(QString fullSize,QString current);
private:
SendSystem *sendSystem;
DataParserOutput * dataParserOut;
@@ -47,6 +48,7 @@ private:
QList<FileData> streamingDataList;
QList<FileData> calculateHash(const QString& path,const QString& ignoreName);
quint64 getDirectorySize(const QString &path);
};

View File

@@ -132,27 +132,12 @@ void DataParser::xmlParser(const QByteArray& array)
postProcessSystem->startCompare();
}
// if (value == "BASEDELETETRY")
// {
// emit sigNotify(tr("Нельзя удалять базовую версию"));
// }
// if (value == "TRYACTIVEDELETE")
// {
// emit sigNotify(tr("Нельзя удалять активную версию"));
// }
// if (value == "DUPLICATEVERNAME")
// {
// emit sigNotify(tr("Такое имя уже существет"));
// }
// if (value == "UNCHANGEABLE")
// {
// emit sigNotify(tr("Нельзя выгружать в базовую версию"));
// postProcessSystem->showUpdateList();
// //emit recognizeSystem->sigShowUpdateList();
// }
if (value == "UNCHANGEABLE")
{
//emit sigNotify(tr("Нельзя выгружать в базовую версию"));
//postProcessSystem->showUpdateList();
//emit recognizeSystem->sigShowUpdateList();
}
if (value == "CHANGEABLE")
{

View File

@@ -153,14 +153,14 @@ void DataParserOutput::createServerSettings(ServerSettings* serverSettings)
if(serverSettings->LocalVersionName == "")
{
xmlWriter.writeStartElement("VersionData");
xmlWriter.writeAttribute("Version","NONE");
xmlWriter.writeAttribute("Version","-----");
xmlWriter.writeAttribute("isChangable","0");
xmlWriter.writeEndElement();
}
else
{
xmlWriter.writeStartElement("VersionData");
xmlWriter.writeAttribute("Version",serverSettings->versionData.getViewName());
xmlWriter.writeAttribute("Version",serverSettings->LocalVersionName);
xmlWriter.writeAttribute("isChangable",QString::number(serverSettings->versionData.getIsChangeable()));
}

View File

@@ -85,6 +85,6 @@ void PostProcessorSystem::calculateCommonHash()
void UpdateController::checkCanUpdate()
{
QByteArray checkUpdate = dataParserOut->xmlAnswer_notify("CANCHANGE");
QByteArray checkUpdate = dataParserOut->xmlAnswer_notify("CANCHANGE"); //TODO: ПЕРЕВЕСТИ НА PACKAGETYPE
sendSystem->sendXMLAnswer(checkUpdate);
}

View File

@@ -258,8 +258,7 @@ void RecognizeSystem::recognize(QTcpSocket *socket)
if(packetType == PacketType::HASH_CALCULATE_START)
{
emit sigSetInineDebug(tr("Пересчет хэша на сервере..."));
//mainWindow->setInlineDebug();
emit sigdRecalculateHashOnServerState();
}
if(packetType == PacketType::BUSY)

View File

@@ -35,7 +35,7 @@ signals:
void sigSocketWaitForReadyRead(int waitTime);
void sigAnimationActivated(bool flag);
void sigCheckUpdate();
void sigSetInineDebug(QString message);
void sigdRecalculateHashOnServerState();
private:
QList<QString> *folderList;

View File

@@ -70,7 +70,7 @@ QString Tools::createSendFullPath(QString path)
return fullPath;
}
QString Tools::convertFileSize(quint64 fileSize)
QString Tools::convertFileSize(quint64 fileSize, bool withName)
{
quint64 megaByte = fileSize / (1024 * 1024);
QString resultSize;
@@ -78,11 +78,13 @@ QString Tools::convertFileSize(quint64 fileSize)
if (megaByte == 0)
{
auto kiloByte = fileSize / 1024;
resultSize = QString::number(kiloByte) + "кб. ";
resultSize = QString::number(kiloByte);
if(withName)resultSize.append("кб. ");
}
else
{
resultSize = QString::number(megaByte) + "мб. ";
resultSize = QString::number(megaByte);
if(withName)resultSize.append("мб. ");
}

View File

@@ -65,7 +65,7 @@ public:
static QString createLocalPath(QString path);
static QString createSendFullPath(QString path);
static QString createReceiveFullPath(QString path,StreamingVersionData *version);
static QString convertFileSize(quint64 fileSize);
static QString convertFileSize(quint64 fileSize, bool withName);
};
#endif // GLOBAL_H

File diff suppressed because it is too large Load Diff

View File

@@ -12,6 +12,10 @@
<FileData Path="/Application/RRJLoader/MonoBleedingEdge/etc/mono/4.5" Hash="FOLDER"/>
<FileData Path="/Application/RRJLoader/MonoBleedingEdge/etc/mono/4.5/Browsers" Hash="FOLDER"/>
<FileData Path="/Application/RRJLoader/MonoBleedingEdge/etc/mono/mconfig" Hash="FOLDER"/>
<FileData Path="/Application/RRJLoader/RRJ_BurstDebugInformation_DoNotShip" Hash="FOLDER"/>
<FileData Path="/Application/RRJLoader/RRJ_BurstDebugInformation_DoNotShip/Data" Hash="FOLDER"/>
<FileData Path="/Application/RRJLoader/RRJ_BurstDebugInformation_DoNotShip/Data/Plugins" Hash="FOLDER"/>
<FileData Path="/Application/RRJLoader/RRJ_BurstDebugInformation_DoNotShip/Data/Plugins/x86_64" Hash="FOLDER"/>
<FileData Path="/Application/RRJLoader/RRJ_Data" Hash="FOLDER"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/Managed" Hash="FOLDER"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/Plugins" Hash="FOLDER"/>
@@ -41,14 +45,15 @@
<FileData Path="/Application/RRJLoader/nvngx_dlss.dll" Hash="e557b8eb18fbd710f82073d9f6fa55a9"/>
<FileData Path="/Application/RRJLoader/NVUnityPlugin.dll" Hash="7ea7367d7d2ddf75e5d5826ecba6e729"/>
<FileData Path="/Application/RRJLoader/RRJ.exe" Hash="b5765d286e416d63a08bb1f31ce4dc69"/>
<FileData Path="/Application/RRJLoader/RRJ_BurstDebugInformation_DoNotShip/Data/Plugins/x86_64/lib_burst_generated.txt" Hash="56d687a9e8c5faa541830db17c2a5168"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/app.info" Hash="b0ac82165a3b21497e6e81ade4e23fe0"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/boot.config" Hash="2a643340ca956ce11942a5bdaace5752"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/globalgamemanagers" Hash="d649246ca5adfbc6a7095054885cad81"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/boot.config" Hash="7673265ef133ac05e95282ec5db9e6b6"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/globalgamemanagers" Hash="408ea1468f16b8ceef5e94fb29ad689d"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/globalgamemanagers.assets" Hash="c89ad7a0d7160f416c1efaa6f2d0b99a"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/globalgamemanagers.assets.resS" Hash="cc481c35e79b509dcd950c6adf2346ce"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/level0" Hash="6cccc6a0d9656a6cacab02d230ef3b51"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/level0.resS" Hash="3668556c7cc37236bfda94232caddb6b"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/Managed/Assembly-CSharp.dll" Hash="bcd149f15fe3580930c71276a909ab00"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/Managed/Assembly-CSharp.dll" Hash="ba0d5865229740d36690cf2a495fb02b"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/Managed/IngameDebugConsole.Runtime.dll" Hash="68c3bbc50f53aa8595149deff79539bf"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/Managed/Mono.Security.dll" Hash="051c8aaf3606869c9718c9352c4a0e89"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/Managed/mscorlib.dll" Hash="bdbb3cfe503185d616c99317438535a6"/>
@@ -171,11 +176,11 @@
<FileData Path="/Application/RRJLoader/RRJ_Data/Plugins/x86_64/pdfrenderer.dll" Hash="bb9613277346c4b3bf0ea29a44c903e9"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/Resources/unity default resources" Hash="267f4472590aa65a9eea4f8c546077f4"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/Resources/unity_builtin_extra" Hash="17e3c3ea97ad2574403c41477a7d6f9d"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/resources.assets" Hash="7ad47392ff1144f6bfecc211ef3b0d47"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/resources.assets" Hash="f18912a6cdf6c601786c3882aa9b16fc"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/resources.assets.resS" Hash="1d0b761a8d558d20b60c84d50d9d5721"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/RuntimeInitializeOnLoads.json" Hash="74bff99baeee016cd49dd3bf1385bd95"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/ScriptingAssemblies.json" Hash="af37f074cdc279e68638741a84bd003b"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/sharedassets0.assets" Hash="8f183648b225b265880594754d5f5347"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/sharedassets0.assets" Hash="1a66030b7233c24ee00fe9cb132b3a6c"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/sharedassets0.assets.resS" Hash="4ad63d43c63f7ca778c7132dac84cd3e"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/sharedassets0.resource" Hash="9c07c706a4ee630e3be0b492ab0bf4b8"/>
<FileData Path="/Application/RRJLoader/UnityCrashHandler64.exe" Hash="3725d98e4ac1229e90d5463029536f58"/>
@@ -203,7 +208,7 @@
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/Packets/ind.packet" Hash="9957a195581db76aa700ab777663f365"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/Packets/indOld.packet" Hash="1425cfadb547a04c6299697fc04174b7"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/Packets/ind_engineer.packet" Hash="2a6c22e9a2d3699a7b677fa45e499af5"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RRJ-95NEW-100/docs.xml" Hash="2876a3acc84c0a94062d932d26fecce9"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RRJ-95NEW-100/docs.xml" Hash="0209133c3166ced5467e3b4299928c1b"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RRJ-95NEW-100/MathParams.xml" Hash="29b15fc4e799787a181996237c23a2a9"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RRJ-95NEW-100/tasksFIM.xml" Hash="6e29a8516f67f562ad75eb7100e996f6"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RUS/Docs/AMM/PMC-RRJNEW-AA62F-AMM00-00_004-00_ru-RU.pdf" Hash="34e4cfc0dfd96c127798f766203aa9fe"/>
@@ -8842,6 +8847,9 @@
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RUS/Scens/RRJ-A-00-00-00-00A01-018C-A.xml" Hash="9705fde16e81324ceef61c7d967ff7dd"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RUS/Scens/RRJ-N-12-11-28-01A01-012A-A.xml" Hash="fddbf5711cce1c1d101085f3eceeb654"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RUS/Scens/RRJ-N-12-11-28-01A01-211A-A.xml" Hash="c7a2e7f8e417d5679fb87d5fa18916a2"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RUS/Scens/RRJ-N-17-10-00-01A01-200A-A.xml" Hash="9689671a33ca4f01d4841bf1a63ae191"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RUS/Scens/RRJ-N-21-20-00-00A01-040A-A.xml" Hash="d9c332c446c4c7a259a0883bce085cde"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/RUS/Scens/RRJ-N-26-10-00-00A01-040A-A.xml" Hash="6cd08e4ef175417ba9d9427b9fd9b729"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/Sounds/UI/ir_begin.wav" Hash="2e0057ee08c7b6fa07d28863a40d1cbf"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/Sounds/UI/ir_end.wav" Hash="e83345df81f1e577bb53766875efc31d"/>
<FileData Path="/Application/RRJLoader/RRJ_Data/StreamingAssets/Sounds/UI/Menu Command.wav" Hash="822b4c37ce07436e2192785f3274386f"/>

View File

@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<ServerSettingsContainer>
<ServerSettings Address="192.168.100.134" UseMathModel="1" Language="RUS" LocalPortMath="18004" AutoStart="0" Port="6000" DestPortMath="18003"/>
<VersionData Created="Чт авг 7 17:38:47 2025" isChangable="0" Version="base"/>
<ServerSettings Address="192.168.100.83" UseMathModel="1" AutoStart="0" Language="RUS" LocalPortMath="18004" Port="6000" DestPortMath="18003"/>
<VersionData Version="BS2" Created="Пт авг 15 09:59:42 2025" isChangable="1"/>
</ServerSettingsContainer>

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<ClientNotify Code="CANCHANGE"/>
<ClientAutorization Login="O1" Password="1111"/>

View File

@@ -25,6 +25,7 @@ void CommonButtonGroupWidget::updateProgressBar(float value)
void CommonButtonGroupWidget::loadCompleteState()
{
show();
ui->updateButton->setEnabled(false);
ui->startButton->setEnabled(true);
ui->loadingProgressBar->setValue(100);

View File

@@ -15,7 +15,7 @@ void EntryWidget::initialize()
ui->settingsWidget->hide();
}
void EntryWidget::connectionEmptyState()
void EntryWidget::disconnectState()
{
show();
ui->offlineWidget->show();
@@ -44,7 +44,7 @@ ClientAutorization* EntryWidget::getAuthData()
return data;
}
void EntryWidget::loginIsActive(bool flag)
void EntryWidget::showLoginWidget(bool flag)
{
if(flag)
{
@@ -91,6 +91,11 @@ void EntryWidget::isActive(bool flag)
else ui->settingsWidget->hide();
}
bool EntryWidget::getLoginWidgetIsHidden()
{
return ui->loginWidget->isHidden();
}
EntryWidget::~EntryWidget()
{

View File

@@ -19,13 +19,14 @@ public:
void settingsState();
bool isLoginFieldsFill();
ClientAutorization* getAuthData();
void loginIsActive(bool flag);
void showLoginWidget(bool flag);
~EntryWidget();
void connectionEmptyState();
void disconnectState();
void fillSettings(ServerSettings *settings);
ServerSettings *getServerSettings();
void isActive(bool flag);
bool getLoginWidgetIsHidden();
signals:
void sigTryLogin();

View File

@@ -274,6 +274,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="placeholderText">
<string>Пароль</string>
</property>

View File

@@ -16,6 +16,7 @@ void Bootstrap::initialize()
coreManager->initialize(widgetManager, workerThread);
widgetManager->start();
coreManager->start();
}

View File

@@ -31,8 +31,8 @@ void CoreManager::initialize(WidgetManager *widgetManager,QThread *workerThread)
recognizeSystem->moveToThread(workerThread);
postProcessorSystem->moveToThread(workerThread);
hashComparer->moveToThread(workerThread);
versionContainer->moveToThread(workerThread); //проверить работоспособность
resourceManager->moveToThread(workerThread); //проверить работоспособность
// versionContainer->moveToThread(workerThread); //проверить работоспособность
// resourceManager->moveToThread(workerThread); //проверить работоспособность
workerThread->start();
//workerThread->setPriority(QThread::HighestPriority);
@@ -44,17 +44,24 @@ void CoreManager::initialize(WidgetManager *widgetManager,QThread *workerThread)
loadStaticData();
}
void CoreManager::start()
{
checkAppAvailable();
}
void CoreManager::loadStaticData()
{
ServerSettings *currentSettings = dataParser->getClientSettings();
setLanguage(currentSettings->Language);
setLocalVersion();
externalExecuter->setIsAutoStart(currentSettings->isAutoStart);
bool appAvailable = externalExecuter->findApp();
widgetManager->setAppAvailable(appAvailable);
emit sigSetLoadSettings(currentSettings);
}
void CoreManager::binding()
{
connect(recognizeSystem,&RecognizeSystem::sigSetInineDebug,widgetManager,&WidgetManager::slotInlineDebug,Qt::AutoConnection);
connect(recognizeSystem,&RecognizeSystem::sigAnimationActivated,widgetManager,&WidgetManager::slotActivateLoadAnimation,Qt::AutoConnection);
connect(this,&CoreManager::sigInitializeClient,client,&TCPClient::initialize,Qt::AutoConnection);
@@ -63,7 +70,7 @@ void CoreManager::binding()
connect(this,&CoreManager::sigSendCheckUpdate,sendSystem,&SendSystem::sendCheckHash,Qt::AutoConnection);
connect(this,&CoreManager::sigSendXMLAnswer,sendSystem,&SendSystem::xmlAnswer,Qt::AutoConnection);
connect(this,&CoreManager::sigSendAutorization,sendSystem,&SendSystem::sendClientAutorization);
connect(this,&CoreManager::sigSendCheckUpdate,updateController,&UpdateController::checkCanUpdate,Qt::AutoConnection);
connect(this,&CoreManager::sigSendUpdateToServer,updateController,&UpdateController::checkCanUpdate,Qt::AutoConnection);
connect(this,&CoreManager::sigGetConnected,client,&TCPClient::getIsConnected);
connect(this,&CoreManager::sigCalculateHash,updateController,&UpdateController::calculateCommonHash);
@@ -76,22 +83,24 @@ void CoreManager::binding()
connect(postProcessorSystem,&PostProcessorSystem::sigSaveLoginData,this,&CoreManager::checkLoginResult,Qt::AutoConnection);
connect(postProcessorSystem,&PostProcessorSystem::sigShowUpdateList,this,&CoreManager::checkUpdateInfo,Qt::AutoConnection);
connect(versionContainer,&VersionContainer::sigSetServerVersion,this,&CoreManager::setServerVersion);
connect(versionContainer,&VersionContainer::sigSetServerVersion,this,&CoreManager::setServerVersion,Qt::AutoConnection);
connect(recognizeSystem,&RecognizeSystem::sigUpdateBytesAvailable,this,&CoreManager::calcUpdateProgress,Qt::AutoConnection);
connect(recognizeSystem,&RecognizeSystem::sigLoadComplete,this,&CoreManager::loadComplete);
connect(recognizeSystem,&RecognizeSystem::sigNeedUpdate,this,&CoreManager::checkNeedUpdate);
connect(recognizeSystem,&RecognizeSystem::sigLoadComplete,this,&CoreManager::loadComplete,Qt::AutoConnection);
connect(recognizeSystem,&RecognizeSystem::sigNeedUpdate,this,&CoreManager::checkNeedUpdate,Qt::AutoConnection);
connect(recognizeSystem,&RecognizeSystem::sigCheckUpdate,this,&CoreManager::checkUpdate,Qt::AutoConnection);
connect(recognizeSystem,&RecognizeSystem::sigdRecalculateHashOnServerState,this,&CoreManager::recalculateState,Qt::AutoConnection);
connect(hashComparer,&HashComparer::sigCallCheck,this,&CoreManager::checkUpdate);
connect(hashComparer,&HashComparer::sigHaveDelta,this,&CoreManager::checkUpdateInfo);
connect(updateController,&UpdateController::sigUpdateComplete,widgetManager,&WidgetManager::setCompeteState);//ОПАСНОСТЬ
connect(updateController,&UpdateController::sigUpdateComplete,widgetManager,&WidgetManager::setCompeteState,Qt::AutoConnection);//ОПАСНОСТЬ
connect(updateController,&UpdateController::sigSendHashInfo,widgetManager->getMainWindow(),&MainWindow::updateInitInformation,Qt::AutoConnection);
connect(client,&TCPClient::sigConnectionState,widgetManager,&WidgetManager::setConnectionState,Qt::AutoConnection);//ОПАСНОСТЬ
connect(client,&TCPClient::sigServerDisconnect,widgetManager,&WidgetManager::setServerDisconnectState,Qt::AutoConnection);//ОПАСНОСТЬ
connect(sendSystem,&SendSystem::sigSend,this,&CoreManager::calcUpdateProgress);
connect(sendSystem,&SendSystem::sigSend,this,&CoreManager::calcUpdateProgress,Qt::AutoConnection);
connect(sendSystem,&SendSystem::sigGetXmlAnswer,dataParserOutput,&DataParserOutput::xmlAnswer_notify,Qt::DirectConnection);//ОПАСНОСТЬ
connect(dataParser,&DataParser::sigNotify,widgetManager->getNotifyController(),&NotifyController::showWarning,Qt::AutoConnection);//ОПАСНОСТЬ
@@ -184,6 +193,7 @@ void CoreManager::checkLoginResult(ServerAuthorization *auth)
{
if (auth->Result)
{
widgetManager->activateLoadingAnimation(true);
checkAccessType(auth->AccessType);
dataParserOutput->createAuthData(auth);
setLocalVersion();
@@ -194,7 +204,6 @@ void CoreManager::checkLoginResult(ServerAuthorization *auth)
{
widgetManager->setLoginFailed();
}
}
void CoreManager::tryLogin()
@@ -205,7 +214,7 @@ void CoreManager::tryLogin()
return;
}
widgetManager->getEntryWidget()->loginIsActive(false);
widgetManager->getEntryWidget()->showLoginWidget(false);
ClientAutorization *auth = widgetManager->getEntryWidget()->getAuthData();
dataParserOutput->createAuthMessage(auth);
emit sigSendAutorization();
@@ -213,10 +222,17 @@ void CoreManager::tryLogin()
void CoreManager::checkUpdate()
{
widgetManager->activateLoadingAnimation(true);
emit sigSendCheckUpdate();
widgetManager->getMainWindow()->setInlineDebug(tr("Проверка обновлений..."));
}
void CoreManager::recalculateState()
{
widgetManager->activateLoadingAnimation(true);
widgetManager->getMainWindow()->setInlineDebug(tr("Пересчет хэша на сервере..."));
}
void CoreManager::checkAccessType(const QString& accessType)
{
if (accessType == traineeTypeName)
@@ -257,6 +273,8 @@ void CoreManager::checkNeedUpdate(bool isNeedUpdate,quint64 size, quint64 fileCo
dataParserOutput->changeVersion(versionContainer->getServerVersionData());
setLocalVersion();
}
widgetManager->activateLoadingAnimation(false);
}
void CoreManager::calcUpdateProgress()
@@ -293,19 +311,21 @@ void CoreManager::loadComplete()
dataParserOutput->changeVersion(versionContainer->getServerVersionData());
setLocalVersion();
checkAutoStart();
widgetManager->getMainWindow()->setClientVersionName(versionContainer->getLocalVersion());
}
void CoreManager::loadToServer()
{
widgetManager->setSendFileToServerState();
emit sigSendCheckUpdate();
widgetManager->activateLoadingAnimation(true);
emit sigSendUpdateToServer();
}
void CoreManager::undoCurrentChanges()
{
isRecovery = true;
emit sigSendCheckUpdate();
widgetManager->setUndoCurrentChangesState();
emit sigSendCheckUpdate();
emit sigSendCommand(PacketType::TYPE_UPDATE);
//тут был таймер
isRecovery = false;
@@ -334,7 +354,7 @@ void CoreManager::saveServerSettingsWithConnect()
if(client->getIsConnected())
{
entryWidget->loginIsActive(true);
entryWidget->showLoginWidget(true);
widgetManager->getMainWindow()->showOfflineButton(true);
widgetManager->activateLoadingAnimation(false);
}
@@ -347,7 +367,7 @@ void CoreManager::saveServerSettingsWithConnect()
void CoreManager::checkAppAvailable()
{
bool isAvailable = externalExecuter->findApp();
widgetManager->activateStartButtons(isAvailable);
widgetManager->setAppAvailable(isAvailable);
}
void CoreManager::setLanguage(const QString& language)

View File

@@ -24,6 +24,7 @@ public:
explicit CoreManager(QObject *parent = nullptr);
~CoreManager(){}
void initialize(WidgetManager *widgetManager,QThread *workerThread);
void start();
void checkUpdateInfo();
void checkAutoStart();
void setLanguage(const QString &language);
@@ -46,6 +47,7 @@ public:
void exit();
void initializeWidgets();
void recalculateState();
signals:
void sigInitializeClient(RecognizeSystem *recognize,SendSystem *sendSystem);
void sigSendCommand(PacketType packetType);
@@ -55,6 +57,7 @@ signals:
void sigSendAutorization();
void sigSendCheckUpdate();
bool sigGetConnected();
void sigSendUpdateToServer();
void sigSetLoadSettings(ServerSettings *serverSettings);

View File

@@ -18,7 +18,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->setupUi(this);
setAttribute(Qt::WA_TranslucentBackground);
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
_background.load(":/resource/SSJ_backgroundDarkSM.png");
background.load(":/resource/SSJ_backgroundDarkSM.png");
timer = new QTimer;
}
@@ -31,11 +31,11 @@ void MainWindow::paintEvent(QPaintEvent*) {
path.addRoundedRect(rect(), 8, 8);
painter.setClipPath(path);
if (!_background.isNull())
if (!background.isNull())
{
int x = (width() - _background.width()) / 2;
int y = (height() - _background.height()) / 2;
painter.drawPixmap(x, y, _background);
int x = (width() - background.width()) / 2;
int y = (height() - background.height()) / 2;
painter.drawPixmap(x, y, background);
}
}
@@ -57,6 +57,15 @@ void MainWindow::setStartState()
setUpUi();
}
void MainWindow::updateInitInformation(QString fullSize,QString currentSize)
{
QString info = tr("Инициализация...");
info.append(currentSize);
info.append("/");
info.append(fullSize);
setInlineDebug(info);
}
void MainWindow::bindConnection()
{
connect(timer,&QTimer::timeout,this,&MainWindow::slotDisableNotify);
@@ -224,12 +233,6 @@ void MainWindow::undoCurrentChanges()
{
ui->mainFrame->show();
ui->offlineStartButton->setEnabled(false);
//delay
QTime dieTime= QTime::currentTime().addSecs(10);
while (QTime::currentTime() < dieTime)
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
ui->unsafeChangingButton->hide();
}
@@ -246,7 +249,7 @@ void MainWindow::on_exitButton_clicked()
exit(0);
}
void MainWindow::showUpdateInfo()
void MainWindow::slotShowUpdateInfo()
{
ui->unsafeChangingButton->show();
ui->offlineStartButton->setGeometry(bottomRightPosition);
@@ -275,7 +278,7 @@ void MainWindow::setUpUi()
ui->autostartCheckBox->hide();
}
void MainWindow::commonWidgetState()
void MainWindow::slotCommonWidgetState()
{
disableUnsaveButton(true);
setInlineDebug(tr("Загрузка..."));
@@ -284,9 +287,11 @@ void MainWindow::commonWidgetState()
void MainWindow::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)
{
if (!entryWidget->getLoginWidgetIsHidden())
{
emit sigTryLogin();
//if (entryWidget->isLoginFieldsFill()) return;
}
}
}
@@ -319,6 +324,7 @@ void MainWindow::addWidgetToChangeGroup(CommonButtonGroupWidget *commonWidgetGro
void MainWindow::addWidgetToInteractiveGroup(EntryWidget *entryWidget)
{
ui->interactiveGroup->addWidget(entryWidget);
this->entryWidget = entryWidget;
}
void MainWindow::setLoadSettings(ServerSettings *serverSettings)

View File

@@ -57,6 +57,7 @@ public slots:
void slotCommonWidgetState();
void setServerVersion(StreamingVersionData *version);
void updateInitInformation(QString fullSize, QString currentSize);
signals:
void sigShowSettings(bool isActive);
void sigChangeLanguage(const QString& arg1);
@@ -76,6 +77,7 @@ private slots:
private:
Ui::MainWindow *ui;
ResourceManager *resourceManager;
EntryWidget *entryWidget;
QTimer *timer;
QPixmap background;

View File

@@ -249,10 +249,10 @@
<widget class="QWidget" name="versionLayoutWidget" native="true">
<property name="geometry">
<rect>
<x>540</x>
<x>529</x>
<y>450</y>
<width>251</width>
<height>61</height>
<width>250</width>
<height>60</height>
</rect>
</property>
<layout class="QVBoxLayout" name="versionLayout">

View File

@@ -12,7 +12,6 @@ WidgetManager::WidgetManager(QObject *parent) : QObject(parent)
notifyController = new NotifyController;
}
void WidgetManager::initialize()
{
updateWidget->setParent(mainWindow);
@@ -33,7 +32,7 @@ void WidgetManager::initialize()
void WidgetManager::binding()
{
connect(updateWidget,&UpdateNotifyWidget::sigShowMainFrame,this,&WidgetManager::showMainFrame,Qt::AutoConnection);
connect(commonButtonGroupWidget,&CommonButtonGroupWidget::sigUpdateCommonWidget,mainWindow,&MainWindow::commonWidgetState);
connect(commonButtonGroupWidget,&CommonButtonGroupWidget::sigUpdateCommonWidget,mainWindow,&MainWindow::slotCommonWidgetState);
connect(mainWindow,&MainWindow::sigShowSettings,this,&WidgetManager::showSettings,Qt::AutoConnection);
}
void WidgetManager::slotSetLoadSettings(ServerSettings *settings)
@@ -47,20 +46,20 @@ void WidgetManager::setLostConnectionState()
commonButtonGroupWidget->updateProgressBar(0);
mainWindow->slotConnectionState(false);
waitAnimationWidget->hideWithStop();
entryWidget->connectionEmptyState();
entryWidget->disconnectState();
updateWidget->hide();
}
void WidgetManager::setLoginSuccess()
{
entryWidget->loginIsActive(false);
entryWidget->showLoginWidget(false);
mainWindow->setLoginSuccessState();
activateLoadingAnimation(false);
}
void WidgetManager::setLoginFailed()
{
entryWidget->loginIsActive(true);
entryWidget->showLoginWidget(true);
mainWindow->setLoginFailedState();
activateLoadingAnimation(false);
}
@@ -70,8 +69,8 @@ void WidgetManager::showUpdateInfo()
waitAnimationWidget->hideWithStop();
updateWidget->showWithFill();
mainWindow->showMainFrame(true);
mainWindow->showUpdateInfo();
mainWindow->showMainFrame(false);
mainWindow->slotShowUpdateInfo();
entryWidget->hide();
commonButtonGroupWidget->hide();
}
@@ -99,7 +98,7 @@ void WidgetManager::setNeedUpdateState(quint64 size, quint64 fileCount,quint64 d
QString result;
if(fileCount > 0)
{
result = tr("Доступно обновление: ") + Tools::convertFileSize(size);
result = tr("Доступно обновление: ") + Tools::convertFileSize(size,true);
//result += tr("Количество файлов: ") + QString::number(fileCount);
}
else
@@ -130,7 +129,7 @@ void WidgetManager::setConnectionState(bool isConnected)
mainWindow->slotConnectionState(isConnected);
if (isConnected)
{
entryWidget->loginIsActive(true);
entryWidget->showLoginWidget(true);
}
waitAnimationWidget->hideWithStop();
}
@@ -146,20 +145,21 @@ void WidgetManager::start()
{
waitAnimationWidget->showWithPlay();
mainWindow->setStartState();
waitAnimationWidget->hideWithStop();
}
void WidgetManager::setServerDisconnectState()
{
commonButtonGroupWidget->disconnectState();
mainWindow->slotServerDisconnect();
entryWidget->disconnectState();
waitAnimationWidget->hideWithStop();
}
void WidgetManager::setUndoCurrentChangesState()
{
mainWindow->undoCurrentChanges();
commonButtonGroupWidget->showProgressBar(false);
updateWidget->hide();
commonButtonGroupWidget->showProgressBar(false);
waitAnimationWidget->showWithPlay();
}
@@ -168,7 +168,7 @@ void WidgetManager::showMainFrame(bool flag)
mainWindow->showMainFrame(flag);
}
void WidgetManager::activateStartButtons(bool isAvailable)
void WidgetManager::setAppAvailable(bool isAvailable)
{
commonButtonGroupWidget->startButtonActive(isAvailable);
mainWindow->setStartOfflineButton(isAvailable);

View File

@@ -45,7 +45,7 @@ public:
void setUndoCurrentChangesState();
void showMainFrame(bool flag);
void activateStartButtons(bool isAvailable);
void setAppAvailable(bool isAvailable);
void slotInlineDebug(const QString &text);
public slots:
void showSettings(bool isActive);