mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-27 19:45:43 +03:00
bugfix: add behaviour on empty build and shared data
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,5 +36,7 @@ private:
|
||||
Ui::MainWindow *ui;
|
||||
ServerLMSWidget* m_serverLMSWidget;
|
||||
QTranslator qtLanguageTranslator;
|
||||
void exit();
|
||||
void errorCheck();
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
Reference in New Issue
Block a user