mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
feat: link busy state with lock icon
This commit is contained in:
@@ -116,6 +116,8 @@ void CommonClientHandler::slot_sendPacketToAllClients(PacketType packetType)
|
||||
handler->sendPacketType(packetType);
|
||||
Logger::instance().log("AllSending " + handler->getClient()->getLogin() + " " + enumToString(packetType));
|
||||
}
|
||||
|
||||
emit sigSetServerState(packetType);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,9 +137,6 @@ void CommonClientHandler::slot_sendTaskToClient(QString fullNameClient,QString t
|
||||
|
||||
QString peerAddress = handler->getSocket()->peerAddress().toString();
|
||||
QString peerPort = QString::number(handler->getSocket()->peerPort());
|
||||
|
||||
QString str = "Task To Client [" + peerAddress + ":" + peerPort + "] : " + textTask;
|
||||
emit sigSendToLogger(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
|
||||
void slot_DocsChanged();
|
||||
signals:
|
||||
void sigSendToLogger(QString text);
|
||||
void sigSetServerState(PacketType packetType);
|
||||
private:
|
||||
QMap<int, ClientHandler*> *clientsMap;
|
||||
ProcessingSystem *processingSystem;
|
||||
|
||||
@@ -228,6 +228,7 @@ void SendSystem::sendPacketType(PacketType packetType)
|
||||
message.append(reinterpret_cast<char*>(&type), sizeof(int));
|
||||
socket->write(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SendSystem::sendHello()
|
||||
|
||||
@@ -234,6 +234,20 @@ void ServerLMSWidget::on_btnSettings_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_trySetServerState(PacketType packetType)
|
||||
{
|
||||
if (packetType == PacketType::BUSY)
|
||||
{
|
||||
server->blockAutorization();
|
||||
updateStateServer();
|
||||
}
|
||||
else if (packetType == PacketType::FREE)
|
||||
{
|
||||
server->unBlockAutorization();
|
||||
updateStateServer();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::setLanguageInterfase()
|
||||
{
|
||||
ServerDBSettings settings;
|
||||
@@ -311,6 +325,7 @@ void ServerLMSWidget::startInitialization()
|
||||
|
||||
commonClientHandler = new CommonClientHandler;
|
||||
connect(this,&ServerLMSWidget::signal_DocsChanged,commonClientHandler, &CommonClientHandler::slot_DocsChanged);
|
||||
connect(commonClientHandler,&CommonClientHandler::sigSetServerState,this,&ServerLMSWidget::slot_trySetServerState);
|
||||
|
||||
server = new MultiThreadServer(this,updateController,processingSystem,dataParser,6000);
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ private slots:
|
||||
void on_btnStartServer_clicked();
|
||||
void on_btnStopServer_clicked();
|
||||
void on_btnSettings_clicked();
|
||||
void slot_trySetServerState(PacketType packetType);
|
||||
|
||||
private:
|
||||
void setLanguageInterfase();
|
||||
|
||||
Reference in New Issue
Block a user