mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
errorCheck переделал
This commit is contained in:
@@ -41,3 +41,4 @@ add_dependencies(GUIdataBaseLMS InstructorsAndTrainees)
|
||||
add_dependencies(ServerLMS DataBaseLMS)
|
||||
add_dependencies(ServerLMS InstructorsAndTrainees)
|
||||
add_dependencies(TrayServerLMS ServerLMS)
|
||||
add_dependencies(TrayServerLMS InstructorsAndTrainees)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
#define SPECIALMESSAGEBOX_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "instructorsAndTrainees_global.h"
|
||||
|
||||
namespace Ui {
|
||||
class SpecialMessageBox;
|
||||
}
|
||||
|
||||
class SpecMsgBox : public QDialog
|
||||
class INSTRUCTORSANDTRAINEES_EXPORT SpecMsgBox : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -6,6 +6,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.show(); //По-умолчанию свернуто в трее
|
||||
w.show(); //Закоментировать, если нужно, чтобы по-умолчанию было свернуто в трее!
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
#include <QThread>
|
||||
#include <QMenu>
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ public slots:
|
||||
//Слот вывода сообщения из трея
|
||||
void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information);
|
||||
|
||||
//Слот отложенной инициализации
|
||||
void slot_LazyInitialization();
|
||||
private:
|
||||
void exit();
|
||||
|
||||
@@ -34,24 +34,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</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>
|
||||
<resources>
|
||||
<include location="TrayServerLMS.qrc"/>
|
||||
|
||||
Reference in New Issue
Block a user