DocsUpdater в отдельный поток

This commit is contained in:
2025-11-12 10:55:31 +03:00
parent 81d7e5e6d6
commit 650b0525a3
10 changed files with 103 additions and 18 deletions

View File

@@ -59,6 +59,7 @@ ServerLMSWidget::~ServerLMSWidget()
delete dataParser;
delete processingSystem;
delete updateController;
delete docsUpdater;
delete assetsManager;
delete chatSystem;
@@ -114,6 +115,13 @@ void ServerLMSWidget::slot_ErrorPostgreSQL(QString text)
QMessageBox::critical(this, tr("Error PostgreSQL!"),text);
}
void ServerLMSWidget::slot_UpdateDocs()
{
QApplication::setOverrideCursor(Qt::WaitCursor);
emit signal_DocsUpdaterUpdate();
QApplication::restoreOverrideCursor();
}
void ServerLMSWidget::start()
{
startInitialization();
@@ -190,6 +198,8 @@ void ServerLMSWidget::on_btnSettings_clicked()
connect(&dlg, &DialogSettingsTray::signal_LanguageChanged, this, &ServerLMSWidget::slot_LanguageChanged);
//connect(&dlg, &DialogSettingsTray::signal_UpdateStyleSheet, this, &ServerLMSWidget::slot_UpdateStyleSheet);
connect(&dlg, &DialogSettingsTray::signal_UpdateDocs, this, &ServerLMSWidget::slot_UpdateDocs);
switch( dlg.exec() )
{
@@ -271,6 +281,8 @@ QString ServerLMSWidget::loadStyleSheet()
void ServerLMSWidget::startInitialization()
{
QApplication::setOverrideCursor(Qt::WaitCursor);
providerDBLMS = new ProviderDBLMS(this);
connect(providerDBLMS, &ProviderDBLMS::signal_ErrorPostgreSQL, this, &ServerLMSWidget::slot_ErrorPostgreSQL);
connect(providerDBLMS, &ProviderDBLMS::signal_BlockAutorization, this, &ServerLMSWidget::slot_BlockAutorization);
@@ -315,7 +327,9 @@ void ServerLMSWidget::startInitialization()
emit sigUpdateController(commonClientHandler,dataParser,assetsManager);
docsUpdater = new DocsUpdater(updateController, this);
docsUpdater->update();
connect(this, &ServerLMSWidget::signal_DocsUpdaterUpdate, docsUpdater, &DocsUpdater::slot_update,Qt::DirectConnection);
docsUpdater->moveToThread(updateThread);
slot_UpdateDocs();
ui->btnStopServer->setEnabled(false);
ui->btnStartServer->setEnabled(true);
@@ -323,6 +337,8 @@ void ServerLMSWidget::startInitialization()
flStartInitialization = true;
updateStateServer();
QApplication::restoreOverrideCursor();
}
void ServerLMSWidget::tryConnectionToDB()