mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
918d391a68 | ||
|
|
775f5cd0a4 | ||
|
|
75a93e346b | ||
|
|
4e15a439ee | ||
|
|
9e202f8e5d | ||
|
|
c23f3d519b |
37
ClientMPS_resource.rc
Normal file
37
ClientMPS_resource.rc
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
IDI_ICON1 ICON DISCARDABLE "D:\\QT\\Projects\\RRJClient\\resource\\Icons\\planeCustomIco.ico"
|
||||||
|
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION 0,0,0,0
|
||||||
|
PRODUCTVERSION 0,0,0,0
|
||||||
|
FILEFLAGSMASK 0x3fL
|
||||||
|
#ifdef _DEBUG
|
||||||
|
FILEFLAGS VS_FF_DEBUG
|
||||||
|
#else
|
||||||
|
FILEFLAGS 0x0L
|
||||||
|
#endif
|
||||||
|
FILEOS VOS__WINDOWS32
|
||||||
|
FILETYPE VFT_DLL
|
||||||
|
FILESUBTYPE 0x0L
|
||||||
|
BEGIN
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
BEGIN
|
||||||
|
BLOCK "040904b0"
|
||||||
|
BEGIN
|
||||||
|
VALUE "CompanyName", "\0"
|
||||||
|
VALUE "FileDescription", "\0"
|
||||||
|
VALUE "FileVersion", "0.0.0.0\0"
|
||||||
|
VALUE "LegalCopyright", "\0"
|
||||||
|
VALUE "OriginalFilename", "ClientMPS.exe\0"
|
||||||
|
VALUE "ProductName", "ClientMPS\0"
|
||||||
|
VALUE "ProductVersion", "0.0.0.0\0"
|
||||||
|
END
|
||||||
|
END
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Translation", 0x0409, 1200
|
||||||
|
END
|
||||||
|
END
|
||||||
|
/* End of Version info */
|
||||||
|
|
||||||
@@ -15,9 +15,9 @@ void DataParser::initialize(PostProcessorSystem *postProcessSystem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ServerSettings *DataParser::getClientSettings()
|
Settings *DataParser::getSettings()
|
||||||
{
|
{
|
||||||
ServerSettings *settings = new ServerSettings;
|
Settings *settings = new Settings;
|
||||||
QFile file(settingsName);
|
QFile file(settingsName);
|
||||||
file.open(QIODevice::ReadOnly);
|
file.open(QIODevice::ReadOnly);
|
||||||
QXmlStreamReader xmlReader(&file);
|
QXmlStreamReader xmlReader(&file);
|
||||||
@@ -135,15 +135,29 @@ bool DataParser::xmlParser(const QByteArray& array)
|
|||||||
|
|
||||||
if (value == "UNCHANGEABLE")
|
if (value == "UNCHANGEABLE")
|
||||||
{
|
{
|
||||||
//версию нельзя изменять
|
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value == "CHANGEABLE")
|
if (value == "CHANGEABLE")
|
||||||
{
|
{
|
||||||
postProcessSystem->compareFiles();
|
postProcessSystem->compareFiles();
|
||||||
//emit sigUpdateFilesOnServer(hashComparer->getFilesForUpdate());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value == "ERROR_AUTH_ARCHIVED")
|
||||||
|
{
|
||||||
|
postProcessSystem->userArchived();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value == "ERROR_AUTH_LOGINORPASSWORD")
|
||||||
|
{
|
||||||
|
postProcessSystem->wrongLoginOrPass();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value == "ERROR_AUTH_ALREADYLOGIN")
|
||||||
|
{
|
||||||
|
postProcessSystem->alreadyLogin();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public:
|
|||||||
~DataParser() = default;
|
~DataParser() = default;
|
||||||
|
|
||||||
void initialize(PostProcessorSystem *postProcessSystem);
|
void initialize(PostProcessorSystem *postProcessSystem);
|
||||||
ServerSettings* getClientSettings();
|
Settings* getSettings();
|
||||||
bool xmlParser(const QByteArray& array);
|
bool xmlParser(const QByteArray& array);
|
||||||
private:
|
private:
|
||||||
PostProcessorSystem *postProcessSystem;
|
PostProcessorSystem *postProcessSystem;
|
||||||
|
|||||||
@@ -125,7 +125,42 @@ void DataParserOutput::createAuthMessage(ClientAutorization *auth)
|
|||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataParserOutput::createServerSettings(ServerSettings* serverSettings)
|
void DataParserOutput::createServerSettings()
|
||||||
|
{
|
||||||
|
QFile file(settingsName);
|
||||||
|
if (file.exists()) return;
|
||||||
|
|
||||||
|
file.open(QIODevice::WriteOnly);
|
||||||
|
|
||||||
|
QXmlStreamWriter xmlWriter(&file);
|
||||||
|
|
||||||
|
xmlWriter.setAutoFormatting(true);
|
||||||
|
xmlWriter.writeStartDocument();
|
||||||
|
|
||||||
|
xmlWriter.writeStartElement("ServerSettingsContainer");
|
||||||
|
xmlWriter.writeStartElement("ServerSettings");
|
||||||
|
|
||||||
|
xmlWriter.writeAttribute("Address","");
|
||||||
|
xmlWriter.writeAttribute("Port","");
|
||||||
|
xmlWriter.writeAttribute("Language","RUS");
|
||||||
|
xmlWriter.writeAttribute("AutoStart",QString::number(false));
|
||||||
|
|
||||||
|
xmlWriter.writeEndElement();
|
||||||
|
|
||||||
|
xmlWriter.writeStartElement("VersionData");
|
||||||
|
xmlWriter.writeAttribute("Version","-----");
|
||||||
|
xmlWriter.writeAttribute("isChangable","0");
|
||||||
|
xmlWriter.writeEndElement();
|
||||||
|
|
||||||
|
xmlWriter.writeEndElement();
|
||||||
|
|
||||||
|
xmlWriter.writeEndDocument();
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DataParserOutput::updateServerSettings(Settings* serverSettings)
|
||||||
{
|
{
|
||||||
QFile file(settingsName);
|
QFile file(settingsName);
|
||||||
file.open(QIODevice::WriteOnly);
|
file.open(QIODevice::WriteOnly);
|
||||||
@@ -142,9 +177,6 @@ void DataParserOutput::createServerSettings(ServerSettings* serverSettings)
|
|||||||
xmlWriter.writeAttribute("Port",serverSettings->Port);
|
xmlWriter.writeAttribute("Port",serverSettings->Port);
|
||||||
xmlWriter.writeAttribute("Language","RUS");
|
xmlWriter.writeAttribute("Language","RUS");
|
||||||
xmlWriter.writeAttribute("AutoStart",QString::number(false));
|
xmlWriter.writeAttribute("AutoStart",QString::number(false));
|
||||||
//xmlWriter.writeAttribute("DestPortMath","18003");
|
|
||||||
//xmlWriter.writeAttribute("LocalPortMath","18004");
|
|
||||||
//xmlWriter.writeAttribute("UseMathModel",QString::number(serverSettings->mathModelUse));
|
|
||||||
|
|
||||||
xmlWriter.writeEndElement();
|
xmlWriter.writeEndElement();
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ public:
|
|||||||
explicit DataParserOutput(QObject *parent = 0);
|
explicit DataParserOutput(QObject *parent = 0);
|
||||||
void createFileDataList(const QList<FileData>& fileDataList,const QString& filename);
|
void createFileDataList(const QList<FileData>& fileDataList,const QString& filename);
|
||||||
void createAuthMessage(ClientAutorization *auth);
|
void createAuthMessage(ClientAutorization *auth);
|
||||||
void createServerSettings(ServerSettings *serverSettings);
|
void createServerSettings();
|
||||||
|
void updateServerSettings(Settings *serverSettings);
|
||||||
void changeVersion(StreamingVersionData *versionData);
|
void changeVersion(StreamingVersionData *versionData);
|
||||||
void createAuthData(ServerAuthorization *serverAuth);
|
void createAuthData(ServerAuthorization *serverAuth);
|
||||||
void createAuthDataOffline(const QString& username,const QString& pass);
|
void createAuthDataOffline(const QString& username,const QString& pass);
|
||||||
|
|||||||
@@ -19,14 +19,29 @@ void PostProcessorSystem::initialize(DataParserOutput *dataParserOutput,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PostProcessorSystem::userArchived()
|
||||||
|
{
|
||||||
|
emit sigShowError(ErrorsEnum::ARCHIVED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PostProcessorSystem::wrongLoginOrPass()
|
||||||
|
{
|
||||||
|
emit sigShowError(ErrorsEnum::LOGIN_OR_PASS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PostProcessorSystem::alreadyLogin()
|
||||||
|
{
|
||||||
|
emit sigShowError(ErrorsEnum::ALREADYLOGIN);
|
||||||
|
}
|
||||||
|
|
||||||
void PostProcessorSystem::socketDisable()
|
void PostProcessorSystem::socketDisable()
|
||||||
{
|
{
|
||||||
emit sigSocketDisabled();
|
emit sigShowError(ErrorsEnum::DISABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostProcessorSystem::serverBlocked()
|
void PostProcessorSystem::serverBlocked()
|
||||||
{
|
{
|
||||||
emit sigServerBlocked();
|
emit sigShowError(ErrorsEnum::BLOCKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostProcessorSystem::startCompare()
|
void PostProcessorSystem::startCompare()
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "UpdateController.h"
|
#include "UpdateController.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <Data/Datas.h>
|
#include <Data/Datas.h>
|
||||||
|
#include <Data/ErrorsEnum.h>
|
||||||
|
|
||||||
class PostProcessorSystem : public QObject
|
class PostProcessorSystem : public QObject
|
||||||
{
|
{
|
||||||
@@ -24,9 +25,11 @@ public:
|
|||||||
void saveLoginData(ServerAuthorization *auth);
|
void saveLoginData(ServerAuthorization *auth);
|
||||||
void setServerVersion(StreamingVersionData *serverVersion);
|
void setServerVersion(StreamingVersionData *serverVersion);
|
||||||
void calculateCommonHash();
|
void calculateCommonHash();
|
||||||
|
void userArchived();
|
||||||
|
void wrongLoginOrPass();
|
||||||
|
void alreadyLogin();
|
||||||
signals:
|
signals:
|
||||||
void sigSocketDisabled();
|
void sigShowError(ErrorsEnum error);
|
||||||
void sigServerBlocked();
|
|
||||||
void sigStartCompare(QList<FileData> *serverStreamingHash, QList<FileData> localStreamingHash);
|
void sigStartCompare(QList<FileData> *serverStreamingHash, QList<FileData> localStreamingHash);
|
||||||
void sigCallUpdateList();
|
void sigCallUpdateList();
|
||||||
void sigSaveLoginData(ServerAuthorization *serverAuth);
|
void sigSaveLoginData(ServerAuthorization *serverAuth);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ void TCPClient::initialize(RecognizeSystem *recognize,SendSystem *sendSystem)
|
|||||||
emit sigSendDebugLog(Tools::getTime() + " Client started");
|
emit sigSendDebugLog(Tools::getTime() + " Client started");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCPClient::setConnect(ServerSettings *serverSettings)
|
void TCPClient::setConnect(Settings *serverSettings)
|
||||||
{
|
{
|
||||||
socket = new QTcpSocket();
|
socket = new QTcpSocket();
|
||||||
qDebug() << "TCPCLient thread: " << thread();
|
qDebug() << "TCPCLient thread: " << thread();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class TCPClient : public QObject
|
|||||||
public:
|
public:
|
||||||
explicit TCPClient(QObject *parent = 0);
|
explicit TCPClient(QObject *parent = 0);
|
||||||
void initialize(RecognizeSystem *recognize,SendSystem *sendSystem);
|
void initialize(RecognizeSystem *recognize,SendSystem *sendSystem);
|
||||||
void setConnect(ServerSettings *serverSettings);
|
void setConnect(Settings *serverSettings);
|
||||||
~TCPClient(){};
|
~TCPClient(){};
|
||||||
void setDisconnect();
|
void setDisconnect();
|
||||||
bool getIsConnected() const;
|
bool getIsConnected() const;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
class ServerSettings{
|
class Settings{
|
||||||
public:
|
public:
|
||||||
QString Address;
|
QString Address;
|
||||||
QString Port;
|
QString Port;
|
||||||
|
|||||||
13
Data/ErrorsEnum.h
Normal file
13
Data/ErrorsEnum.h
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef ERRORSENUM_H
|
||||||
|
#define ERRORSENUM_H
|
||||||
|
|
||||||
|
enum ErrorsEnum
|
||||||
|
{
|
||||||
|
BLOCKED,
|
||||||
|
ARCHIVED,
|
||||||
|
LOGIN_OR_PASS,
|
||||||
|
ALREADYLOGIN,
|
||||||
|
DISABLE
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ERRORSENUM_H
|
||||||
@@ -60,6 +60,7 @@ HEADERS += \
|
|||||||
Core\tools.h\
|
Core\tools.h\
|
||||||
Core\hashcomparer.h \
|
Core\hashcomparer.h \
|
||||||
Data/Client.h \
|
Data/Client.h \
|
||||||
|
Data/ErrorsEnum.h \
|
||||||
Data/monitorInfo.h \
|
Data/monitorInfo.h \
|
||||||
Data/streamingversiondata.h \
|
Data/streamingversiondata.h \
|
||||||
Data\FileData.h\
|
Data\FileData.h\
|
||||||
@@ -95,6 +96,7 @@ qnx: target.path = /tmp/$${TARGET}/bin
|
|||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
TARGET = ClientMPS
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
resources.qrc
|
resources.qrc
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<ServerSettingsContainer>
|
<ServerSettingsContainer>
|
||||||
<ServerSettings Address="192.168.100.83" Port="6000" Language="RUS" AutoStart="0"/>
|
<ServerSettings AutoStart="0" Port="6000" Address="192.168.100.134" Language="RUS"/>
|
||||||
<VersionData Version="base" isChangable="96"/>
|
<VersionData Created="Пн дек 22 15:46:11 2025" isChangable="1" Version="max2"/>
|
||||||
</ServerSettingsContainer>
|
</ServerSettingsContainer>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -65,21 +65,7 @@ void EntryWidget::on_saveServerButton_clicked()
|
|||||||
emit sigSaveServerSettings();
|
emit sigSaveServerSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerSettings *EntryWidget::getServerSettings()
|
void EntryWidget::fillSettings(Settings *settings)
|
||||||
{
|
|
||||||
ServerSettings *data = new ServerSettings;
|
|
||||||
QString server = ui->serverInputField->text();
|
|
||||||
QString port = ui->portInputField->text();
|
|
||||||
//bool checked = ui->mathModelUsecheckBox->isChecked();
|
|
||||||
|
|
||||||
data->Address = server;
|
|
||||||
data->Port = port;
|
|
||||||
data->mathModelUse = true;
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntryWidget::fillSettings(ServerSettings *settings)
|
|
||||||
{
|
{
|
||||||
ui->serverInputField->setText(settings->Address);
|
ui->serverInputField->setText(settings->Address);
|
||||||
ui->portInputField->setText(settings->Port);
|
ui->portInputField->setText(settings->Port);
|
||||||
@@ -97,6 +83,14 @@ bool EntryWidget::getLoginWidgetIsHidden()
|
|||||||
return ui->loginWidget->isHidden();
|
return ui->loginWidget->isHidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString EntryWidget::getAddress(){
|
||||||
|
return ui->serverInputField->text();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString EntryWidget::getPort(){
|
||||||
|
return ui->portInputField->text();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
EntryWidget::~EntryWidget()
|
EntryWidget::~EntryWidget()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ public:
|
|||||||
void showLoginWidget(bool flag);
|
void showLoginWidget(bool flag);
|
||||||
|
|
||||||
void disconnectState();
|
void disconnectState();
|
||||||
void fillSettings(ServerSettings *settings);
|
void fillSettings(Settings *settings);
|
||||||
void isActive(bool flag);
|
void isActive(bool flag);
|
||||||
bool getLoginWidgetIsHidden();
|
bool getLoginWidgetIsHidden();
|
||||||
|
|
||||||
ServerSettings *getServerSettings();
|
|
||||||
ClientAutorization* getAuthData();
|
ClientAutorization* getAuthData();
|
||||||
|
|
||||||
|
QString getAddress();
|
||||||
|
QString getPort();
|
||||||
signals:
|
signals:
|
||||||
void sigTryLogin();
|
void sigTryLogin();
|
||||||
void sigSaveServerSettings();
|
void sigSaveServerSettings();
|
||||||
|
|||||||
@@ -72,11 +72,7 @@ void UpdateNotifyWidget::showWithFill()
|
|||||||
{
|
{
|
||||||
clearList();
|
clearList();
|
||||||
|
|
||||||
if(!versionContainer->getLocalVersionData()->getIsChangeable())
|
if(!versionContainer->getServerVersionData()->getIsChangeable())
|
||||||
{
|
|
||||||
showTryChangeBase();
|
|
||||||
}
|
|
||||||
else if(!versionContainer->getServerVersionData()->getIsChangeable())
|
|
||||||
{
|
{
|
||||||
showTryChangeBase();
|
showTryChangeBase();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Bootstrap::Bootstrap(QObject *parent) : QObject(parent)
|
|||||||
void Bootstrap::initialize()
|
void Bootstrap::initialize()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<PacketType>("PacketType");
|
qRegisterMetaType<PacketType>("PacketType");
|
||||||
|
qRegisterMetaType<ErrorsEnum>("ErrorsEnum");
|
||||||
|
|
||||||
widgetManager->initialize();
|
widgetManager->initialize();
|
||||||
coreManager->initialize(widgetManager, workerThread);
|
coreManager->initialize(widgetManager, workerThread);
|
||||||
|
|||||||
@@ -17,10 +17,13 @@ CoreManager::CoreManager(QObject *parent) :
|
|||||||
resourceManager = new ResourceManager;
|
resourceManager = new ResourceManager;
|
||||||
postProcessorSystem = new PostProcessorSystem;
|
postProcessorSystem = new PostProcessorSystem;
|
||||||
client = new Client;
|
client = new Client;
|
||||||
|
settings = new Settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreManager::initialize(WidgetManager *widgetManager,QThread *workerThread)
|
void CoreManager::initialize(WidgetManager *widgetManager,QThread *workerThread)
|
||||||
{
|
{
|
||||||
|
createNewServerSettings();
|
||||||
|
|
||||||
this->workerThread = workerThread;
|
this->workerThread = workerThread;
|
||||||
this->widgetManager = widgetManager;
|
this->widgetManager = widgetManager;
|
||||||
|
|
||||||
@@ -44,19 +47,18 @@ void CoreManager::initialize(WidgetManager *widgetManager,QThread *workerThread)
|
|||||||
|
|
||||||
void CoreManager::start()
|
void CoreManager::start()
|
||||||
{
|
{
|
||||||
saveServerSettingsWithConnect();
|
|
||||||
checkAppAvailable();
|
checkAppAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreManager::loadStaticData()
|
void CoreManager::loadStaticData()
|
||||||
{
|
{
|
||||||
ServerSettings *currentSettings = dataParser->getClientSettings();
|
settings = dataParser->getSettings();
|
||||||
setLanguage(currentSettings->Language);
|
setLanguage(settings->Language);
|
||||||
setLocalVersion();
|
setLocalVersion();
|
||||||
externalExecuter->setIsAutoStart(currentSettings->isAutoStart);
|
externalExecuter->setIsAutoStart(settings->isAutoStart);
|
||||||
bool appAvailable = externalExecuter->findApp();
|
bool appAvailable = externalExecuter->findApp();
|
||||||
widgetManager->setAppAvailable(appAvailable);
|
widgetManager->setAppAvailable(appAvailable);
|
||||||
emit sigSetLoadSettings(currentSettings);
|
emit sigSetLoadSettings(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreManager::binding()
|
void CoreManager::binding()
|
||||||
@@ -68,7 +70,8 @@ void CoreManager::binding()
|
|||||||
connect(this,&CoreManager::sigSendPacketType,sendSystem,&SendSystem::sendPacketType,Qt::AutoConnection);
|
connect(this,&CoreManager::sigSendPacketType,sendSystem,&SendSystem::sendPacketType,Qt::AutoConnection);
|
||||||
connect(this,&CoreManager::sigSendCheckUpdate,sendSystem,&SendSystem::sendCheckHash,Qt::AutoConnection);
|
connect(this,&CoreManager::sigSendCheckUpdate,sendSystem,&SendSystem::sendCheckHash,Qt::AutoConnection);
|
||||||
connect(this,&CoreManager::sigSendXMLAnswer,sendSystem,&SendSystem::xmlAnswer,Qt::AutoConnection);
|
connect(this,&CoreManager::sigSendXMLAnswer,sendSystem,&SendSystem::xmlAnswer,Qt::AutoConnection);
|
||||||
connect(this,&CoreManager::sigSendAutorization,sendSystem,&SendSystem::sendClientAutorization);
|
connect(this,&CoreManager::sigSendAutorization,sendSystem,&SendSystem::sendClientAutorization,Qt::AutoConnection);
|
||||||
|
connect(this,&CoreManager::sigGetClientSettings,dataParser,&DataParser::getSettings,Qt::DirectConnection);
|
||||||
|
|
||||||
connect(this,&CoreManager::sigSendUpdateToServer,updateController,&UpdateController::checkCanUpdate,Qt::AutoConnection);
|
connect(this,&CoreManager::sigSendUpdateToServer,updateController,&UpdateController::checkCanUpdate,Qt::AutoConnection);
|
||||||
connect(this,&CoreManager::sigGetConnected,tcpClient,&TCPClient::getIsConnected);
|
connect(this,&CoreManager::sigGetConnected,tcpClient,&TCPClient::getIsConnected);
|
||||||
@@ -77,8 +80,7 @@ void CoreManager::binding()
|
|||||||
connect(this,&CoreManager::sigSetLoadSettings,widgetManager,&WidgetManager::slotSetLoadSettings,Qt::AutoConnection);
|
connect(this,&CoreManager::sigSetLoadSettings,widgetManager,&WidgetManager::slotSetLoadSettings,Qt::AutoConnection);
|
||||||
|
|
||||||
connect(postProcessorSystem,&PostProcessorSystem::sigCallUpdateList,this,&CoreManager::callUpdateList,Qt::AutoConnection);
|
connect(postProcessorSystem,&PostProcessorSystem::sigCallUpdateList,this,&CoreManager::callUpdateList,Qt::AutoConnection);
|
||||||
connect(postProcessorSystem,&PostProcessorSystem::sigSocketDisabled,this,&CoreManager::lostConnection,Qt::AutoConnection);
|
connect(postProcessorSystem,&PostProcessorSystem::sigShowError,this,&CoreManager::showError,Qt::AutoConnection);
|
||||||
connect(postProcessorSystem,&PostProcessorSystem::sigServerBlocked,this,&CoreManager::serverBlocked,Qt::AutoConnection);
|
|
||||||
connect(postProcessorSystem,&PostProcessorSystem::sigStartCompare,hashComparer,&HashComparer::CompareDeltas,Qt::AutoConnection);
|
connect(postProcessorSystem,&PostProcessorSystem::sigStartCompare,hashComparer,&HashComparer::CompareDeltas,Qt::AutoConnection);
|
||||||
connect(postProcessorSystem,&PostProcessorSystem::sigSaveLoginData,this,&CoreManager::checkLoginResult,Qt::AutoConnection);
|
connect(postProcessorSystem,&PostProcessorSystem::sigSaveLoginData,this,&CoreManager::checkLoginResult,Qt::AutoConnection);
|
||||||
|
|
||||||
@@ -106,6 +108,7 @@ void CoreManager::binding()
|
|||||||
connect(sendSystem,&SendSystem::sigSend,this,&CoreManager::calcUpdateProgress,Qt::AutoConnection);
|
connect(sendSystem,&SendSystem::sigSend,this,&CoreManager::calcUpdateProgress,Qt::AutoConnection);
|
||||||
|
|
||||||
connect(sendSystem,&SendSystem::sigGetXmlAnswer,dataParserOutput,&DataParserOutput::xmlAnswer_notify,Qt::DirectConnection);
|
connect(sendSystem,&SendSystem::sigGetXmlAnswer,dataParserOutput,&DataParserOutput::xmlAnswer_notify,Qt::DirectConnection);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreManager::initializeSystems()
|
void CoreManager::initializeSystems()
|
||||||
@@ -123,7 +126,7 @@ void CoreManager::initializeSystems()
|
|||||||
|
|
||||||
screenChecker->check();
|
screenChecker->check();
|
||||||
|
|
||||||
emit sigSetConnect(dataParser->getClientSettings());
|
emit sigSetConnect(dataParser->getSettings());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreManager::initializeWidgets()
|
void CoreManager::initializeWidgets()
|
||||||
@@ -164,28 +167,34 @@ void CoreManager::callUpdateList()
|
|||||||
emit sigSendXMLAnswer(cmd_GetServerHash);
|
emit sigSendXMLAnswer(cmd_GetServerHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreManager::lostConnection()
|
void CoreManager::showError(ErrorsEnum errorEnum)
|
||||||
{
|
{
|
||||||
widgetManager->setLostConnectionState();
|
widgetManager->getMainWindow()->showError(errorEnum);
|
||||||
client->setIsLoggedIn(false);
|
|
||||||
|
if (errorEnum == ErrorsEnum::BLOCKED)
|
||||||
|
{
|
||||||
|
widgetManager->getEntryWidget()->showLoginWidget(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreManager::serverBlocked()
|
|
||||||
{
|
|
||||||
widgetManager->getMainWindow()->serverBlocked();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CoreManager::setServerVersion(StreamingVersionData *version)
|
void CoreManager::setServerVersion(StreamingVersionData *version)
|
||||||
{
|
{
|
||||||
widgetManager->getMainWindow()->setServerVersion(version);
|
widgetManager->getMainWindow()->setServerVersion(version);
|
||||||
|
|
||||||
|
if (version->getViewName() == settings->versionData.getViewName())
|
||||||
|
{
|
||||||
|
settings->versionData.setIsChangeable(version->getIsChangeable());
|
||||||
|
versionContainer->getLocalVersionData()->setIsChangeable(version->getIsChangeable());
|
||||||
|
dataParserOutput->updateServerSettings(settings);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreManager::setLocalVersion()
|
void CoreManager::setLocalVersion()
|
||||||
{
|
{
|
||||||
ServerSettings *currentSettings = dataParser->getClientSettings();
|
|
||||||
StreamingVersionData *version = new StreamingVersionData;
|
StreamingVersionData *version = new StreamingVersionData;
|
||||||
version->setName(currentSettings->LocalVersionName);
|
version->setName(settings->LocalVersionName);
|
||||||
version->setIsChangeable(currentSettings->versionData.getIsChangeable());
|
version->setIsChangeable(settings->versionData.getIsChangeable());
|
||||||
|
|
||||||
versionContainer->setLocalVersionData(version);
|
versionContainer->setLocalVersionData(version);
|
||||||
widgetManager->getMainWindow()->setClientVersionName(versionContainer->getLocalVersion());
|
widgetManager->getMainWindow()->setClientVersionName(versionContainer->getLocalVersion());
|
||||||
@@ -198,7 +207,7 @@ void CoreManager::checkLoginResult(ServerAuthorization *auth)
|
|||||||
widgetManager->activateLoadingAnimation(true);
|
widgetManager->activateLoadingAnimation(true);
|
||||||
checkAccessType(auth->AccessType);
|
checkAccessType(auth->AccessType);
|
||||||
dataParserOutput->createAuthData(auth);
|
dataParserOutput->createAuthData(auth);
|
||||||
setLocalVersion();
|
//setLocalVersion();
|
||||||
widgetManager->setLoginSuccess();
|
widgetManager->setLoginSuccess();
|
||||||
widgetManager->getMainWindow()->setClientVersionName(versionContainer->getLocalVersion());
|
widgetManager->getMainWindow()->setClientVersionName(versionContainer->getLocalVersion());
|
||||||
client->setLogin(auth->ClientName);
|
client->setLogin(auth->ClientName);
|
||||||
@@ -321,7 +330,7 @@ void CoreManager::loadComplete()
|
|||||||
dataParserOutput->changeVersion(versionContainer->getServerVersionData());
|
dataParserOutput->changeVersion(versionContainer->getServerVersionData());
|
||||||
setLocalVersion();
|
setLocalVersion();
|
||||||
checkAutoStart();
|
checkAutoStart();
|
||||||
widgetManager->getMainWindow()->setClientVersionName(versionContainer->getLocalVersion());
|
widgetManager->getMainWindow()->setClientVersionName(versionContainer->getServerVersionData()->getViewName());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreManager::loadToServer()
|
void CoreManager::loadToServer()
|
||||||
@@ -336,7 +345,7 @@ void CoreManager::undoCurrentChanges()
|
|||||||
isRecovery = true;
|
isRecovery = true;
|
||||||
widgetManager->setUndoCurrentChangesState();
|
widgetManager->setUndoCurrentChangesState();
|
||||||
emit sigSendCheckUpdate();
|
emit sigSendCheckUpdate();
|
||||||
emit sigSendPacketType(PacketType::TYPE_UPDATE);
|
//emit sigSendPacketType(PacketType::TYPE_UPDATE);
|
||||||
//тут был таймер
|
//тут был таймер
|
||||||
isRecovery = false;
|
isRecovery = false;
|
||||||
}
|
}
|
||||||
@@ -361,9 +370,10 @@ void CoreManager::saveServerSettingsWithConnect()
|
|||||||
EntryWidget *entryWidget = widgetManager->getEntryWidget();
|
EntryWidget *entryWidget = widgetManager->getEntryWidget();
|
||||||
|
|
||||||
entryWidget->isActive(false);
|
entryWidget->isActive(false);
|
||||||
ServerSettings *settings = entryWidget->getServerSettings();
|
settings->LocalVersionName = dataParser->getSettings()->LocalVersionName;
|
||||||
settings->LocalVersionName = dataParser->getClientSettings()->LocalVersionName;
|
settings->Address = entryWidget->getAddress();
|
||||||
dataParserOutput->createServerSettings(settings);
|
settings->Port = entryWidget->getPort();
|
||||||
|
dataParserOutput->updateServerSettings(settings);
|
||||||
|
|
||||||
if(tcpClient->getIsConnected())
|
if(tcpClient->getIsConnected())
|
||||||
{
|
{
|
||||||
@@ -377,6 +387,11 @@ void CoreManager::saveServerSettingsWithConnect()
|
|||||||
emit sigSetConnect(settings);
|
emit sigSetConnect(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CoreManager::createNewServerSettings()
|
||||||
|
{
|
||||||
|
dataParserOutput->createServerSettings();
|
||||||
|
}
|
||||||
|
|
||||||
void CoreManager::checkAppAvailable()
|
void CoreManager::checkAppAvailable()
|
||||||
{
|
{
|
||||||
bool isAvailable = externalExecuter->findApp();
|
bool isAvailable = externalExecuter->findApp();
|
||||||
|
|||||||
@@ -54,15 +54,16 @@ signals:
|
|||||||
void sigInitializeClient(RecognizeSystem *recognize,SendSystem *sendSystem);
|
void sigInitializeClient(RecognizeSystem *recognize,SendSystem *sendSystem);
|
||||||
void sigSendPacketType(PacketType packetType);
|
void sigSendPacketType(PacketType packetType);
|
||||||
void sigSendXMLAnswer(QString answer);
|
void sigSendXMLAnswer(QString answer);
|
||||||
void sigSetConnect(ServerSettings* serverSettings);
|
void sigSetConnect(Settings* serverSettings);
|
||||||
void sigCalculateHash();
|
void sigCalculateHash();
|
||||||
void sigSendAutorization();
|
void sigSendAutorization();
|
||||||
void sigSendCheckUpdate();
|
void sigSendCheckUpdate();
|
||||||
bool sigGetConnected();
|
bool sigGetConnected();
|
||||||
void sigSendUpdateToServer();
|
void sigSendUpdateToServer();
|
||||||
|
Settings *sigGetClientSettings();
|
||||||
|
|
||||||
|
|
||||||
void sigSetLoadSettings(ServerSettings *serverSettings);
|
void sigSetLoadSettings(Settings *serverSettings);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
@@ -79,6 +80,7 @@ private:
|
|||||||
ResourceManager *resourceManager;
|
ResourceManager *resourceManager;
|
||||||
PostProcessorSystem *postProcessorSystem;
|
PostProcessorSystem *postProcessorSystem;
|
||||||
Client *client;
|
Client *client;
|
||||||
|
Settings *settings;
|
||||||
|
|
||||||
WidgetManager *widgetManager;
|
WidgetManager *widgetManager;
|
||||||
|
|
||||||
@@ -94,8 +96,7 @@ private:
|
|||||||
void binding();
|
void binding();
|
||||||
void initializeSystems();
|
void initializeSystems();
|
||||||
void callUpdateList();
|
void callUpdateList();
|
||||||
void lostConnection();
|
void showError(ErrorsEnum errorEnum);
|
||||||
void serverBlocked();
|
|
||||||
void checkLoginResult(ServerAuthorization *auth);
|
void checkLoginResult(ServerAuthorization *auth);
|
||||||
void checkAccessType(const QString &accessType);
|
void checkAccessType(const QString &accessType);
|
||||||
void setServerVersion(StreamingVersionData *version);
|
void setServerVersion(StreamingVersionData *version);
|
||||||
@@ -106,6 +107,7 @@ private:
|
|||||||
void checkUpdate();
|
void checkUpdate();
|
||||||
|
|
||||||
void setInlineDebug(QString text);
|
void setInlineDebug(QString text);
|
||||||
|
void createNewServerSettings();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COREMANAGER_H
|
#endif // COREMANAGER_H
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent),
|
: QMainWindow(parent),
|
||||||
ui(new Ui::MainWindow),
|
ui(new Ui::MainWindow),
|
||||||
bottomRightPosition(QRect(530,505,250,40)),
|
bottomRightPosition(QRect(530,506,250,40)),
|
||||||
offlinePosition(240,340,300,40)
|
offlinePosition(240,340,300,40)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@@ -97,16 +97,37 @@ void MainWindow::setNeedUpdateState(const QString& notifyText)
|
|||||||
ui->autostartCheckBox->show();
|
ui->autostartCheckBox->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::serverBlocked()
|
|
||||||
{
|
|
||||||
ui->notificationLabel->show();
|
|
||||||
QPalette palette = ui->notificationLabel->palette();
|
|
||||||
QColor orangeColor(255,165,0);
|
|
||||||
palette.setColor(ui->notificationLabel->foregroundRole(),orangeColor);
|
|
||||||
ui->notificationLabel->setText(tr("Сервер заблокирован"));
|
|
||||||
|
|
||||||
ui->notificationLabel->setPalette(palette);
|
void MainWindow::showError(ErrorsEnum errorNum)
|
||||||
timer->start(3000);
|
{
|
||||||
|
if (errorNum == ErrorsEnum::BLOCKED)
|
||||||
|
{
|
||||||
|
serverNotifyShow(tr("Сервер заблокирован"));
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (errorNum == ErrorsEnum::DISABLE)
|
||||||
|
{
|
||||||
|
showConnectionEmpty();
|
||||||
|
}
|
||||||
|
else if (errorNum == ErrorsEnum::LOGIN_OR_PASS)
|
||||||
|
{
|
||||||
|
serverNotifyShow(tr("Неверный логин/пароль"));
|
||||||
|
}
|
||||||
|
else if (errorNum == ErrorsEnum::ARCHIVED)
|
||||||
|
{
|
||||||
|
serverNotifyShow(tr("Пользователь в архиве"));
|
||||||
|
}
|
||||||
|
else if (errorNum == ErrorsEnum::ALREADYLOGIN)
|
||||||
|
{
|
||||||
|
serverNotifyShow(tr("Пользователь уже в сети"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::serverNotifyShow(QString text, int durationMS)
|
||||||
|
{
|
||||||
|
ui->notificationLabel->setText(text);
|
||||||
|
ui->notificationLabel->show();
|
||||||
|
timer->start(durationMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setLoginSuccessState()
|
void MainWindow::setLoginSuccessState()
|
||||||
@@ -116,19 +137,6 @@ void MainWindow::setLoginSuccessState()
|
|||||||
ui->versionLayoutWidget->show();
|
ui->versionLayoutWidget->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setLoginFailedState()
|
|
||||||
{
|
|
||||||
ui->notificationLabel->setText(tr("Неверный логин/пароль"));
|
|
||||||
timer->setInterval(3000);
|
|
||||||
timer->start();
|
|
||||||
|
|
||||||
QPalette palette = ui->notificationLabel->palette();
|
|
||||||
palette.setColor(ui->notificationLabel->foregroundRole(), Qt::red);
|
|
||||||
|
|
||||||
ui->notificationLabel->setPalette(palette);
|
|
||||||
ui->notificationLabel->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::setStartOfflineButton(bool isAvailable)
|
void MainWindow::setStartOfflineButton(bool isAvailable)
|
||||||
{
|
{
|
||||||
ui->offlineStartButton->setEnabled(isAvailable);
|
ui->offlineStartButton->setEnabled(isAvailable);
|
||||||
@@ -327,7 +335,7 @@ void MainWindow::addWidgetToInteractiveGroup(EntryWidget *entryWidget)
|
|||||||
this->entryWidget = entryWidget;
|
this->entryWidget = entryWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setLoadSettings(ServerSettings *serverSettings)
|
void MainWindow::setLoadSettings(Settings *serverSettings)
|
||||||
{
|
{
|
||||||
ui->retranslateUi(this);
|
ui->retranslateUi(this);
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,8 @@ public:
|
|||||||
void initialize(ResourceManager *resourceManager);
|
void initialize(ResourceManager *resourceManager);
|
||||||
void addWidgetToChangeGroup(CommonButtonGroupWidget *commonWidgetGroup);
|
void addWidgetToChangeGroup(CommonButtonGroupWidget *commonWidgetGroup);
|
||||||
void addWidgetToInteractiveGroup(EntryWidget *entryWidget);
|
void addWidgetToInteractiveGroup(EntryWidget *entryWidget);
|
||||||
void setLoadSettings(ServerSettings *serverSettings);
|
void setLoadSettings(Settings *serverSettings);
|
||||||
void setLoginSuccessState();
|
void setLoginSuccessState();
|
||||||
void setLoginFailedState();
|
|
||||||
void setClientVersionName(const QString &versionName);
|
void setClientVersionName(const QString &versionName);
|
||||||
|
|
||||||
void loadToServer();
|
void loadToServer();
|
||||||
@@ -47,9 +46,11 @@ public:
|
|||||||
void showOfflineButton(bool flag);
|
void showOfflineButton(bool flag);
|
||||||
void setStartOfflineButton(bool isAvailable);
|
void setStartOfflineButton(bool isAvailable);
|
||||||
void setStartState();
|
void setStartState();
|
||||||
void serverBlocked();
|
void serverNotifyShow(QString text, int durationMS = 3000);
|
||||||
|
void showError(ErrorsEnum errorNum);
|
||||||
|
|
||||||
QHBoxLayout *getDisplayLayout() const;
|
QHBoxLayout *getDisplayLayout() const;
|
||||||
|
void serverBlockedState();
|
||||||
public slots:
|
public slots:
|
||||||
void slotShowUpdateInfo();
|
void slotShowUpdateInfo();
|
||||||
void slotConnectionState(bool flag);
|
void slotConnectionState(bool flag);
|
||||||
|
|||||||
@@ -427,7 +427,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>530</x>
|
<x>530</x>
|
||||||
<y>510</y>
|
<y>511</y>
|
||||||
<width>250</width>
|
<width>250</width>
|
||||||
<height>40</height>
|
<height>40</height>
|
||||||
</rect>
|
</rect>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 16 KiB |
@@ -35,7 +35,7 @@ void WidgetManager::binding()
|
|||||||
connect(commonButtonGroupWidget,&CommonButtonGroupWidget::sigUpdateCommonWidget,mainWindow,&MainWindow::slotCommonWidgetState);
|
connect(commonButtonGroupWidget,&CommonButtonGroupWidget::sigUpdateCommonWidget,mainWindow,&MainWindow::slotCommonWidgetState);
|
||||||
connect(mainWindow,&MainWindow::sigShowSettings,this,&WidgetManager::showSettings,Qt::AutoConnection);
|
connect(mainWindow,&MainWindow::sigShowSettings,this,&WidgetManager::showSettings,Qt::AutoConnection);
|
||||||
}
|
}
|
||||||
void WidgetManager::slotSetLoadSettings(ServerSettings *settings)
|
void WidgetManager::slotSetLoadSettings(Settings *settings)
|
||||||
{
|
{
|
||||||
mainWindow->setLoadSettings(settings);
|
mainWindow->setLoadSettings(settings);
|
||||||
entryWidget->fillSettings(settings);
|
entryWidget->fillSettings(settings);
|
||||||
@@ -60,7 +60,6 @@ void WidgetManager::setLoginSuccess()
|
|||||||
void WidgetManager::setLoginFailed()
|
void WidgetManager::setLoginFailed()
|
||||||
{
|
{
|
||||||
entryWidget->showLoginWidget(true);
|
entryWidget->showLoginWidget(true);
|
||||||
mainWindow->setLoginFailedState();
|
|
||||||
activateLoadingAnimation(false);
|
activateLoadingAnimation(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +160,7 @@ void WidgetManager::setUndoCurrentChangesState()
|
|||||||
waitAnimationWidget->showWithPlay();
|
waitAnimationWidget->showWithPlay();
|
||||||
mainWindow->undoCurrentChanges();
|
mainWindow->undoCurrentChanges();
|
||||||
updateWidget->hide();
|
updateWidget->hide();
|
||||||
commonButtonGroupWidget->showProgressBar(false);
|
commonButtonGroupWidget->showProgressBar(true);
|
||||||
//waitAnimationWidget->hideWithStop();
|
//waitAnimationWidget->hideWithStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
void slotInlineDebug(const QString &text);
|
void slotInlineDebug(const QString &text);
|
||||||
public slots:
|
public slots:
|
||||||
void showSettings(bool isActive);
|
void showSettings(bool isActive);
|
||||||
void slotSetLoadSettings(ServerSettings *settings);
|
void slotSetLoadSettings(Settings *settings);
|
||||||
void slotActivateLoadAnimation(bool flag);
|
void slotActivateLoadAnimation(bool flag);
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user