diff --git a/CMakeLists.txt b/CMakeLists.txt index 33b160b..4e5b419 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,3 +41,4 @@ add_dependencies(GUIdataBaseLMS InstructorsAndTrainees) add_dependencies(ServerLMS DataBaseLMS) add_dependencies(ServerLMS InstructorsAndTrainees) add_dependencies(TrayServerLMS ServerLMS) +add_dependencies(TrayServerLMS InstructorsAndTrainees) diff --git a/GUIdataBaseLMS/mainwindow.cpp b/GUIdataBaseLMS/mainwindow.cpp index e5e3cdb..1290c67 100644 --- a/GUIdataBaseLMS/mainwindow.cpp +++ b/GUIdataBaseLMS/mainwindow.cpp @@ -13,11 +13,10 @@ MainWindow::MainWindow(QWidget *parent) ui->setupUi(this); instructorsAndTraineesWidget = new InstructorsAndTraineesWidget(this); + ui->horizontalLayout->addWidget(instructorsAndTraineesWidget); connect(instructorsAndTraineesWidget, &InstructorsAndTraineesWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged); - ui->horizontalLayout->addWidget(instructorsAndTraineesWidget); - this->move(0, 0); //this->showNormal(); this->showMaximized(); diff --git a/InstructorsAndTrainees/specialmessagebox/specialmessagebox.h b/InstructorsAndTrainees/specialmessagebox/specialmessagebox.h index a0789c0..e01c823 100644 --- a/InstructorsAndTrainees/specialmessagebox/specialmessagebox.h +++ b/InstructorsAndTrainees/specialmessagebox/specialmessagebox.h @@ -2,12 +2,13 @@ #define SPECIALMESSAGEBOX_H #include +#include "instructorsAndTrainees_global.h" namespace Ui { class SpecialMessageBox; } -class SpecMsgBox : public QDialog +class INSTRUCTORSANDTRAINEES_EXPORT SpecMsgBox : public QDialog { Q_OBJECT diff --git a/ServerLMS/CMakeLists.txt b/ServerLMS/CMakeLists.txt index bc2d524..cb76b13 100644 --- a/ServerLMS/CMakeLists.txt +++ b/ServerLMS/CMakeLists.txt @@ -87,6 +87,7 @@ target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../Instr target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/authorization) target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/tasks) target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/widgets) +target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/specialmessagebox) if(PROJECT_TYPE_DEBUG) target_link_directories(ServerLMS PUBLIC ${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees) else() diff --git a/ServerLMS/serverlmswidget.cpp b/ServerLMS/serverlmswidget.cpp index fb9ea90..7eb965e 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 1093497..47aecac 100644 --- a/ServerLMS/serverlmswidget.h +++ b/ServerLMS/serverlmswidget.h @@ -29,8 +29,7 @@ #include "docsupdater.h" #include "waitanimationwidget.h" - - +#include "specialmessagebox.h" namespace Ui { @@ -109,6 +108,14 @@ public: void setError(int code) { + if(code == 100) + { + QString textError = tr("No Client files found!") + "\n\n" + + 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); + } errorCode = code; } diff --git a/TrayServerLMS/CMakeLists.txt b/TrayServerLMS/CMakeLists.txt index ba9ead2..6b5a501 100644 --- a/TrayServerLMS/CMakeLists.txt +++ b/TrayServerLMS/CMakeLists.txt @@ -38,3 +38,4 @@ target_link_libraries(TrayServerLMS PRIVATE libServerLMS.dll) target_include_directories(TrayServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees) target_include_directories(TrayServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/tasks) target_include_directories(TrayServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/widgets) +target_include_directories(TrayServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/specialmessagebox) diff --git a/TrayServerLMS/main.cpp b/TrayServerLMS/main.cpp index 00c3910..231509a 100644 --- a/TrayServerLMS/main.cpp +++ b/TrayServerLMS/main.cpp @@ -6,6 +6,6 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; - w.show(); //По-умолчанию свернуто в трее + w.show(); //Закоментировать, если нужно, чтобы по-умолчанию было свернуто в трее! return a.exec(); } diff --git a/TrayServerLMS/mainwindow.cpp b/TrayServerLMS/mainwindow.cpp index 1c2a437..aa74e20 100644 --- a/TrayServerLMS/mainwindow.cpp +++ b/TrayServerLMS/mainwindow.cpp @@ -1,6 +1,8 @@ #include #include #include +#include +#include "specialmessagebox.h" #include "mainwindow.h" #include "ui_mainwindow.h" @@ -18,17 +20,11 @@ MainWindow::MainWindow(QWidget *parent) : ui->setupUi(this); setWindowFlags(windowFlags() & ~Qt::WindowMinimizeButtonHint); - //Скрываем ненужные элементы окна - ui->menubar->setVisible(false); - ui->statusbar->setVisible(false); - serverLMSWidget = new ServerLMSWidget(this); - ui->verticalLayout_Main->addWidget(serverLMSWidget); 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); @@ -205,24 +201,10 @@ void MainWindow::errorCheck() { if(serverLMSWidget->hasError() == 100) { - slot_TrayMenu_ShowWindow(); + slot_TrayMenu_ShowWindow(); - QMessageBox msgBox(this); - - msgBox.setWindowTitle(tr("Error!")); - msgBox.setIcon(QMessageBox::Critical); - msgBox.setText(tr("No Client files found!")); - msgBox.setInformativeText(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")); - msgBox.setStandardButtons(QMessageBox::Close); - msgBox.show(); - int ret = msgBox.exec(); - - if (ret == QMessageBox::Close) - { - //выключение с задержкой, так как eventLoop инициализируется позже - QTimer::singleShot(1000,this,&MainWindow::slot_TrayMenu_Exit); - } + //выключение с задержкой, так как eventLoop инициализируется позже + QTimer::singleShot(1000,this,&MainWindow::slot_TrayMenu_Exit); } } diff --git a/TrayServerLMS/mainwindow.h b/TrayServerLMS/mainwindow.h index 4ad9af4..89626bc 100644 --- a/TrayServerLMS/mainwindow.h +++ b/TrayServerLMS/mainwindow.h @@ -53,6 +53,7 @@ public slots: //Слот вывода сообщения из трея void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information); + //Слот отложенной инициализации void slot_LazyInitialization(); private: void exit(); diff --git a/TrayServerLMS/mainwindow.ui b/TrayServerLMS/mainwindow.ui index 2857fae..7fa747d 100644 --- a/TrayServerLMS/mainwindow.ui +++ b/TrayServerLMS/mainwindow.ui @@ -34,24 +34,6 @@ - - - false - - - - 0 - 0 - 1200 - 21 - - - - - - false - -