mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Merge branch 'work29' into DEV
This commit is contained in:
@@ -16,6 +16,7 @@ const QString ServerLMSWidget::languageRUS = "ru_RU";
|
||||
ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::ServerLMSWidget),
|
||||
waitAnimationWidget(nullptr),
|
||||
server(nullptr),
|
||||
updateThread(nullptr),
|
||||
loggerThread(nullptr),
|
||||
@@ -42,6 +43,13 @@ ServerLMSWidget::ServerLMSWidget(QWidget *parent) :
|
||||
updateMyStyleSheet();
|
||||
|
||||
setLanguageInterfase();
|
||||
|
||||
waitAnimationWidget = new WaitAnimationWidget;
|
||||
QMovie *movie = new QMovie(":/resources/icons/762.gif");
|
||||
waitAnimationWidget->setParent(this);
|
||||
waitAnimationWidget->initialize(movie,this);
|
||||
|
||||
waitAnimationWidget->showWithPlay();
|
||||
}
|
||||
|
||||
ServerLMSWidget::~ServerLMSWidget()
|
||||
@@ -72,6 +80,9 @@ ServerLMSWidget::~ServerLMSWidget()
|
||||
delete providerDBLMS;
|
||||
}
|
||||
|
||||
waitAnimationWidget->hideWithStop();
|
||||
delete waitAnimationWidget;
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -86,6 +97,12 @@ void ServerLMSWidget::changeEvent(QEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QSize size = event->size();
|
||||
waitAnimationWidget->resize(size);
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_UpdateListClients()
|
||||
{
|
||||
//Очищаем список
|
||||
@@ -125,12 +142,39 @@ void ServerLMSWidget::slot_UpdateDocs()
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::start()
|
||||
void ServerLMSWidget::slot_startInitialization_step1()
|
||||
{
|
||||
startInitialization();
|
||||
Logger::instance().log("Update docs.xml...");
|
||||
slot_UpdateDocs();
|
||||
Logger::instance().log("Update docs.xml completed!");
|
||||
|
||||
ui->btnStopServer->setEnabled(false);
|
||||
ui->btnStartServer->setEnabled(true);
|
||||
|
||||
flStartInitialization = true;
|
||||
|
||||
updateStateServer();
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
if(hasError() == 100)
|
||||
return;
|
||||
|
||||
Logger::instance().log("Try connection to DB...");
|
||||
tryConnectionToDB();
|
||||
|
||||
waitAnimationWidget->hideWithStop();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_setVersion(QString versionStr)
|
||||
{
|
||||
ui->lblVersionText->setText(versionStr);
|
||||
}
|
||||
|
||||
void ServerLMSWidget::start()
|
||||
{
|
||||
startInitialization_step0();
|
||||
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_BlockAutorization(bool block)
|
||||
@@ -296,7 +340,7 @@ QString ServerLMSWidget::loadStyleSheet()
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLMSWidget::startInitialization()
|
||||
void ServerLMSWidget::startInitialization_step0()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
|
||||
@@ -317,7 +361,8 @@ void ServerLMSWidget::startInitialization()
|
||||
updateController = new UpdateController;
|
||||
updateController->moveToThread(updateThread);
|
||||
|
||||
docsUpdater = new DocsUpdater(updateController, this);
|
||||
docsUpdater = new DocsUpdater(updateController/*, this*/);
|
||||
docsUpdater->moveToThread(updateThread);
|
||||
|
||||
processingSystem = new ProcessingSystem(providerDBLMS, updateController, docsUpdater);
|
||||
|
||||
@@ -340,24 +385,16 @@ void ServerLMSWidget::startInitialization()
|
||||
Logger::instance().setLoggingType(LoggingType::WIDGET);
|
||||
Logger::instance().setLogToFile(true);
|
||||
|
||||
connect(this,&ServerLMSWidget::sigUpdateController,updateController,&UpdateController::initialize,Qt::DirectConnection);
|
||||
connect(this,&ServerLMSWidget::sigUpdateControllerInitialize,updateController,&UpdateController::initialize/*,Qt::DirectConnection*/);
|
||||
connect(updateController,&UpdateController::sigInitializeFinished, this,&ServerLMSWidget::slot_startInitialization_step1/*,Qt::DirectConnection*/);
|
||||
connect(this,&ServerLMSWidget::sigCalculateFullHash,updateController,&UpdateController::calculateFullHash,Qt::AutoConnection);
|
||||
connect(updateController,&UpdateController::sigErrorRequired,this,&ServerLMSWidget::setError);
|
||||
connect(updateController,&UpdateController::sigUpdateDocs,this,&ServerLMSWidget::slot_UpdateDocs,Qt::AutoConnection);
|
||||
connect(&Logger::instance(),&Logger::sigLogToWidget,this, &ServerLMSWidget::slot_AddMessageToLog,Qt::QueuedConnection);
|
||||
|
||||
emit sigUpdateController(commonClientHandler,dataParser,assetsManager);
|
||||
connect(assetsManager,&AssetsManager::signal_setVersion, this, &ServerLMSWidget::slot_setVersion);
|
||||
|
||||
slot_UpdateDocs();
|
||||
|
||||
ui->btnStopServer->setEnabled(false);
|
||||
ui->btnStartServer->setEnabled(true);
|
||||
|
||||
flStartInitialization = true;
|
||||
|
||||
updateStateServer();
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
emit sigUpdateControllerInitialize(commonClientHandler,dataParser,assetsManager);
|
||||
}
|
||||
|
||||
void ServerLMSWidget::tryConnectionToDB()
|
||||
@@ -383,6 +420,8 @@ void ServerLMSWidget::tryConnectionToDB()
|
||||
dbSettings.dbHostName,
|
||||
QString::number(dbSettings.dbPort));
|
||||
|
||||
Logger::instance().log("Connection to DB completed!");
|
||||
|
||||
emit signal_Tray_ShowMessage(tr("Database connection OK!") + "\n" + strDBsettings);
|
||||
|
||||
on_btnStartServer_clicked();
|
||||
|
||||
Reference in New Issue
Block a user