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:
@@ -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