отклонение запроса на Управление версиями

This commit is contained in:
2026-01-22 15:18:40 +03:00
parent 2522bc6af5
commit 5415afe264
12 changed files with 156 additions and 16 deletions

View File

@@ -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;
}
}
}