bugfix: add behaviour on empty build and shared data

This commit is contained in:
semenov
2025-06-10 11:39:09 +03:00
parent 00d7262251
commit e40a22483a
7 changed files with 72 additions and 6 deletions

View File

@@ -1,8 +1,8 @@
#include <QMessageBox>
#include <QTimer>
#include "mainwindow.h"
#include "./ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
@@ -21,9 +21,16 @@ MainWindow::MainWindow(QWidget *parent) :
this->move(0, 0);
this->showNormal();
errorCheck();
//this->showMaximized();
}
void MainWindow::exit()
{
QApplication::exit(0);
}
MainWindow::~MainWindow()
{
delete m_serverLMSWidget;
@@ -53,3 +60,26 @@ void MainWindow::on_cmbLanguage_currentIndexChanged(const QString &arg1)
emit signal_LanguageChanged(language);
}
void MainWindow::errorCheck()
{
if(m_serverLMSWidget->hasError() == 100)
{
QMessageBox msgBox;
msgBox.setWindowTitle("Ошибка");
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText(tr("Не найдены файлы клиента"));
msgBox.setInformativeText(tr("* проверьте Application на наличие папки с билдом \n"
"* проверьте SharedData на наличие папки с базовой версией и именем base"));
msgBox.setStandardButtons(QMessageBox::Close);
msgBox.show();
int ret = msgBox.exec();
if (ret == QMessageBox::Close)
{
//выключение с задержкой, так как eventLoop инициализируется позже
QTimer::singleShot(1000,this,&MainWindow::exit);
}
}
}

View File

@@ -36,5 +36,7 @@ private:
Ui::MainWindow *ui;
ServerLMSWidget* m_serverLMSWidget;
QTranslator qtLanguageTranslator;
void exit();
void errorCheck();
};
#endif // MAINWINDOW_H