errorCheck переделал

This commit is contained in:
2025-11-30 22:54:09 +03:00
parent d30e6b4927
commit 54f1744e7f
11 changed files with 23 additions and 48 deletions

View File

@@ -41,3 +41,4 @@ add_dependencies(GUIdataBaseLMS InstructorsAndTrainees)
add_dependencies(ServerLMS DataBaseLMS) add_dependencies(ServerLMS DataBaseLMS)
add_dependencies(ServerLMS InstructorsAndTrainees) add_dependencies(ServerLMS InstructorsAndTrainees)
add_dependencies(TrayServerLMS ServerLMS) add_dependencies(TrayServerLMS ServerLMS)
add_dependencies(TrayServerLMS InstructorsAndTrainees)

View File

@@ -13,11 +13,10 @@ MainWindow::MainWindow(QWidget *parent)
ui->setupUi(this); ui->setupUi(this);
instructorsAndTraineesWidget = new InstructorsAndTraineesWidget(this); instructorsAndTraineesWidget = new InstructorsAndTraineesWidget(this);
ui->horizontalLayout->addWidget(instructorsAndTraineesWidget);
connect(instructorsAndTraineesWidget, &InstructorsAndTraineesWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged); connect(instructorsAndTraineesWidget, &InstructorsAndTraineesWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged);
ui->horizontalLayout->addWidget(instructorsAndTraineesWidget);
this->move(0, 0); this->move(0, 0);
//this->showNormal(); //this->showNormal();
this->showMaximized(); this->showMaximized();

View File

@@ -2,12 +2,13 @@
#define SPECIALMESSAGEBOX_H #define SPECIALMESSAGEBOX_H
#include <QDialog> #include <QDialog>
#include "instructorsAndTrainees_global.h"
namespace Ui { namespace Ui {
class SpecialMessageBox; class SpecialMessageBox;
} }
class SpecMsgBox : public QDialog class INSTRUCTORSANDTRAINEES_EXPORT SpecMsgBox : public QDialog
{ {
Q_OBJECT Q_OBJECT

View File

@@ -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/authorization)
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/tasks) 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/widgets)
target_include_directories(ServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/specialmessagebox)
if(PROJECT_TYPE_DEBUG) if(PROJECT_TYPE_DEBUG)
target_link_directories(ServerLMS PUBLIC ${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees) target_link_directories(ServerLMS PUBLIC ${REPO_PATH}/BUILDS/Debug64/InstructorsAndTrainees)
else() else()

View File

@@ -393,7 +393,7 @@ void ServerLMSWidget::startInitialization_step0()
Logger::instance().setLoggingType(LoggingType::WIDGET); Logger::instance().setLoggingType(LoggingType::WIDGET);
Logger::instance().setLogToFile(true); 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(updateController,&UpdateController::sigInitializeFinished, this,&ServerLMSWidget::slot_startInitialization_step1/*,Qt::DirectConnection*/);
connect(this,&ServerLMSWidget::sigCalculateFullHash,updateController,&UpdateController::calculateFullHash,Qt::AutoConnection); connect(this,&ServerLMSWidget::sigCalculateFullHash,updateController,&UpdateController::calculateFullHash,Qt::AutoConnection);
connect(updateController,&UpdateController::sigErrorRequired,this,&ServerLMSWidget::setError); connect(updateController,&UpdateController::sigErrorRequired,this,&ServerLMSWidget::setError);

View File

@@ -29,8 +29,7 @@
#include "docsupdater.h" #include "docsupdater.h"
#include "waitanimationwidget.h" #include "waitanimationwidget.h"
#include "specialmessagebox.h"
namespace Ui { namespace Ui {
@@ -109,6 +108,14 @@ public:
void setError(int code) 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; errorCode = code;
} }

View File

@@ -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)
target_include_directories(TrayServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/tasks) 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/widgets)
target_include_directories(TrayServerLMS PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../InstructorsAndTrainees/specialmessagebox)

View File

@@ -6,6 +6,6 @@ int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication a(argc, argv);
MainWindow w; MainWindow w;
w.show(); //По-умолчанию свернуто в трее w.show(); //Закоментировать, если нужно, чтобы по-умолчанию было свернуто в трее!
return a.exec(); return a.exec();
} }

View File

@@ -1,6 +1,8 @@
#include <QMessageBox> #include <QMessageBox>
#include <QTimer> #include <QTimer>
#include <QThread> #include <QThread>
#include <QMenu>
#include "specialmessagebox.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
@@ -18,17 +20,11 @@ MainWindow::MainWindow(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowMinimizeButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowMinimizeButtonHint);
//Скрываем ненужные элементы окна
ui->menubar->setVisible(false);
ui->statusbar->setVisible(false);
serverLMSWidget = new ServerLMSWidget(this); serverLMSWidget = new ServerLMSWidget(this);
ui->verticalLayout_Main->addWidget(serverLMSWidget); ui->verticalLayout_Main->addWidget(serverLMSWidget);
connect(serverLMSWidget, &ServerLMSWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged); connect(serverLMSWidget, &ServerLMSWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged);
connect(serverLMSWidget, &ServerLMSWidget::signal_Tray_ShowMessage, this, &MainWindow::slot_Tray_ShowMessage); 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_ShowWindow, this, &MainWindow::slot_TrayMenu_ShowWindow);
connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_HideWindow, this, &MainWindow::slot_TrayMenu_HideWindow); connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_HideWindow, this, &MainWindow::slot_TrayMenu_HideWindow);
@@ -207,24 +203,10 @@ void MainWindow::errorCheck()
{ {
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 инициализируется позже //выключение с задержкой, так как eventLoop инициализируется позже
QTimer::singleShot(1000,this,&MainWindow::slot_TrayMenu_Exit); QTimer::singleShot(1000,this,&MainWindow::slot_TrayMenu_Exit);
} }
} }
}
void MainWindow::updateTrayTitles() void MainWindow::updateTrayTitles()
{ {

View File

@@ -53,6 +53,7 @@ public slots:
//Слот вывода сообщения из трея //Слот вывода сообщения из трея
void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information); void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information);
//Слот отложенной инициализации
void slot_LazyInitialization(); void slot_LazyInitialization();
private: private:
void exit(); void exit();

View File

@@ -34,24 +34,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menubar">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1200</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</widget> </widget>
<resources> <resources>
<include location="TrayServerLMS.qrc"/> <include location="TrayServerLMS.qrc"/>