mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feat: add server blocked behaviour
This commit is contained in:
@@ -52,6 +52,7 @@ void MainWindow::initialize()
|
||||
connect(recognizeSystem,&RecognizeSystem::sigSocketDisabled,this,&MainWindow::lostConnection);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigSaveLoginData,this,&MainWindow::checkLoginResult);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigSocketWaitForReadyRead,client,&TCPClient::waitRead,Qt::AutoConnection);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigServerBlocked,this,&MainWindow::serverBlocked);
|
||||
|
||||
connect(client,&TCPClient::sigGetXmlAnswer,dataParser,&DataParser::slotGetXmlAnswer);
|
||||
|
||||
@@ -140,6 +141,18 @@ void MainWindow::lostConnection()
|
||||
slotConnectionState(false);
|
||||
}
|
||||
|
||||
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);
|
||||
timer->start(3000);
|
||||
}
|
||||
|
||||
void MainWindow::checkLoginResult(ServerAuthorization *serverAuth)
|
||||
{
|
||||
if (serverAuth->Result){
|
||||
@@ -287,8 +300,8 @@ void MainWindow::on_updateButton_clicked()
|
||||
|
||||
void MainWindow::on_startButton_clicked()
|
||||
{
|
||||
client->sendUnityConnect();
|
||||
externalExecuter->callApp();
|
||||
client->sendDisable();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user