mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Откл-е запр-в на EditorTrainees EditorInstructors
This commit is contained in:
@@ -11,6 +11,7 @@ ViewerTrainees::ViewerTrainees(ConnectorToServer* connectorToServer, MessangerCo
|
||||
messangerController(messangerController),
|
||||
dlgRedactor(nullptr),
|
||||
dlgCardTrainee(nullptr),
|
||||
flTryEditorTrainees(false),
|
||||
ui(new Ui::ViewerTrainees)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -32,6 +33,8 @@ ViewerTrainees::ViewerTrainees(ConnectorToServer* connectorToServer, MessangerCo
|
||||
setNotLoggedInVisible(true);
|
||||
|
||||
ui->btnEditorTrainees->setVisible(false);
|
||||
|
||||
connect(connectorToServer, &ConnectorToServer::sigTryBlockResult, this, &ViewerTrainees::slot_checkTryBlockResult);
|
||||
}
|
||||
|
||||
ViewerTrainees::~ViewerTrainees()
|
||||
@@ -79,6 +82,8 @@ void ViewerTrainees::deactivate()
|
||||
if(dlgCardTrainee)
|
||||
dlgCardTrainee->close();
|
||||
|
||||
flTryEditorTrainees = false;
|
||||
|
||||
CommonView::deactivate();
|
||||
|
||||
ammTasksWidgetCommon->deactivate();
|
||||
@@ -109,23 +114,31 @@ void ViewerTrainees::slot_receiveMessage(ClientMessage clientMessage)
|
||||
slot_NeedUpdateUI(false, true);
|
||||
}
|
||||
|
||||
void ViewerTrainees::slot_checkTryBlockResult(bool result, QString type)
|
||||
{
|
||||
if(flTryEditorTrainees)
|
||||
{
|
||||
if(type == "EditorTrainees")
|
||||
{
|
||||
if(result)
|
||||
{//Одобрено
|
||||
dialog_EditorTrainees();
|
||||
}
|
||||
else
|
||||
{//Отказ
|
||||
SpecMsgBox::WarningClose(this, tr("The server rejected your request to access trainees control.\nAnother instructor is managing trainees.\nPlease try again later."));
|
||||
}
|
||||
|
||||
flTryEditorTrainees = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerTrainees::on_btnEditorTrainees_clicked()
|
||||
{
|
||||
connectorToServer->sendQueryBlockAuth(true, "EditorTrainees");
|
||||
flTryEditorTrainees = true;
|
||||
|
||||
dlgRedactor = new DialogRedactorTrainees(connectorToServer, adminMode, this);
|
||||
dlgRedactor->exec();
|
||||
|
||||
if(dlgRedactor)
|
||||
{
|
||||
delete dlgRedactor;
|
||||
dlgRedactor = nullptr;
|
||||
}
|
||||
|
||||
if(authComplited)
|
||||
loadTraineesFromDB();
|
||||
|
||||
connectorToServer->sendQueryBlockAuth(false, "EditorTrainees");
|
||||
connectorToServer->sendQueryBlockAuth(true, "EditorTrainees");
|
||||
}
|
||||
|
||||
void ViewerTrainees::on_btnPersonalCard_clicked()
|
||||
@@ -236,3 +249,20 @@ void ViewerTrainees::updateButtons()
|
||||
ui->btnEditorTrainees->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerTrainees::dialog_EditorTrainees()
|
||||
{
|
||||
dlgRedactor = new DialogRedactorTrainees(connectorToServer, adminMode, this);
|
||||
dlgRedactor->exec();
|
||||
|
||||
if(dlgRedactor)
|
||||
{
|
||||
delete dlgRedactor;
|
||||
dlgRedactor = nullptr;
|
||||
}
|
||||
|
||||
if(authComplited)
|
||||
loadTraineesFromDB();
|
||||
|
||||
connectorToServer->sendQueryBlockAuth(false, "EditorTrainees");
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ protected:
|
||||
public slots:
|
||||
void slot_receiveMessage(ClientMessage clientMessage);
|
||||
|
||||
void slot_checkTryBlockResult(bool result, QString type);
|
||||
|
||||
public Q_SLOTS:
|
||||
void on_btnEditorTrainees_clicked();
|
||||
void on_btnPersonalCard_clicked();
|
||||
@@ -50,6 +52,8 @@ Q_SIGNALS:
|
||||
private:
|
||||
void updateButtons() override;
|
||||
|
||||
void dialog_EditorTrainees();
|
||||
|
||||
private:
|
||||
AMMtasksWidget* ammTasksWidgetCommon;
|
||||
FIMtasksWidget* fimTasksWidgetCommon;
|
||||
@@ -59,6 +63,8 @@ private:
|
||||
DialogRedactorTrainees* dlgRedactor;
|
||||
DialogCardTrainee* dlgCardTrainee;
|
||||
|
||||
bool flTryEditorTrainees;
|
||||
|
||||
private:
|
||||
Ui::ViewerTrainees *ui;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user