feat: link busy state with lock icon

This commit is contained in:
semenov
2025-11-21 10:16:06 +03:00
parent bbef1f73b4
commit 73fd93a834
6 changed files with 32 additions and 11 deletions

View File

@@ -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);
}
}
}

View File

@@ -28,7 +28,7 @@ public:
void slot_DocsChanged();
signals:
void sigSendToLogger(QString text);
void sigSetServerState(PacketType packetType);
private:
QMap<int, ClientHandler*> *clientsMap;
ProcessingSystem *processingSystem;

View File

@@ -228,6 +228,7 @@ void SendSystem::sendPacketType(PacketType packetType)
message.append(reinterpret_cast<char*>(&type), sizeof(int));
socket->write(message);
}
}
void SendSystem::sendHello()

View File

@@ -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);

View File

@@ -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();