mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
отклонение запроса на Управление версиями
This commit is contained in:
@@ -592,6 +592,28 @@ void RecognizeSystem::xmlParser(QByteArray array)
|
||||
|
||||
}
|
||||
|
||||
if(xmlReader.name() == "TryBlock")
|
||||
{
|
||||
bool result = false;
|
||||
QString type = "";
|
||||
|
||||
foreach(const QXmlStreamAttribute &attr, xmlReader.attributes())
|
||||
{
|
||||
QString name = attr.name().toString();
|
||||
QString value = attr.value().toString();
|
||||
|
||||
if (name == "Result"){
|
||||
result = value == "true" ? true : false;
|
||||
}
|
||||
|
||||
if (name == "Type"){
|
||||
type = value;
|
||||
}
|
||||
}
|
||||
|
||||
emit sigTryBlock(result, type);
|
||||
}
|
||||
|
||||
|
||||
if(xmlReader.name() == "VersionList")
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@ signals:
|
||||
void sigErrorAuth(QString error);
|
||||
void sigAuth(ServerAuthorization *serverAuth);
|
||||
void sigDeAuth(ServerDeAuthorization *serverDeAuth);
|
||||
void sigTryBlock(bool result, QString type);
|
||||
void sigAnswerQueryToDB(QList<Instructor>* listInstructors,
|
||||
QList<Trainee>* listTrainees,
|
||||
QList<Group>* listGroups);
|
||||
|
||||
@@ -150,6 +150,8 @@ void ConnectorToServer::bindConnection()
|
||||
connect(recognizeSystem,&RecognizeSystem::sigAuth,this,&ConnectorToServer::slot_Auth);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigDeAuth,this,&ConnectorToServer::sigDeLoginResult);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigTryBlock,this,&ConnectorToServer::sigTryBlockResult);
|
||||
|
||||
connect(recognizeSystem,&RecognizeSystem::sigServerBlocked,this,&ConnectorToServer::slot_ServerBlocked);
|
||||
connect(recognizeSystem,&RecognizeSystem::sigErrorAuth,this,&ConnectorToServer::slot_ErrorAuth);
|
||||
|
||||
|
||||
@@ -130,6 +130,9 @@ signals:
|
||||
|
||||
void sigLoginResult(ServerAuthorization * serverAuth);
|
||||
void sigDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||
|
||||
void sigTryBlockResult(bool result, QString type);
|
||||
|
||||
void sigServerBlocked();
|
||||
void sigErrorAuth(QString error);
|
||||
|
||||
|
||||
@@ -51,6 +51,9 @@ InstructorsAndTraineesWidget::InstructorsAndTraineesWidget(QWidget *parent) :
|
||||
connectorToServer = new ConnectorToServer();
|
||||
connect(connectorToServer, &ConnectorToServer::sigLoginResult, this, &InstructorsAndTraineesWidget::slot_checkLoginResult);
|
||||
connect(connectorToServer, &ConnectorToServer::sigDeLoginResult, this, &InstructorsAndTraineesWidget::slot_checkDeLoginResult);
|
||||
|
||||
connect(connectorToServer, &ConnectorToServer::sigTryBlockResult, this, &InstructorsAndTraineesWidget::slot_checkTryBlockResult);
|
||||
|
||||
connect(connectorToServer, &ConnectorToServer::sigServerBlocked, this, &InstructorsAndTraineesWidget::slot_ServerBlocked);
|
||||
connect(connectorToServer, &ConnectorToServer::sigErrorAuth, this, &InstructorsAndTraineesWidget::slot_ErrorAuth);
|
||||
connect(connectorToServer, &ConnectorToServer::signal_SetVersion, this, &InstructorsAndTraineesWidget::slot_SetVersion);
|
||||
@@ -289,6 +292,11 @@ void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization
|
||||
}
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_checkTryBlockResult(bool result, QString type)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void InstructorsAndTraineesWidget::slot_ServerBlocked()
|
||||
{
|
||||
if(flTryLogin)
|
||||
@@ -695,6 +703,8 @@ void InstructorsAndTraineesWidget::on_btnSettings_clicked()
|
||||
connect(dlgSettings, &DialogSettings::signal_LanguageChanged, this, &InstructorsAndTraineesWidget::slot_LanguageChanged);
|
||||
connect(dlgSettings, &DialogSettings::signal_UpdateStyleSheet, this, &InstructorsAndTraineesWidget::slot_UpdateStyleSheet);
|
||||
|
||||
connect(connectorToServer, &ConnectorToServer::sigTryBlockResult, dlgSettings, &DialogSettings::slot_checkTryBlockResult);
|
||||
|
||||
switch( dlgSettings->exec() )
|
||||
{
|
||||
case QDialog::Accepted:
|
||||
|
||||
@@ -54,6 +54,8 @@ public Q_SLOTS:
|
||||
//Слот обработки результата деавторизации
|
||||
void slot_checkDeLoginResult(ServerDeAuthorization * serverDeAuth);
|
||||
|
||||
void slot_checkTryBlockResult(bool result, QString type);
|
||||
|
||||
void slot_ServerBlocked();
|
||||
void slot_ErrorAuth(QString error);
|
||||
void slot_SetVersion(StreamingVersionData* serverVersion);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <QXmlStreamReader>
|
||||
#include <QRegExpValidator>
|
||||
#include "dialogversioncontrol.h"
|
||||
#include "specialmessagebox.h"
|
||||
|
||||
DialogSettings::DialogSettings(ConnectorToServer* connectorToServer, bool instructorIsLogged, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
@@ -12,7 +13,8 @@ DialogSettings::DialogSettings(ConnectorToServer* connectorToServer, bool instru
|
||||
settings(nullptr),
|
||||
connectorToServer(nullptr),
|
||||
dlgVersionControl(nullptr),
|
||||
flSettingsServerChanged(false)
|
||||
flSettingsServerChanged(false),
|
||||
flTryVersionControl(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -214,19 +216,12 @@ void DialogSettings::on_btnSetVersion_clicked()
|
||||
if(connectorToServer)
|
||||
if(connectorToServer->getIsConnected())
|
||||
{
|
||||
flTryVersionControl = true;
|
||||
|
||||
connectorToServer->sendQueryBlockAuth(true, "VersionControl");
|
||||
|
||||
dlgVersionControl = new DialogVersionControl(connectorToServer, this);
|
||||
dlgVersionControl->initialize(connectorToServer->getLoginName());
|
||||
dlgVersionControl->exec();
|
||||
|
||||
if(dlgVersionControl)
|
||||
{
|
||||
delete dlgVersionControl;
|
||||
dlgVersionControl = nullptr;
|
||||
}
|
||||
|
||||
connectorToServer->sendQueryBlockAuth(false, "VersionControl");
|
||||
//TODO пока сразу
|
||||
//slot_VersionControl();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,3 +253,38 @@ void DialogSettings::on_DialogSettings_accepted()
|
||||
|
||||
emit signal_LanguageChanged(language);
|
||||
}
|
||||
|
||||
void DialogSettings::slot_VersionControl()
|
||||
{
|
||||
dlgVersionControl = new DialogVersionControl(connectorToServer, this);
|
||||
dlgVersionControl->initialize(connectorToServer->getLoginName());
|
||||
dlgVersionControl->exec();
|
||||
|
||||
if(dlgVersionControl)
|
||||
{
|
||||
delete dlgVersionControl;
|
||||
dlgVersionControl = nullptr;
|
||||
}
|
||||
|
||||
connectorToServer->sendQueryBlockAuth(false, "VersionControl");
|
||||
}
|
||||
|
||||
void DialogSettings::slot_checkTryBlockResult(bool result, QString type)
|
||||
{
|
||||
if(flTryVersionControl)
|
||||
{
|
||||
if(type == "VersionControl")
|
||||
{
|
||||
if(result)
|
||||
{//Одобрено
|
||||
slot_VersionControl();
|
||||
}
|
||||
else
|
||||
{//Отказ
|
||||
SpecMsgBox::WarningClose(this, tr("The server rejected your request to access version control.\nAnother instructor is managing versions.\nPlease try again later."));
|
||||
}
|
||||
|
||||
flTryVersionControl = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,11 @@ private slots:
|
||||
void on_editPort_textChanged(const QString &arg1);
|
||||
void on_DialogSettings_accepted();
|
||||
|
||||
public slots:
|
||||
void slot_VersionControl();
|
||||
|
||||
void slot_checkTryBlockResult(bool result, QString type);
|
||||
|
||||
private:
|
||||
bool saveSettings();
|
||||
|
||||
@@ -59,6 +64,8 @@ private:
|
||||
DialogVersionControl *dlgVersionControl;
|
||||
|
||||
bool flSettingsServerChanged;
|
||||
|
||||
bool flTryVersionControl;
|
||||
};
|
||||
|
||||
#endif // DIALOGSETTINGS_H
|
||||
|
||||
Reference in New Issue
Block a user