mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Оптимизация старта Сервера 0
This commit is contained in:
@@ -14,7 +14,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
trayMenu(nullptr),
|
||||
action_ShowWindow(nullptr),
|
||||
action_HideWindow(nullptr),
|
||||
action_Exit(nullptr)
|
||||
action_Exit(nullptr),
|
||||
flInitServerLMSWidget(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowMinimizeButtonHint);
|
||||
@@ -22,12 +23,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
serverLMSWidget = new ServerLMSWidget(this);
|
||||
ui->verticalLayout_Main->addWidget(serverLMSWidget);
|
||||
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_InitializeFinished, this, &MainWindow::slot_InitializeFinished);
|
||||
|
||||
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);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_HideWindow, this, &MainWindow::slot_TrayMenu_HideWindow);
|
||||
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_updateStateServer, this, &MainWindow::slot_updateStateServer);
|
||||
|
||||
@@ -65,7 +65,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
trayIcon->setContextMenu(trayMenu);
|
||||
trayIcon->show();
|
||||
|
||||
slot_Tray_ShowMessage(tr("Starting the server..."));
|
||||
slot_Tray_ShowMessage(tr("Starting the server..."));
|
||||
|
||||
QTimer::singleShot(1000, this, &MainWindow::slot_LazyInitialization);
|
||||
}
|
||||
@@ -91,7 +91,9 @@ void MainWindow::closeEvent(QCloseEvent * event)
|
||||
if(this->isVisible())
|
||||
{
|
||||
event->ignore();
|
||||
slot_TrayMenu_HideWindow();
|
||||
|
||||
if(flInitServerLMSWidget)
|
||||
slot_TrayMenu_HideWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,8 +189,16 @@ void MainWindow::slot_updateStateServer(EStateServer stateServer, EStateBlockAut
|
||||
|
||||
void MainWindow::slot_LazyInitialization()
|
||||
{
|
||||
serverLMSWidget->start();
|
||||
serverLMSWidget->start();
|
||||
}
|
||||
|
||||
void MainWindow::slot_hasError(int code)
|
||||
{
|
||||
errorCheck();
|
||||
}
|
||||
|
||||
void MainWindow::slot_InitializeFinished()
|
||||
{
|
||||
/* Также подключаем сигнал нажатия на иконку к обработчику
|
||||
* данного нажатия
|
||||
* */
|
||||
@@ -197,11 +207,12 @@ void MainWindow::slot_LazyInitialization()
|
||||
* данного нажатия
|
||||
* */
|
||||
connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &MainWindow::slot_TrayMessageClicked);
|
||||
}
|
||||
|
||||
void MainWindow::slot_hasError(int code)
|
||||
{
|
||||
errorCheck();
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Tray_ShowMessage, this, &MainWindow::slot_Tray_ShowMessage);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_ShowWindow, this, &MainWindow::slot_TrayMenu_ShowWindow);
|
||||
connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_HideWindow, this, &MainWindow::slot_TrayMenu_HideWindow);
|
||||
|
||||
flInitServerLMSWidget = true;
|
||||
}
|
||||
|
||||
void MainWindow::slot_LanguageChanged(QString language)
|
||||
|
||||
Reference in New Issue
Block a user