карта блок-в. Блокировка правильная. Множ. доступ

This commit is contained in:
2026-01-21 15:44:01 +03:00
parent fe75f2c6ca
commit 2772c3aaba
26 changed files with 146 additions and 91 deletions

View File

@@ -294,7 +294,7 @@ QByteArray DataParser::createDeAuthMessage(ClientDeAutorization *deAuth)
return array;
}
QByteArray DataParser::createQueryBlockAuth(bool block)
QByteArray DataParser::createQueryBlockAuth(bool block, QString type)
{
QByteArray array;
QXmlStreamWriter xmlWriter(&array);
@@ -304,6 +304,7 @@ QByteArray DataParser::createQueryBlockAuth(bool block)
xmlWriter.writeStartElement("BlockAuth");
xmlWriter.writeAttribute("Block", block ? "1" : "0");
xmlWriter.writeAttribute("type", type);
xmlWriter.writeEndElement();
xmlWriter.writeEndElement();

View File

@@ -29,7 +29,7 @@ public:
QByteArray createQueryListSubProcMessage(QString dmCode);
QByteArray createDeAuthMessage(ClientDeAutorization *deAuth);
QByteArray createQueryBlockAuth(bool block);
QByteArray createQueryBlockAuth(bool block, QString type);
void createAuthData(ServerAuthorization *serverAuth);
void createAuthDataOffline(QString username,QString pass);

View File

@@ -260,12 +260,12 @@ void RecognizeSystem::recognize(QTcpSocket *socket)
if(packetType == PacketType::BUSY)
{
emit sigAnimationActivated(true);
//emit sigAnimationActivated(true);
}
if(packetType == PacketType::FREE)
{
emit sigAnimationActivated(false);
//emit sigAnimationActivated(false);
}
if(packetType == PacketType::HASH_READY)

View File

@@ -57,7 +57,6 @@ signals:
void sigShowServerDataList(QList<StreamingVersionData*> *versions);
void sigSetVersion(StreamingVersionData* serverVersion);
void sigNotifyVersionControl(QString text);
void sigAnimationActivated(bool flag);
void sigHashReady();
void sigAnswerQuerySubProc(QList<SubProc> listSubProc, QString parentTask_dmCode);

View File

@@ -168,7 +168,6 @@ void ConnectorToServer::bindConnection()
connect(recognizeSystem,&RecognizeSystem::signal_AnswerDocsChanged,this,&ConnectorToServer::slot_AnswerDocsChanged);
connect(recognizeSystem, &RecognizeSystem::sigSetVersion, this, &ConnectorToServer::signal_SetVersion);
connect(recognizeSystem, &RecognizeSystem::sigAnimationActivated, this, &ConnectorToServer::signal_AnimationActivated);
connect(this, &ConnectorToServer::signal_SendCopyVersion, sendSystem, &SendSystem::sendCopyVersion);
connect(this, &ConnectorToServer::signal_SendDeleteVersion, sendSystem, &SendSystem::sendDeleteVersion);

View File

@@ -47,7 +47,7 @@ public:
bool sendQueryTasksXML(QString type);
bool sendQueryListSubProc(QString dmCode);
bool sendQueryBlockAuth(bool block);
bool sendQueryBlockAuth(bool block, QString type);
void sendShowVersionSelect();
bool sendClientNotify(QString command);
@@ -149,7 +149,6 @@ signals:
void signal_AnswerDocsChanged();
void signal_SetVersion(StreamingVersionData* serverVersion);
void signal_AnimationActivated(bool flag);
void signal_SendDeleteVersion(StreamingVersionData *streaming);
void signal_SendSwitchVersion(StreamingVersionData *selectVersion);

View File

@@ -95,14 +95,14 @@ bool ConnectorToServer::sendQueryListSubProc(QString dmCode)
return true;
}
bool ConnectorToServer::sendQueryBlockAuth(bool block)
bool ConnectorToServer::sendQueryBlockAuth(bool block, QString type)
{
if (!client->getIsConnected())
{
return false;
}
QByteArray array = dataParser->createQueryBlockAuth(block);
QByteArray array = dataParser->createQueryBlockAuth(block, type);
emit sigSendAnswerToServer(array);
return true;

View File

@@ -77,7 +77,7 @@ void ViewerInstructors::slot_receiveMessage(ClientMessage clientMessage)
void ViewerInstructors::on_btnEditorInstructors_clicked()
{
connectorToServer->sendQueryBlockAuth(true);
connectorToServer->sendQueryBlockAuth(true, "EditorInstructors");
dlgRedactor = new DialogRedactorInstructors(connectorToServer, adminMode, this);
dlgRedactor->exec();
@@ -91,7 +91,7 @@ void ViewerInstructors::on_btnEditorInstructors_clicked()
if(authComplited)
loadInstructorsFromDB();
connectorToServer->sendQueryBlockAuth(false);
connectorToServer->sendQueryBlockAuth(false, "EditorInstructors");
}
void ViewerInstructors::on_treeWidgetCurrentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)

View File

@@ -214,6 +214,8 @@ void DialogSettings::on_btnSetVersion_clicked()
if(connectorToServer)
if(connectorToServer->getIsConnected())
{
connectorToServer->sendQueryBlockAuth(true, "VersionControl");
dlgVersionControl = new DialogVersionControl(connectorToServer, this);
dlgVersionControl->initialize(connectorToServer->getLoginName());
dlgVersionControl->exec();
@@ -222,7 +224,9 @@ void DialogSettings::on_btnSetVersion_clicked()
{
delete dlgVersionControl;
dlgVersionControl = nullptr;
}
}
connectorToServer->sendQueryBlockAuth(false, "VersionControl");
}
}

View File

@@ -58,7 +58,6 @@ void DialogVersionControl::initialize(QString authorName)
this->authorName = authorName;
connect (connectorToServer, &ConnectorToServer::signal_SetVersion, this, &DialogVersionControl::slot_SetVersion);
connect(connectorToServer, &ConnectorToServer::signal_AnimationActivated, this, &DialogVersionControl::slot_activateLoadAnimation);
connect(connectorToServer, &ConnectorToServer::signal_showServerList, this, &DialogVersionControl::slot_showServerList);
connect(connectorToServer, &ConnectorToServer::signal_NotifyVersionControl, this, &DialogVersionControl::slot_NotifyVersionControl);
@@ -69,6 +68,7 @@ void DialogVersionControl::initialize(QString authorName)
connect(this, &DialogVersionControl::signal_getVersion, connectorToServer, &ConnectorToServer::slot_getVersion);
waitAnimationWidget->showWithPlay();
emit signal_getVersion();
}
@@ -124,6 +124,7 @@ void DialogVersionControl::sendCopyEmit(QString newName)
}
versionContainer->setLocalVersionData(selectedVersion);
waitAnimationWidget->showWithPlay();
emit sigSendCopyVersion(result);
}
@@ -144,6 +145,7 @@ void DialogVersionControl::on_createDuplicateButton_clicked()
case QDialog::Accepted:
{
QString newName = dlgNewVersion->getNewName();
waitAnimationWidget->showWithPlay();
sendCopyEmit(newName);
break;
}
@@ -171,6 +173,7 @@ void DialogVersionControl::on_deleteVersionButton_clicked()
if(SpecMsgBox::WarningYesNo(this, tr("The deletion will be irrevocable.\nDelete it anyway?")) == QDialog::Accepted)
{
waitAnimationWidget->showWithPlay();
emit sigSendDeleteVersion(selectedVersion);
}
}
@@ -186,24 +189,14 @@ void DialogVersionControl::on_switchServerVersionButton_clicked()
//versionContainer->setServerVersionData(selectedVersion);
//ui->verValue->setText(selectedVersion->getViewName());
waitAnimationWidget->showWithPlay();
emit sigSendSwitchVersion(selectedVersion);
}
void DialogVersionControl::slot_activateLoadAnimation(bool flag)
{
if (flag)
{
waitAnimationWidget->showWithPlay();
}
else
{
waitAnimationWidget->hideWithStop();
}
}
void DialogVersionControl::slot_showServerList(QList<StreamingVersionData *> *serverList)
{
fillView(serverList);
waitAnimationWidget->hideWithStop();
}
void DialogVersionControl::slot_SetVersion(StreamingVersionData *serverVersion)
@@ -215,11 +208,15 @@ void DialogVersionControl::slot_SetVersion(StreamingVersionData *serverVersion)
connectorToServer->sendShowVersionSelect();
flGetVersion = true;
waitAnimationWidget->hideWithStop();
}
void DialogVersionControl::slot_NotifyVersionControl(QString text)
{
SpecMsgBox::WarningClose(this, text);
waitAnimationWidget->hideWithStop();
}
void DialogVersionControl::resizeEvent(QResizeEvent *event)

View File

@@ -36,7 +36,6 @@ private slots:
void on_verListView_itemClicked(QListWidgetItem *item);
private slots:
void slot_activateLoadAnimation(bool flag);
void slot_showServerList(QList<StreamingVersionData*> *serverList);
void slot_SetVersion(StreamingVersionData* serverVersion);
void slot_NotifyVersionControl(QString text);

View File

@@ -111,7 +111,7 @@ void ViewerTrainees::slot_receiveMessage(ClientMessage clientMessage)
void ViewerTrainees::on_btnEditorTrainees_clicked()
{
connectorToServer->sendQueryBlockAuth(true);
connectorToServer->sendQueryBlockAuth(true, "EditorTrainees");
dlgRedactor = new DialogRedactorTrainees(connectorToServer, adminMode, this);
dlgRedactor->exec();
@@ -125,7 +125,7 @@ void ViewerTrainees::on_btnEditorTrainees_clicked()
if(authComplited)
loadTraineesFromDB();
connectorToServer->sendQueryBlockAuth(false);
connectorToServer->sendQueryBlockAuth(false, "EditorTrainees");
}
void ViewerTrainees::on_btnPersonalCard_clicked()