diff --git a/ProgramServerMTD/mainwindow.cpp b/ProgramServerMTD/mainwindow.cpp index e2094cd..ce38301 100644 --- a/ProgramServerMTD/mainwindow.cpp +++ b/ProgramServerMTD/mainwindow.cpp @@ -23,9 +23,9 @@ MainWindow::MainWindow(QWidget *parent) : serverLMSWidget = new ServerLMSWidget(this); connect(serverLMSWidget, &ServerLMSWidget::signal_StartInitFinished, this, &MainWindow::slot_InitializeFinished); - connect(serverLMSWidget, &ServerLMSWidget::signal_StartInitHasError, this, &MainWindow::slot_hasError); + connect(serverLMSWidget, &ServerLMSWidget::signal_StartInitHasError, this, &MainWindow::slot_InitializeHasError); connect(serverLMSWidget, &ServerLMSWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged); - connect(serverLMSWidget, &ServerLMSWidget::signal_Tray_UpdateStateServer, this, &MainWindow::slot_updateStateServer); + connect(serverLMSWidget, &ServerLMSWidget::signal_Tray_UpdateStateServer, this, &MainWindow::slot_UpdateStateServer); 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); @@ -65,8 +65,6 @@ MainWindow::MainWindow(QWidget *parent) : trayIcon->setContextMenu(trayMenu); trayIcon->show(); - //slot_Tray_ShowMessage(tr("Starting the server...")); - ui->verticalLayout_Main->addWidget(serverLMSWidget); } @@ -181,7 +179,7 @@ void MainWindow::slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::Message trayIcon->showMessage(tr("Server MTD"), textMsg, icon, 100); } -void MainWindow::slot_updateStateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization) +void MainWindow::slot_UpdateStateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization) { if(stateServer == EStateServer::started) { @@ -200,14 +198,12 @@ void MainWindow::slot_updateStateServer(EStateServer stateServer, EStateBlockAut } } -void MainWindow::slot_hasError(int code) +void MainWindow::slot_InitializeHasError(int code) { if(code == 100) { slot_TrayMenu_ShowWindow(); - - //выключение с задержкой - QTimer::singleShot(1000, this, &MainWindow::slot_TrayMenu_Exit); + slot_TrayMenu_Exit(); } } diff --git a/ProgramServerMTD/mainwindow.h b/ProgramServerMTD/mainwindow.h index abf802a..38f795c 100644 --- a/ProgramServerMTD/mainwindow.h +++ b/ProgramServerMTD/mainwindow.h @@ -48,12 +48,10 @@ public slots: void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information); //Слот изменения иконки трея о статусе Сервера - void slot_updateStateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization); + void slot_UpdateStateServer(EStateServer stateServer, EStateBlockAutorization stateBlockAutorization); - - void slot_hasError(int code); //TODO ? - - void slot_InitializeFinished(); //TODO ? + void slot_InitializeHasError(int code); + void slot_InitializeFinished(); private: void updateTrayTitles();