mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
Оптимизация старта Сервера 0
This commit is contained in:
@@ -175,7 +175,7 @@ void ServerLMSWidget::slot_startInitialization_step1()
|
||||
updateStateOnlyDB();
|
||||
updateStateOnlyVersion();
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
//QApplication::restoreOverrideCursor();
|
||||
|
||||
if(hasError() == 100)
|
||||
return;
|
||||
@@ -184,6 +184,8 @@ void ServerLMSWidget::slot_startInitialization_step1()
|
||||
tryConnectionToDB();
|
||||
|
||||
waitAnimationWidget->hideWithStop();
|
||||
|
||||
emit signal_InitializeFinished();
|
||||
}
|
||||
|
||||
void ServerLMSWidget::slot_setVersion(QString versionStr)
|
||||
@@ -359,7 +361,7 @@ QString ServerLMSWidget::loadStyleSheet()
|
||||
|
||||
void ServerLMSWidget::startInitialization_step0()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
//QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
|
||||
providerDBLMS = new ProviderDBLMS(this);
|
||||
connect(providerDBLMS, &ProviderDBLMS::signal_ErrorPostgreSQL, this, &ServerLMSWidget::slot_ErrorPostgreSQL);
|
||||
|
||||
@@ -92,6 +92,8 @@ signals:
|
||||
void signal_updateStateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization);
|
||||
|
||||
void signal_updateDocsXML();
|
||||
|
||||
void signal_InitializeFinished();
|
||||
public slots:
|
||||
void slot_LanguageChanged(QString language);
|
||||
void slot_UpdateListClients();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -91,6 +91,8 @@ void MainWindow::closeEvent(QCloseEvent * event)
|
||||
if(this->isVisible())
|
||||
{
|
||||
event->ignore();
|
||||
|
||||
if(flInitServerLMSWidget)
|
||||
slot_TrayMenu_HideWindow();
|
||||
}
|
||||
}
|
||||
@@ -188,7 +190,15 @@ void MainWindow::slot_updateStateServer(EStateServer stateServer, EStateBlockAut
|
||||
void MainWindow::slot_LazyInitialization()
|
||||
{
|
||||
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)
|
||||
|
||||
@@ -60,6 +60,8 @@ public slots:
|
||||
|
||||
void slot_hasError(int code);
|
||||
|
||||
void slot_InitializeFinished();
|
||||
|
||||
private:
|
||||
void exit();
|
||||
void errorCheck();
|
||||
@@ -76,5 +78,7 @@ private:
|
||||
QAction * action_ShowWindow;
|
||||
QAction * action_HideWindow;
|
||||
QAction * action_Exit;
|
||||
|
||||
bool flInitServerLMSWidget;
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
Reference in New Issue
Block a user