From 0b7f772b21b23dc1bbbd1f272438d6949641d291 Mon Sep 17 00:00:00 2001 From: krivoshein Date: Mon, 1 Dec 2025 14:50:15 +0300 Subject: [PATCH] signal_hasError --- ServerLMS/serverlmswidget.cpp | 2 +- ServerLMS/serverlmswidget.h | 4 +++- TrayServerLMS/mainwindow.cpp | 11 ++++++++--- TrayServerLMS/mainwindow.h | 2 ++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ServerLMS/serverlmswidget.cpp b/ServerLMS/serverlmswidget.cpp index 7eb965e..fb9ea90 100644 --- a/ServerLMS/serverlmswidget.cpp +++ b/ServerLMS/serverlmswidget.cpp @@ -393,7 +393,7 @@ void ServerLMSWidget::startInitialization_step0() Logger::instance().setLoggingType(LoggingType::WIDGET); Logger::instance().setLogToFile(true); - connect(this,&ServerLMSWidget::sigUpdateControllerInitialize,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); diff --git a/ServerLMS/serverlmswidget.h b/ServerLMS/serverlmswidget.h index 47aecac..f6a5573 100644 --- a/ServerLMS/serverlmswidget.h +++ b/ServerLMS/serverlmswidget.h @@ -85,6 +85,7 @@ signals: QTcpSocket* sigGetSocket(); void signal_DocsChanged(); + void signal_hasError(int code); public slots: void slot_LanguageChanged(QString language); @@ -114,9 +115,10 @@ public: tr("* check Application for the presence of a folder with a build \n" "* check SharedData for a folder with the base version and the name base"); - SpecMsgBox::CriticalClose(this, textError); + SpecMsgBox::CriticalClose(this, textError); } errorCode = code; + emit signal_hasError(code); } int hasError() const diff --git a/TrayServerLMS/mainwindow.cpp b/TrayServerLMS/mainwindow.cpp index aa74e20..9403b9d 100644 --- a/TrayServerLMS/mainwindow.cpp +++ b/TrayServerLMS/mainwindow.cpp @@ -23,6 +23,8 @@ MainWindow::MainWindow(QWidget *parent) : serverLMSWidget = new ServerLMSWidget(this); ui->verticalLayout_Main->addWidget(serverLMSWidget); + connect(serverLMSWidget, &ServerLMSWidget::signal_hasError, this, &MainWindow::slot_hasError); + connect(serverLMSWidget, &ServerLMSWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged); connect(serverLMSWidget, &ServerLMSWidget::signal_Tray_ShowMessage, this, &MainWindow::slot_Tray_ShowMessage); connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_ShowWindow, this, &MainWindow::slot_TrayMenu_ShowWindow); @@ -172,9 +174,7 @@ void MainWindow::slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::Message void MainWindow::slot_LazyInitialization() { - serverLMSWidget->start(); - - errorCheck(); + serverLMSWidget->start(); /* Также подключаем сигнал нажатия на иконку к обработчику * данного нажатия @@ -186,6 +186,11 @@ void MainWindow::slot_LazyInitialization() connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &MainWindow::slot_TrayMessageClicked); } +void MainWindow::slot_hasError(int code) +{ + errorCheck(); +} + void MainWindow::slot_LanguageChanged(QString language) { qtLanguageTranslator.load(QString(QStringLiteral("translations/TrayServerLMS_")) + language, QStringLiteral(".")); diff --git a/TrayServerLMS/mainwindow.h b/TrayServerLMS/mainwindow.h index 89626bc..775f8a3 100644 --- a/TrayServerLMS/mainwindow.h +++ b/TrayServerLMS/mainwindow.h @@ -55,6 +55,8 @@ public slots: //Слот отложенной инициализации void slot_LazyInitialization(); + + void slot_hasError(int code); private: void exit(); void errorCheck();