This commit is contained in:
2025-11-01 13:19:52 +03:00
parent 0d1d851e3f
commit e9363c388b
22 changed files with 801 additions and 484 deletions

View File

@@ -10,6 +10,7 @@ add_library(DataBaseLMS SHARED
databaselms_users.cpp databaselms_users.cpp
databaselms_instructors.cpp databaselms_instructors.cpp
databaselms_trainees.cpp databaselms_trainees.cpp
databaselms_Postgresql.cpp
databaselms.h databaselms.h
interfacedatabaselms.cpp interfacedatabaselms.cpp
interfacedatabaselms.h interfacedatabaselms.h

View File

@@ -29,225 +29,6 @@ void DataBaseLMS::slot_LanguageChanged(QString language)
QCoreApplication::installTranslator(&qtLanguageTranslator); QCoreApplication::installTranslator(&qtLanguageTranslator);
} }
bool DataBaseLMS::checkDriverQPSQLavailable()
{
return QSqlDatabase::isDriverAvailable("QPSQL");
}
bool DataBaseLMS::checkUserLMSexist()
{
DataBaseSettings dbSett = getDataBaseSettings();
QSqlDatabase dbCheck = QSqlDatabase::addDatabase("QPSQL");
dbCheck.setUserName("postgres");
dbCheck.setPassword("12345678");
dbCheck.setHostName(dbSett.dbHostName);
dbCheck.setPort(dbSett.dbPort);
if (dbCheck.open())
{
QSqlQuery query = QSqlQuery(dbCheck);
query.prepare("SELECT 1 FROM pg_roles WHERE rolname = :username");
query.bindValue(":username", dbSett.dbUserName);
if (query.exec() && query.next())
{
qDebug() << "Пользователь существует.";
return true;
}
else
{
qDebug() << "Пользователь не существует.";
return false;
}
}
else
{
qDebug() << "Ошибка подключения к PostreSQL.";
return false;
}
}
bool DataBaseLMS::checkDataBaseLMSexist()
{
DataBaseSettings dbSett = getDataBaseSettings();
QSqlDatabase dbCheck = QSqlDatabase::addDatabase("QPSQL");
bool flDBexist = false;
dbCheck.setUserName("postgres");
dbCheck.setPassword("12345678");
dbCheck.setHostName(dbSett.dbHostName);
dbCheck.setPort(dbSett.dbPort);
if (dbCheck.open())
{
QString queryStr = QString("SELECT datname FROM pg_database");
QSqlQuery query = QSqlQuery(dbCheck);
if(queryExec(queryStr, &query))
{
while (query.next())
{//Инструктор
QString nameDB = "";
nameDB = query.value(0).toString();
if(nameDB == dbSettings.dbName)
{
flDBexist = true;
break;
}
}
}
}
else
{
qDebug() << "Ошибка подключения к PostreSQL.";
return false;
}
return flDBexist;
}
bool DataBaseLMS::createUser(QString name)
{
DataBaseSettings dbSett = getDataBaseSettings();
QSqlDatabase dbCheck = QSqlDatabase::addDatabase("QPSQL");
dbCheck.setUserName("postgres");
dbCheck.setPassword("12345678");
dbCheck.setHostName(dbSett.dbHostName);
dbCheck.setPort(dbSett.dbPort);
if (dbCheck.open())
{
QString queryStr = QString("CREATE USER %1 WITH ENCRYPTED PASSWORD '%2'").arg(dbSett.dbUserName, dbSett.dbPassword);
QSqlQuery query = QSqlQuery(dbCheck);
if(queryExec(queryStr, &query))
{
qDebug() << "Пользователь создан.";
return true;
}
else
{
qDebug() << "Пользователь не создан.";
return false;
}
}
else
{
qDebug() << "Ошибка подключения к PostreSQL.";
return false;
}
}
bool DataBaseLMS::createDB(QString name)
{
DataBaseSettings dbSett = getDataBaseSettings();
QSqlDatabase dbCheck = QSqlDatabase::addDatabase("QPSQL");
dbCheck.setUserName("postgres");
dbCheck.setPassword("12345678");
dbCheck.setHostName(dbSett.dbHostName);
dbCheck.setPort(dbSett.dbPort);
if (dbCheck.open())
{
//Создание БД
QString queryStr = QString("CREATE DATABASE %1").arg(dbSett.dbName);
QSqlQuery query = QSqlQuery(dbCheck);
if(queryExec(queryStr, &query))
{
qDebug() << "БД создана.";
//Залитие БД
QProcess process;
//QString pgRestorePath = "C:\\restoreDB.bat"; // Замените на актуальный путь
QString pgRestorePath = "restoreDB.bat"; // Замените на актуальный путь
/*
QString dbName = "databaselms2";
QString user = "postgres";
QString backupFile = "C:\\DBLMS_EMPTY_30_09_2025.backup";
QStringList arguments;
arguments << "-d" << dbName;
arguments << "-U" << user;
arguments << backupFile;
*/
process.start("cmd /C " + pgRestorePath);
process.waitForFinished(-1); // Ждать бесконечно, пока процесс не завершится
//Назначение владельца
QString queryStr = QString("ALTER DATABASE %1 OWNER TO %2").arg(dbSett.dbName, dbSett.dbUserName);
QSqlQuery query = QSqlQuery(dbCheck);
if(queryExec(queryStr, &query))
{
}
else
return false;
//return true;
}
else
{
qDebug() << "БД не создана.";
return false;
}
}
else
{
qDebug() << "Ошибка подключения к PostreSQL.";
return false;
}
dbCheck.close();
QSqlDatabase dbCheck2 = QSqlDatabase::addDatabase("QPSQL");
dbCheck2.setUserName("postgres");
dbCheck2.setPassword("12345678");
dbCheck2.setHostName(dbSett.dbHostName);
dbCheck2.setPort(dbSett.dbPort);
dbCheck2.setDatabaseName(dbSett.dbName);
if (dbCheck2.open())
{
QString newOwner = dbSett.dbUserName;
// Получаем список таблиц
QSqlQuery query(dbCheck2);
query.exec("SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = 'public';");
while (query.next())
{
QString tableName = query.value(0).toString();
QString alterQuery = QString("ALTER TABLE %1 OWNER TO %2;").arg(tableName).arg(newOwner);
qDebug() << "Executing: " << alterQuery;
dbCheck2.exec(alterQuery);
/*
if (dbCheck2.exec(alterQuery))
{
qDebug() << "Error changing owner for table " << tableName << ":" << dbCheck2.lastError().text();
return false;
}*/
}
}
return true;
}
bool DataBaseLMS::createConnection() bool DataBaseLMS::createConnection()
{ {
dbSettings = getDataBaseSettings(); dbSettings = getDataBaseSettings();

View File

@@ -0,0 +1,218 @@
#include "databaselms.h"
#include <QtSql>
#include <QSqlDatabase>
#include <QSqlDriver>
#include <QMessageBox>
#include <QDomDocument>
#include <QProcess>
bool DataBaseLMS::checkDriverQPSQLavailable()
{
return QSqlDatabase::isDriverAvailable("QPSQL");
}
bool DataBaseLMS::checkUserLMSexist()
{
DataBaseSettings settings = getDataBaseSettings();
QSqlDatabase dbCheck = QSqlDatabase::addDatabase("QPSQL");
dbCheck.setUserName("postgres");
dbCheck.setPassword("12345678");
dbCheck.setHostName(settings.dbHostName);
dbCheck.setPort(settings.dbPort);
if (dbCheck.open())
{
QSqlQuery query = QSqlQuery(dbCheck);
query.prepare("SELECT 1 FROM pg_roles WHERE rolname = :username");
query.bindValue(":username", settings.dbUserName);
if (query.exec() && query.next())
{
qDebug() << "The user exists.";
return true;
}
else
{
qDebug() << "The user does not exist.";
return false;
}
}
else
{
qDebug() << "PostgreSQL connection error.";
return false;
}
}
bool DataBaseLMS::checkDataBaseLMSexist()
{
DataBaseSettings settings = getDataBaseSettings();
QSqlDatabase dbCheck = QSqlDatabase::addDatabase("QPSQL");
bool flDBexist = false;
dbCheck.setUserName("postgres");
dbCheck.setPassword("12345678");
dbCheck.setHostName(settings.dbHostName);
dbCheck.setPort(settings.dbPort);
if (dbCheck.open())
{
QString queryStr = QString("SELECT datname FROM pg_database");
QSqlQuery query = QSqlQuery(dbCheck);
if(queryExec(queryStr, &query))
{
while (query.next())
{
QString nameDB = "";
nameDB = query.value(0).toString();
if(nameDB == dbSettings.dbName)
{
flDBexist = true;
break;
}
}
}
}
else
{
qDebug() << "PostgreSQL connection error.";
return false;
}
return flDBexist;
}
bool DataBaseLMS::createUser(QString name)
{
DataBaseSettings settings = getDataBaseSettings();
QSqlDatabase dbCheck = QSqlDatabase::addDatabase("QPSQL");
dbCheck.setUserName("postgres");
dbCheck.setPassword("12345678");
dbCheck.setHostName(settings.dbHostName);
dbCheck.setPort(settings.dbPort);
if (dbCheck.open())
{
QString queryStr = QString("CREATE USER %1 WITH ENCRYPTED PASSWORD '%2'").arg(settings.dbUserName, settings.dbPassword);
QSqlQuery query = QSqlQuery(dbCheck);
if(queryExec(queryStr, &query))
{
qDebug() << "User created.";
return true;
}
else
{
qDebug() << "User not created.";
return false;
}
}
else
{
qDebug() << "PostgreSQL connection error.";
return false;
}
}
bool DataBaseLMS::createDB(QString name)
{
DataBaseSettings settings = getDataBaseSettings();
QSqlDatabase dbCheck = QSqlDatabase::addDatabase("QPSQL");
dbCheck.setUserName("postgres");
dbCheck.setPassword("12345678");
dbCheck.setHostName(settings.dbHostName);
dbCheck.setPort(settings.dbPort);
if (dbCheck.open())
{
//Создание БД
QString queryStr = QString("CREATE DATABASE %1").arg(settings.dbName);
QSqlQuery query = QSqlQuery(dbCheck);
if(queryExec(queryStr, &query))
{
qDebug() << "The database has been created.";
//Залитие БД
QProcess process;
//QString pgRestorePath = "C:\\restoreDB.bat";
QString pgRestorePath = "restoreDB.bat";
/*
QString dbName = "databaselms2";
QString user = "postgres";
QString backupFile = "C:\\DBLMS_EMPTY_30_09_2025.backup";
QStringList arguments;
arguments << "-d" << dbName;
arguments << "-U" << user;
arguments << backupFile;
*/
process.start("cmd /C " + pgRestorePath);
process.waitForFinished(-1); // Ждать бесконечно, пока процесс не завершится
//Назначение владельца
QString queryStr = QString("ALTER DATABASE %1 OWNER TO %2").arg(settings.dbName, settings.dbUserName);
QSqlQuery query = QSqlQuery(dbCheck);
if(queryExec(queryStr, &query))
{
}
else
return false;
}
else
{
qDebug() << "The database was not created..";
return false;
}
}
else
{
qDebug() << "PostgreSQL connection error.";
return false;
}
dbCheck.close();
QSqlDatabase dbCheck2 = QSqlDatabase::addDatabase("QPSQL");
dbCheck2.setUserName("postgres");
dbCheck2.setPassword("12345678");
dbCheck2.setHostName(settings.dbHostName);
dbCheck2.setPort(settings.dbPort);
dbCheck2.setDatabaseName(settings.dbName);
if (dbCheck2.open())
{
QString newOwner = settings.dbUserName;
// Получаем список таблиц
QSqlQuery query(dbCheck2);
query.exec("SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = 'public';");
while (query.next())
{
QString tableName = query.value(0).toString();
QString alterQuery = QString("ALTER TABLE %1 OWNER TO %2;").arg(tableName).arg(newOwner);
dbCheck2.exec(alterQuery);
/*
if (dbCheck2.exec(alterQuery))
{
qDebug() << "Error changing owner for table " << tableName << ":" << dbCheck2.lastError().text();
return false;
}*/
}
}
return true;
}

View File

@@ -4,22 +4,14 @@
<context> <context>
<name>DataBaseLMS</name> <name>DataBaseLMS</name>
<message> <message>
<location filename="../databaselms.cpp" line="93"/> <location filename="../databaselms.cpp" line="95"/>
<source>Attention!</source> <source>Attention!</source>
<translation>Внимание!</translation> <translation>Внимание!</translation>
</message> </message>
<message> <message>
<location filename="../databaselms.cpp" line="93"/> <location filename="../databaselms.cpp" line="95"/>
<source>The file could not be opened:</source> <source>The file could not be opened:</source>
<translation>Файл не может быть открыт:</translation> <translation>Файл не может быть открыт:</translation>
</message> </message>
</context> </context>
<context>
<name>InterfaceDataBaseLMS</name>
<message>
<location filename="../interfacedatabaselms.cpp" line="19"/>
<source>Connection error</source>
<translation>Ошибка подключения</translation>
</message>
</context>
</TS> </TS>

View File

@@ -412,10 +412,10 @@ void InstructorsAndTraineesWidget::updateLabelServer()
if(connectorToServer->getIsConnected()) if(connectorToServer->getIsConnected())
{ {
ServerSettings serverSettings = connectorToServer->getServerSettings(); ServerSettings serverSettings = connectorToServer->getServerSettings();
ui->lblServer->setText(serverSettings.Address + " : " +serverSettings.Port); ui->lblServer->setText(tr("connected") + " " + serverSettings.Address + " : " +serverSettings.Port);
} }
else else
ui->lblServer->setText(tr("none")); ui->lblServer->setText(tr("not connected"));
} }
void InstructorsAndTraineesWidget::setLanguageInterfase() void InstructorsAndTraineesWidget::setLanguageInterfase()

View File

@@ -171,52 +171,52 @@ The status will be set:
<context> <context>
<name>CommonView</name> <name>CommonView</name>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>Name</source> <source>Name</source>
<translation>Имя</translation> <translation>Имя</translation>
</message> </message>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>Login</source> <source>Login</source>
<translation>Логин</translation> <translation>Логин</translation>
</message> </message>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>Password</source> <source>Password</source>
<translation>Пароль</translation> <translation>Пароль</translation>
</message> </message>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>Class</source> <source>Class</source>
<translation>Класс</translation> <translation>Класс</translation>
</message> </message>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>Computer</source> <source>Computer</source>
<translation>Компьютер</translation> <translation>Компьютер</translation>
</message> </message>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>IP address</source> <source>IP address</source>
<translation>IP адрес</translation> <translation>IP адрес</translation>
</message> </message>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>Administrator</source> <source>Administrator</source>
<translation>Администратор</translation> <translation>Администратор</translation>
</message> </message>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>Archived</source> <source>Archived</source>
<translation>Архивный</translation> <translation>Архивный</translation>
</message> </message>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>Online</source> <source>Online</source>
<translation>В сети</translation> <translation>В сети</translation>
</message> </message>
<message> <message>
<location filename="../commonview.cpp" line="111"/> <location filename="../commonview.cpp" line="110"/>
<source>ID</source> <source>ID</source>
<translation>ID</translation> <translation>ID</translation>
</message> </message>
@@ -234,7 +234,12 @@ The status will be set:
<translation>Логин</translation> <translation>Логин</translation>
</message> </message>
<message> <message>
<location filename="../instructors/dialogauthorizationinstructor.ui" line="113"/> <location filename="../instructors/dialogauthorizationinstructor.ui" line="90"/>
<source>...</source>
<translation></translation>
</message>
<message>
<location filename="../instructors/dialogauthorizationinstructor.ui" line="128"/>
<source>Log in</source> <source>Log in</source>
<translation>Войти</translation> <translation>Войти</translation>
</message> </message>
@@ -301,22 +306,28 @@ The status will be set:
<translation>Пароль</translation> <translation>Пароль</translation>
</message> </message>
<message> <message>
<location filename="../instructors/dialogeditinstructor.ui" line="109"/> <location filename="../instructors/dialogeditinstructor.ui" line="87"/>
<location filename="../instructors/dialogeditinstructor.ui" line="104"/>
<source>...</source>
<translation></translation>
</message>
<message>
<location filename="../instructors/dialogeditinstructor.ui" line="141"/>
<source>Administrator</source> <source>Administrator</source>
<translation>Администратор</translation> <translation>Администратор</translation>
</message> </message>
<message> <message>
<location filename="../instructors/dialogeditinstructor.ui" line="136"/> <location filename="../instructors/dialogeditinstructor.ui" line="168"/>
<source>Archived</source> <source>Archived</source>
<translation>Архивный</translation> <translation>Архивный</translation>
</message> </message>
<message> <message>
<location filename="../instructors/dialogeditinstructor.ui" line="163"/> <location filename="../instructors/dialogeditinstructor.ui" line="195"/>
<source>Logged</source> <source>Logged</source>
<translation>Залогирован</translation> <translation>Залогирован</translation>
</message> </message>
<message> <message>
<location filename="../instructors/dialogeditinstructor.ui" line="201"/> <location filename="../instructors/dialogeditinstructor.ui" line="233"/>
<source>Save</source> <source>Save</source>
<translation>Сохранить</translation> <translation>Сохранить</translation>
</message> </message>
@@ -344,17 +355,36 @@ The status will be set:
<translation>Пароль</translation> <translation>Пароль</translation>
</message> </message>
<message> <message>
<location filename="../trainees/dialogedittrainee.ui" line="123"/> <location filename="../trainees/dialogedittrainee.ui" line="101"/>
<location filename="../trainees/dialogedittrainee.ui" line="112"/>
<source>...</source>
<translation></translation>
</message>
<message>
<location filename="../trainees/dialogedittrainee.ui" line="149"/>
<source>Archived</source> <source>Archived</source>
<translation>Архивный</translation> <translation>Архивный</translation>
</message> </message>
<message> <message>
<location filename="../trainees/dialogedittrainee.ui" line="150"/> <location filename="../trainees/dialogedittrainee.ui" line="176"/>
<source>Logged</source> <source>Logged</source>
<translation>Залогирован</translation> <translation>Залогирован</translation>
</message> </message>
<message> <message>
<location filename="../trainees/dialogedittrainee.ui" line="188"/> <location filename="../trainees/dialogedittrainee.ui" line="214"/>
<source>Save</source>
<translation>Сохранить</translation>
</message>
</context>
<context>
<name>DialogNewPassword</name>
<message>
<location filename="../dialognewpassword.ui" line="14"/>
<source>Dialog</source>
<translation>Диалог</translation>
</message>
<message>
<location filename="../dialognewpassword.ui" line="28"/>
<source>Save</source> <source>Save</source>
<translation>Сохранить</translation> <translation>Сохранить</translation>
</message> </message>
@@ -451,76 +481,76 @@ The status will be set:
<translation>Удалить инструктора</translation> <translation>Удалить инструктора</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.ui" line="121"/> <location filename="../instructors/editorinstructors.ui" line="127"/>
<location filename="../instructors/editorinstructors.cpp" line="266"/> <location filename="../instructors/editorinstructors.cpp" line="224"/>
<source>To archive</source> <source>To archive</source>
<translation>Архивировать</translation> <translation>Архивировать</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.ui" line="159"/> <location filename="../instructors/editorinstructors.ui" line="165"/>
<source>Edit</source> <source>Edit</source>
<translation>Редактировать</translation> <translation>Редактировать</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.ui" line="210"/> <location filename="../instructors/editorinstructors.ui" line="216"/>
<source>Show archive</source> <source>Show archive</source>
<translation>Показать архив</translation> <translation>Показать архив</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="119"/> <location filename="../instructors/editorinstructors.cpp" line="77"/>
<source>You cannot delete the Administrator.</source> <source>You cannot delete the Administrator.</source>
<translation>Нельзя удалить администратора.</translation> <translation>Нельзя удалить администратора.</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="125"/> <location filename="../instructors/editorinstructors.cpp" line="83"/>
<source>You cannot delete a logged-in instructor.</source> <source>You cannot delete a logged-in instructor.</source>
<translation>Вы не можете удалить инструктора, вошедшего в систему.</translation> <translation>Вы не можете удалить инструктора, вошедшего в систему.</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="129"/> <location filename="../instructors/editorinstructors.cpp" line="87"/>
<source>The deletion will be irrevocable. <source>The deletion will be irrevocable.
Delete it anyway?</source> Delete it anyway?</source>
<translation>Удаление будет безвозвратным. <translation>Удаление будет безвозвратным.
Всё равно удалить?</translation> Всё равно удалить?</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="164"/> <location filename="../instructors/editorinstructors.cpp" line="122"/>
<source>You cannot archive a logged-in instructor.</source> <source>You cannot archive a logged-in instructor.</source>
<translation>Вы не можете заархивировать инструктора, вошедшего в систему.</translation> <translation>Вы не можете заархивировать инструктора, вошедшего в систему.</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="201"/> <location filename="../instructors/editorinstructors.cpp" line="159"/>
<source>You cannot edit a logged-in instructor.</source> <source>You cannot edit a logged-in instructor.</source>
<translation>Вы не можете редактировать инструктора, вошедшего в систему.</translation> <translation>Вы не можете редактировать инструктора, вошедшего в систему.</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="261"/> <location filename="../instructors/editorinstructors.cpp" line="219"/>
<source>From archive</source> <source>From archive</source>
<translation>Разархивировать</translation> <translation>Разархивировать</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="307"/> <location filename="../instructors/editorinstructors.cpp" line="265"/>
<source>Unacceptable instructor name has been entered. <source>Unacceptable instructor name has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Введено неприемлемое имя инструктора. <translation>Введено неприемлемое имя инструктора.
Изменения приняты не будут.</translation> Изменения приняты не будут.</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="313"/> <location filename="../instructors/editorinstructors.cpp" line="271"/>
<source>Unacceptable instructor login has been entered. <source>Unacceptable instructor login has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Введен неприемлемый логин инструктора. <translation>Введен неприемлемый логин инструктора.
Изменения приняты не будут.</translation> Изменения приняты не будут.</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="319"/> <location filename="../instructors/editorinstructors.cpp" line="277"/>
<source>Unacceptable instructor password has been entered. <source>Unacceptable instructor password has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Введен неприемлемый пароль инструктора. <translation>Введен неприемлемый пароль инструктора.
Изменения приняты не будут.</translation> Изменения приняты не будут.</translation>
</message> </message>
<message> <message>
<location filename="../instructors/editorinstructors.cpp" line="328"/> <location filename="../instructors/editorinstructors.cpp" line="286"/>
<source>An existing instructor or trainee login has been entered. <source>An existing instructor or trainee login has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Введен существующий логин инструктора или обучаемого. <translation>Введен существующий логин инструктора или обучаемого.
@@ -556,8 +586,8 @@ The changes will not be accepted.</source>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.ui" line="206"/> <location filename="../trainees/editortrainees.ui" line="206"/>
<location filename="../trainees/editortrainees.cpp" line="421"/> <location filename="../trainees/editortrainees.cpp" line="326"/>
<location filename="../trainees/editortrainees.cpp" line="446"/> <location filename="../trainees/editortrainees.cpp" line="351"/>
<source>To archive</source> <source>To archive</source>
<translation>Архивировать</translation> <translation>Архивировать</translation>
</message> </message>
@@ -572,76 +602,76 @@ The changes will not be accepted.</source>
<translation>Показать архив</translation> <translation>Показать архив</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="122"/> <location filename="../trainees/editortrainees.cpp" line="76"/>
<source>The group is not empty. <source>The group is not empty.
It is not possible to delete a non-empty group.</source> It is not possible to delete a non-empty group.</source>
<translation>Группа не пуста. Невозможно удалить непустую группу.</translation> <translation>Группа не пуста. Невозможно удалить непустую группу.</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="127"/> <location filename="../trainees/editortrainees.cpp" line="81"/>
<location filename="../trainees/editortrainees.cpp" line="231"/> <location filename="../trainees/editortrainees.cpp" line="136"/>
<source>The deletion will be irrevocable. <source>The deletion will be irrevocable.
Delete it anyway?</source> Delete it anyway?</source>
<translation>Удаление будет безвозвратным. <translation>Удаление будет безвозвратным.
Всё равно удалить?</translation> Всё равно удалить?</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="227"/> <location filename="../trainees/editortrainees.cpp" line="132"/>
<source>You cannot delete a logged-in trainee.</source> <source>You cannot delete a logged-in trainee.</source>
<translation>Вы не можете удалить обучаемого, вошедшего в систему.</translation> <translation>Вы не можете удалить обучаемого, вошедшего в систему.</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="266"/> <location filename="../trainees/editortrainees.cpp" line="171"/>
<source>You cannot archive a logged-in trainee.</source> <source>You cannot archive a logged-in trainee.</source>
<translation>Вы не можете заархивировать обучаемого, вошедшего в систему.</translation> <translation>Вы не можете заархивировать обучаемого, вошедшего в систему.</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="312"/> <location filename="../trainees/editortrainees.cpp" line="217"/>
<source>You cannot edit a logged-in trainee.</source> <source>You cannot edit a logged-in trainee.</source>
<translation>Вы не можете редактировать обучаемого, вошедшего в систему.</translation> <translation>Вы не можете редактировать обучаемого, вошедшего в систему.</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="439"/> <location filename="../trainees/editortrainees.cpp" line="344"/>
<source>From archive</source> <source>From archive</source>
<translation>Разархивировать</translation> <translation>Разархивировать</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="481"/> <location filename="../trainees/editortrainees.cpp" line="386"/>
<source>Unacceptable group name has been entered. <source>Unacceptable group name has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Введено неприемлемое название группы. <translation>Введено неприемлемое название группы.
Изменения приняты не будут.</translation> Изменения приняты не будут.</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="491"/> <location filename="../trainees/editortrainees.cpp" line="396"/>
<source>An existing group name has been entered. <source>An existing group name has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Введено существующее название группы. <translation>Введено существующее название группы.
Изменения приняты не будут.</translation> Изменения приняты не будут.</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="505"/> <location filename="../trainees/editortrainees.cpp" line="410"/>
<source>Unacceptable trainee name has been entered. <source>Unacceptable trainee name has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Введено неприемлемое имя обучаемого. <translation>Введено неприемлемое имя обучаемого.
Изменения приняты не будут.</translation> Изменения приняты не будут.</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="511"/> <location filename="../trainees/editortrainees.cpp" line="416"/>
<source>Unacceptable trainee login has been entered. <source>Unacceptable trainee login has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Введен неприемлемый логин обучаемого. <translation>Введен неприемлемый логин обучаемого.
Изменения приняты не будут.</translation> Изменения приняты не будут.</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="517"/> <location filename="../trainees/editortrainees.cpp" line="422"/>
<source>Unacceptable trainee password has been entered. <source>Unacceptable trainee password has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Был введен неприемлемый пароль обучаемого. <translation>Был введен неприемлемый пароль обучаемого.
Изменения приняты не будут.</translation> Изменения приняты не будут.</translation>
</message> </message>
<message> <message>
<location filename="../trainees/editortrainees.cpp" line="526"/> <location filename="../trainees/editortrainees.cpp" line="431"/>
<source>An existing instructor or trainee login has been entered. <source>An existing instructor or trainee login has been entered.
The changes will not be accepted.</source> The changes will not be accepted.</source>
<translation>Введен существующий логин инструктора или обучаемого. <translation>Введен существующий логин инструктора или обучаемого.
@@ -766,48 +796,57 @@ Delete it anyway?</source>
<message> <message>
<location filename="../instructorsandtraineeswidget.ui" line="343"/> <location filename="../instructorsandtraineeswidget.ui" line="343"/>
<location filename="../instructorsandtraineeswidget.ui" line="417"/> <location filename="../instructorsandtraineeswidget.ui" line="417"/>
<location filename="../instructorsandtraineeswidget.cpp" line="400"/> <location filename="../instructorsandtraineeswidget.cpp" line="402"/>
<location filename="../instructorsandtraineeswidget.cpp" line="416"/>
<source>none</source> <source>none</source>
<translation>нет</translation> <translation>нет</translation>
</message> </message>
<message> <message>
<location filename="../instructorsandtraineeswidget.cpp" line="130"/> <location filename="../instructorsandtraineeswidget.cpp" line="129"/>
<source>The file could not be opened </source> <source>The file could not be opened </source>
<translation>Файл не может быть открыт </translation> <translation>Файл не может быть открыт </translation>
</message> </message>
<message> <message>
<location filename="../instructorsandtraineeswidget.cpp" line="194"/> <location filename="../instructorsandtraineeswidget.cpp" line="193"/>
<source>Instructor authorization.</source> <source>Instructor authorization.</source>
<translation>Авторизация инструктора.</translation> <translation>Авторизация инструктора.</translation>
</message> </message>
<message> <message>
<location filename="../instructorsandtraineeswidget.cpp" line="220"/> <location filename="../instructorsandtraineeswidget.cpp" line="219"/>
<source>Instructor deauthorization</source> <source>Instructor deauthorization</source>
<translation>Деавторизация инструктора</translation> <translation>Деавторизация инструктора</translation>
</message> </message>
<message> <message>
<location filename="../instructorsandtraineeswidget.cpp" line="220"/> <location filename="../instructorsandtraineeswidget.cpp" line="219"/>
<source>Error!</source> <source>Error!</source>
<translation>Ошибка!</translation> <translation>Ошибка!</translation>
</message> </message>
<message> <message>
<location filename="../instructorsandtraineeswidget.cpp" line="262"/> <location filename="../instructorsandtraineeswidget.cpp" line="261"/>
<source>The server is not available!</source> <source>The server is not available!</source>
<translation>Сервер недоступен!</translation> <translation>Сервер недоступен!</translation>
</message> </message>
<message> <message>
<location filename="../instructorsandtraineeswidget.cpp" line="457"/> <location filename="../instructorsandtraineeswidget.cpp" line="415"/>
<source>connected</source>
<translation>подключен</translation>
</message>
<message>
<location filename="../instructorsandtraineeswidget.cpp" line="418"/>
<source>not connected</source>
<translation>не подключен</translation>
</message>
<message>
<location filename="../instructorsandtraineeswidget.cpp" line="459"/>
<source>Server settings have been changed. Please reconnect to the server.</source> <source>Server settings have been changed. Please reconnect to the server.</source>
<translation>Настройки сервера изменены. Выполните переподключение к серверу.</translation> <translation>Настройки сервера изменены. Выполните переподключение к серверу.</translation>
</message> </message>
<message> <message>
<location filename="../instructorsandtraineeswidget.cpp" line="304"/> <location filename="../instructorsandtraineeswidget.cpp" line="303"/>
<source>Instructor authorization</source> <source>Instructor authorization</source>
<translation>Авторизация инструктора</translation> <translation>Авторизация инструктора</translation>
</message> </message>
<message> <message>
<location filename="../instructorsandtraineeswidget.cpp" line="194"/> <location filename="../instructorsandtraineeswidget.cpp" line="193"/>
<source>Invalid login or password!</source> <source>Invalid login or password!</source>
<translation>Неправильный логин или пароль!</translation> <translation>Неправильный логин или пароль!</translation>
</message> </message>
@@ -930,73 +969,73 @@ Delete it anyway?</source>
<translation>Обучаемый</translation> <translation>Обучаемый</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="38"/> <location filename="../trainees/personalcardtrainee.ui" line="59"/>
<source>Name</source> <source>Name</source>
<translation>Имя</translation> <translation>Имя</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="75"/> <location filename="../trainees/personalcardtrainee.ui" line="45"/>
<location filename="../trainees/personalcardtrainee.ui" line="96"/> <location filename="../trainees/personalcardtrainee.ui" line="96"/>
<location filename="../trainees/personalcardtrainee.ui" line="117"/> <location filename="../trainees/personalcardtrainee.ui" line="117"/>
<location filename="../trainees/personalcardtrainee.ui" line="138"/> <location filename="../trainees/personalcardtrainee.ui" line="145"/>
<location filename="../trainees/personalcardtrainee.ui" line="159"/> <location filename="../trainees/personalcardtrainee.ui" line="166"/>
<source>0</source> <source>0</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="89"/> <location filename="../trainees/personalcardtrainee.ui" line="138"/>
<source>Assigned FIM</source> <source>Assigned FIM</source>
<translation>Назначенные FIM</translation> <translation>Назначенные FIM</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="110"/> <location filename="../trainees/personalcardtrainee.ui" line="38"/>
<source>Assigned AMM</source> <source>Assigned AMM</source>
<translation>Назначенные AMM</translation> <translation>Назначенные AMM</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="68"/> <location filename="../trainees/personalcardtrainee.ui" line="159"/>
<source>Last login</source> <source>Last login</source>
<translation>Последний вход</translation> <translation>Последний вход</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="131"/> <location filename="../trainees/personalcardtrainee.ui" line="89"/>
<source>Time spent on the simulator</source> <source>Time spent on the simulator</source>
<translation>Время работы на тренажере</translation> <translation>Время работы на тренажере</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="152"/> <location filename="../trainees/personalcardtrainee.ui" line="110"/>
<source>Last exit</source> <source>Last exit</source>
<translation>Последний выход</translation> <translation>Последний выход</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="174"/> <location filename="../trainees/personalcardtrainee.ui" line="188"/>
<source>Chat</source> <source>Chat</source>
<translation>Чат</translation> <translation>Чат</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="194"/> <location filename="../trainees/personalcardtrainee.ui" line="208"/>
<source>Tasks</source> <source>Tasks</source>
<translation>Задачи</translation> <translation>Задачи</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="204"/> <location filename="../trainees/personalcardtrainee.ui" line="218"/>
<source>AMM</source> <source>AMM</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="216"/> <location filename="../trainees/personalcardtrainee.ui" line="230"/>
<location filename="../trainees/personalcardtrainee.ui" line="253"/> <location filename="../trainees/personalcardtrainee.ui" line="267"/>
<source>List</source> <source>List</source>
<translation>Перечень</translation> <translation>Перечень</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="227"/> <location filename="../trainees/personalcardtrainee.ui" line="241"/>
<location filename="../trainees/personalcardtrainee.ui" line="264"/> <location filename="../trainees/personalcardtrainee.ui" line="278"/>
<source>Attached</source> <source>Attached</source>
<translation>Назначенные</translation> <translation>Назначенные</translation>
</message> </message>
<message> <message>
<location filename="../trainees/personalcardtrainee.ui" line="241"/> <location filename="../trainees/personalcardtrainee.ui" line="255"/>
<source>FIM</source> <source>FIM</source>
<translation></translation> <translation></translation>
</message> </message>
@@ -1108,12 +1147,12 @@ Delete it anyway?</source>
<context> <context>
<name>TraineesView</name> <name>TraineesView</name>
<message> <message>
<location filename="../trainees/traineesview.cpp" line="71"/> <location filename="../trainees/traineesview.cpp" line="69"/>
<source>yes</source> <source>yes</source>
<translation>да</translation> <translation>да</translation>
</message> </message>
<message> <message>
<location filename="../trainees/traineesview.cpp" line="77"/> <location filename="../trainees/traineesview.cpp" line="75"/>
<source>no</source> <source>no</source>
<translation>нет</translation> <translation>нет</translation>
</message> </message>

View File

@@ -13,6 +13,8 @@ DialogCheckDB::DialogCheckDB(ProviderDBLMS* providerDBLMS, QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
ui->btnRepare->setObjectName("btnRepare");
ui->btnRepare->setEnabled(false); ui->btnRepare->setEnabled(false);
check(); check();

View File

@@ -28,7 +28,7 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>150</width> <width>170</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@@ -44,6 +44,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QLabel" name="lblDriverResIco"> <widget class="QLabel" name="lblDriverResIco">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -86,7 +99,7 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>150</width> <width>170</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@@ -102,6 +115,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QLabel" name="lblUserResIco"> <widget class="QLabel" name="lblUserResIco">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -144,7 +170,7 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>150</width> <width>170</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@@ -160,6 +186,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QLabel" name="lblDBResIco"> <widget class="QLabel" name="lblDBResIco">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -190,21 +229,21 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_Ctrl"> <layout class="QHBoxLayout" name="horizontalLayout_Ctrl">
<item>
<widget class="QToolButton" name="toolButton">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QToolButton" name="btnRepare"> <widget class="QToolButton" name="btnRepare">
<property name="minimumSize"> <property name="minimumSize">

View File

@@ -14,6 +14,7 @@ DialogSettingsTray::DialogSettingsTray(ProviderDBLMS* providerDBLMS, QWidget *pa
ui->setupUi(this); ui->setupUi(this);
ui->btnSave->setObjectName("btnSave"); ui->btnSave->setObjectName("btnSave");
ui->btnCheckDB->setObjectName("btnCheckDB");
/* Создаем строку для регулярного выражения */ /* Создаем строку для регулярного выражения */
QString ipRange = "(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])"; QString ipRange = "(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])";
@@ -54,6 +55,7 @@ DialogSettingsTray::DialogSettingsTray(ProviderDBLMS* providerDBLMS, QWidget *pa
} }
ui->btnSave->setEnabled(false); ui->btnSave->setEnabled(false);
ui->btnCheckDB->setEnabled(true);
flSettingsServerChanged = false; flSettingsServerChanged = false;
} }
@@ -179,6 +181,8 @@ void DialogSettingsTray::on_btnSave_clicked()
saveSettings(); saveSettings();
ui->btnCheckDB->setEnabled(true);
this->accept(); this->accept();
} }
@@ -202,30 +206,35 @@ void DialogSettingsTray::on_DialogSettingsTray_accepted()
void DialogSettingsTray::on_editNameDB_textChanged(const QString &arg1) void DialogSettingsTray::on_editNameDB_textChanged(const QString &arg1)
{ {
ui->btnSave->setEnabled(true); ui->btnSave->setEnabled(true);
ui->btnCheckDB->setEnabled(false);
flSettingsServerChanged = true; flSettingsServerChanged = true;
} }
void DialogSettingsTray::on_editHostName_textChanged(const QString &arg1) void DialogSettingsTray::on_editHostName_textChanged(const QString &arg1)
{ {
ui->btnSave->setEnabled(true); ui->btnSave->setEnabled(true);
ui->btnCheckDB->setEnabled(false);
flSettingsServerChanged = true; flSettingsServerChanged = true;
} }
void DialogSettingsTray::on_editPort_textChanged(const QString &arg1) void DialogSettingsTray::on_editPort_textChanged(const QString &arg1)
{ {
ui->btnSave->setEnabled(true); ui->btnSave->setEnabled(true);
ui->btnCheckDB->setEnabled(false);
flSettingsServerChanged = true; flSettingsServerChanged = true;
} }
void DialogSettingsTray::on_editUserName_textChanged(const QString &arg1) void DialogSettingsTray::on_editUserName_textChanged(const QString &arg1)
{ {
ui->btnSave->setEnabled(true); ui->btnSave->setEnabled(true);
ui->btnCheckDB->setEnabled(false);
flSettingsServerChanged = true; flSettingsServerChanged = true;
} }
void DialogSettingsTray::on_editPassword_textChanged(const QString &arg1) void DialogSettingsTray::on_editPassword_textChanged(const QString &arg1)
{ {
ui->btnSave->setEnabled(true); ui->btnSave->setEnabled(true);
ui->btnCheckDB->setEnabled(false);
flSettingsServerChanged = true; flSettingsServerChanged = true;
} }

View File

@@ -181,6 +181,19 @@
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_Check"> <layout class="QHBoxLayout" name="horizontalLayout_Check">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QToolButton" name="btnCheckDB"> <widget class="QToolButton" name="btnCheckDB">
<property name="minimumSize"> <property name="minimumSize">
@@ -190,7 +203,7 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>Check DB</string> <string>Check</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="ServerLMS.qrc"> <iconset resource="ServerLMS.qrc">

View File

@@ -9,7 +9,7 @@ MultiThreadServer::MultiThreadServer(ServerLMSWidget *widget,UpdateController *u
updateController(updateController), updateController(updateController),
dataParser(dataParser), dataParser(dataParser),
stateServer(stoped), stateServer(stoped),
stateBlockAutorization(unblocked) stateBlockAutorization(blocked)
{ {
clientsMap = new QMap<int,ClientHandler*>; clientsMap = new QMap<int,ClientHandler*>;
} }

View File

@@ -33,6 +33,10 @@ public:
{ {
return stateBlockAutorization; return stateBlockAutorization;
} }
EStateServer getStateServer()
{
return stateServer;
}
signals: signals:
void sigInitClient(int descriptor, ServerLMSWidget *serverWidget, void sigInitClient(int descriptor, ServerLMSWidget *serverWidget,
UpdateController *updateController, DataParser *dataParser); UpdateController *updateController, DataParser *dataParser);

View File

@@ -49,7 +49,6 @@ ServerLMSWidget::~ServerLMSWidget()
{ {
server->stopServer(); server->stopServer();
//updateThread->exit();
updateThread->quit(); updateThread->quit();
updateThread->wait(); updateThread->wait();
delete updateThread; delete updateThread;
@@ -64,7 +63,6 @@ ServerLMSWidget::~ServerLMSWidget()
delete mutex; delete mutex;
//loggerThread->exit();
loggerThread->quit(); loggerThread->quit();
loggerThread->wait(); loggerThread->wait();
delete loggerThread; delete loggerThread;
@@ -82,20 +80,7 @@ void ServerLMSWidget::changeEvent(QEvent *event)
{ {
ui->retranslateUi(this); // переведём окно заново ui->retranslateUi(this); // переведём окно заново
if(providerDBLMS->DBisConnected()) updateStateServer();
{
//Настройки БД
DataBaseSettings dbSettings = providerDBLMS->getDBSettings();
QString strDBsettings = QString("%1 (%2) %3 : %4").arg(dbSettings.dbName,
dbSettings.dbType,
dbSettings.dbHostName,
QString::number(dbSettings.dbPort));
ui->lblDBsettings->setText(strDBsettings);
}
else
{
ui->lblDBsettings->setText("");
}
} }
} }
@@ -161,9 +146,11 @@ void ServerLMSWidget::on_btnStartServer_clicked()
ui->btnStartServer->setEnabled(false); ui->btnStartServer->setEnabled(false);
ui->btnStopServer->setEnabled(true); ui->btnStopServer->setEnabled(true);
ui->lblOnOff->setPixmap(QPixmap(QStringLiteral(":/resources/icons/switchOn.png")));
slot_BlockAutorization(false); slot_BlockAutorization(false);
emit signal_Tray_ShowMessage(tr("Server is started!"));
} }
updateStateServer();
} }
void ServerLMSWidget::on_btnStopServer_clicked() void ServerLMSWidget::on_btnStopServer_clicked()
@@ -172,9 +159,11 @@ void ServerLMSWidget::on_btnStopServer_clicked()
{ {
ui->btnStopServer->setEnabled(false); ui->btnStopServer->setEnabled(false);
ui->btnStartServer->setEnabled(true); ui->btnStartServer->setEnabled(true);
ui->lblOnOff->setPixmap(QPixmap(QStringLiteral(":/resources/icons/switchOff.png")));
slot_BlockAutorization(true); slot_BlockAutorization(true);
emit signal_Tray_ShowMessage(tr("Server is stoped!"));
} }
updateStateServer();
} }
void ServerLMSWidget::on_btnSettings_clicked() void ServerLMSWidget::on_btnSettings_clicked()
@@ -200,8 +189,7 @@ void ServerLMSWidget::on_btnSettings_clicked()
providerDBLMS->DisConnectionFromDB(); providerDBLMS->DisConnectionFromDB();
ui->lblDBsettings->setText(""); updateStateServer();
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
QMessageBox::warning(this, tr("Warning!"), tr("Database settings have been changed.\nThe server will be restarted.")); QMessageBox::warning(this, tr("Warning!"), tr("Database settings have been changed.\nThe server will be restarted."));
@@ -313,19 +301,19 @@ void ServerLMSWidget::startInitialization()
ui->btnStartServer->setEnabled(true); ui->btnStartServer->setEnabled(true);
flStartInitialization = true; flStartInitialization = true;
updateStateServer();
} }
void ServerLMSWidget::tryConnectionToDB() void ServerLMSWidget::tryConnectionToDB()
{ {
if(! providerDBLMS->ConnectionToDB()) if(! providerDBLMS->ConnectionToDB())
{ {
ui->lblDBsettings->setText("");
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
ui->btnStopServer->setEnabled(false);
ui->btnStartServer->setEnabled(false);
//QMessageBox::critical(this, tr("Error!"), tr("Database connection error!"));
emit signal_Tray_ShowMessage(tr("Database connection error!"), QSystemTrayIcon::Critical); emit signal_Tray_ShowMessage(tr("Database connection error!"), QSystemTrayIcon::Critical);
emit signal_Menu_ShowWindow();
QMessageBox::critical(this, tr("Error!"), tr("Database connection error!"));
} }
else else
{ {
@@ -337,11 +325,60 @@ void ServerLMSWidget::tryConnectionToDB()
dbSettings.dbType, dbSettings.dbType,
dbSettings.dbHostName, dbSettings.dbHostName,
QString::number(dbSettings.dbPort)); QString::number(dbSettings.dbPort));
ui->lblDBsettings->setText(strDBsettings);
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
emit signal_Tray_ShowMessage(tr("Database connection OK!") + "\n" + strDBsettings); emit signal_Tray_ShowMessage(tr("Database connection OK!") + "\n" + strDBsettings);
on_btnStartServer_clicked(); on_btnStartServer_clicked();
} }
updateStateServer();
}
void ServerLMSWidget::updateStateServer()
{
if(server)
{
if(server->getStateServer() == EStateServer::started)
{
ui->lblOnOffText->setText(tr("started"));
ui->lblOnOff->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
}
else
{
ui->lblOnOffText->setText(tr("stoped"));
ui->lblOnOff->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
}
if(server->getStateBlockAutorization() == EStateBlockAutorization::unblocked)
{
ui->lblBlockAuth->setPixmap(QPixmap(QStringLiteral(":/resources/icons/open.png")));
}
else
{
ui->lblBlockAuth->setPixmap(QPixmap(QStringLiteral(":/resources/icons/lock.png")));
}
}
if(providerDBLMS)
{
if(providerDBLMS->DBisConnected())
{
//Настройки БД
DataBaseSettings dbSettings = providerDBLMS->getDBSettings();
QString strDBsettings = tr("connected") + QString(" [%1 (%2) %3 : %4]").arg(dbSettings.dbName,
dbSettings.dbType,
dbSettings.dbHostName,
QString::number(dbSettings.dbPort));
ui->lblDBsettings->setText(strDBsettings);
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGreen.png")));
}
else
{
ui->lblDBsettings->setText(tr("not connected"));
ui->lblDBisConnected->setPixmap(QPixmap(QStringLiteral(":/resources/icons/circleGray.png")));
ui->btnStopServer->setEnabled(false);
ui->btnStartServer->setEnabled(false);
}
}
} }

View File

@@ -68,6 +68,9 @@ signals:
//сигнал вывода сообщения из трея //сигнал вывода сообщения из трея
void signal_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information); void signal_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information);
void signal_Menu_ShowWindow();
void signal_Menu_HideWindow();
void sigRecognize(); void sigRecognize();
void sigCalculateFullHash(); void sigCalculateFullHash();
void sigUpdateController(CommonClientHandler* commonClientHandler,DataParser *dataParser,AssetsManager *assetManager); void sigUpdateController(CommonClientHandler* commonClientHandler,DataParser *dataParser,AssetsManager *assetManager);
@@ -121,6 +124,8 @@ private:
void tryConnectionToDB(); void tryConnectionToDB();
void updateStateServer();
private: private:
Ui::ServerLMSWidget *ui; Ui::ServerLMSWidget *ui;

View File

@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>1000</width>
<height>600</height> <height>600</height>
</rect> </rect>
</property> </property>
@@ -23,7 +23,7 @@
<item row="0" column="0"> <item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_Main"> <layout class="QVBoxLayout" name="verticalLayout_Main">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_State"> <layout class="QHBoxLayout" name="horizontalLayout_Ctrl">
<item> <item>
<widget class="QToolButton" name="btnStartServer"> <widget class="QToolButton" name="btnStartServer">
<property name="minimumSize"> <property name="minimumSize">
@@ -106,25 +106,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="lblOnOff">
<property name="maximumSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="ServerLMS.qrc">:/resources/icons/switchOff.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer_1"> <spacer name="horizontalSpacer_1">
<property name="orientation"> <property name="orientation">
@@ -222,79 +203,11 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_DBsettings"> <layout class="QHBoxLayout" name="horizontalLayout_State">
<item> <item>
<widget class="QLabel" name="lblDBisConnected"> <layout class="QHBoxLayout" name="horizontalLayout_OnOff">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../InstructorsAndTrainees/InstructorsAndTrainees.qrc">:/resources/icons/circleGray.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_DataBase">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Data base: </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblDBsettings">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_Block">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="lblOnOff">
<property name="text">
<string>Authorization</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblBlockAuth">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>32</width> <width>32</width>
@@ -311,13 +224,140 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap resource="ServerLMS.qrc">:/resources/icons/open.png</pixmap> <pixmap resource="../InstructorsAndTrainees/InstructorsAndTrainees.qrc">:/resources/icons/circleGray.png</pixmap>
</property> </property>
<property name="scaledContents"> <property name="scaledContents">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="label_Server">
<property name="text">
<string>Server: </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblOnOffText">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_DBsettings">
<item>
<widget class="QLabel" name="lblDBisConnected">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../InstructorsAndTrainees/InstructorsAndTrainees.qrc">:/resources/icons/circleGray.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_DataBase">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Data base: </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblDBsettings">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_Block">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Authorization</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblBlockAuth">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="ServerLMS.qrc">:/resources/icons/open.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

View File

@@ -9,6 +9,86 @@
<translation>ООО Константа-Дизайн</translation> <translation>ООО Константа-Дизайн</translation>
</message> </message>
</context> </context>
<context>
<name>DialogCheckDB</name>
<message>
<location filename="../dialogcheckdb.ui" line="14"/>
<location filename="../dialogcheckdb.ui" line="152"/>
<source>Database</source>
<translation>База данных</translation>
</message>
<message>
<location filename="../dialogcheckdb.ui" line="36"/>
<source>Driver PostgreSQL</source>
<translation>Драйвер PostgreSQL</translation>
</message>
<message>
<location filename="../dialogcheckdb.ui" line="43"/>
<location filename="../dialogcheckdb.ui" line="101"/>
<location filename="../dialogcheckdb.ui" line="159"/>
<location filename="../dialogcheckdb.ui" line="204"/>
<source>...</source>
<translation></translation>
</message>
<message>
<location filename="../dialogcheckdb.ui" line="94"/>
<source>User</source>
<translation>Пользователь</translation>
</message>
<message>
<location filename="../dialogcheckdb.ui" line="217"/>
<source>Repare</source>
<translation>Восстановить</translation>
</message>
<message>
<location filename="../dialogcheckdb.cpp" line="35"/>
<source>Installed</source>
<translation>Установлен</translation>
</message>
<message>
<location filename="../dialogcheckdb.cpp" line="40"/>
<source>Not installed</source>
<translation>Не установлен</translation>
</message>
<message>
<location filename="../dialogcheckdb.cpp" line="47"/>
<location filename="../dialogcheckdb.cpp" line="59"/>
<source>Exist</source>
<translation>Существует</translation>
</message>
<message>
<location filename="../dialogcheckdb.cpp" line="52"/>
<location filename="../dialogcheckdb.cpp" line="64"/>
<source>Not exist</source>
<translation>Не существует</translation>
</message>
<message>
<location filename="../dialogcheckdb.cpp" line="78"/>
<source>Warning!</source>
<translation>Внимание!</translation>
</message>
<message>
<location filename="../dialogcheckdb.cpp" line="78"/>
<source>Install PostgreSQL.</source>
<translation>Установите PostgreSQL.</translation>
</message>
<message>
<location filename="../dialogcheckdb.cpp" line="86"/>
<location filename="../dialogcheckdb.cpp" line="95"/>
<source>Error!</source>
<translation>Ошибка!</translation>
</message>
<message>
<location filename="../dialogcheckdb.cpp" line="86"/>
<source>Failed to create user!</source>
<translation>Ошибка создания пользователя!</translation>
</message>
<message>
<location filename="../dialogcheckdb.cpp" line="95"/>
<source>Failed to create Database!</source>
<translation>Ошибка создания Базы данных!</translation>
</message>
</context>
<context> <context>
<name>DialogSettingsTray</name> <name>DialogSettingsTray</name>
<message> <message>
@@ -57,7 +137,12 @@
<translation>Пароль</translation> <translation>Пароль</translation>
</message> </message>
<message> <message>
<location filename="../dialogsettingstray.ui" line="211"/> <location filename="../dialogsettingstray.ui" line="193"/>
<source>Check DB</source>
<translation>Проверить БД</translation>
</message>
<message>
<location filename="../dialogsettingstray.ui" line="241"/>
<source>Save</source> <source>Save</source>
<translation>Сохранить</translation> <translation>Сохранить</translation>
</message> </message>
@@ -70,32 +155,38 @@
<translation>Форма</translation> <translation>Форма</translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.ui" line="207"/> <location filename="../serverlmswidget.ui" line="188"/>
<source>Logger</source> <source>Logger</source>
<translation>Логгер</translation> <translation>Логгер</translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.ui" line="172"/> <location filename="../serverlmswidget.ui" line="153"/>
<source>Clients</source> <source>Clients</source>
<translation>Клиенты</translation> <translation>Клиенты</translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.ui" line="150"/> <location filename="../serverlmswidget.ui" line="131"/>
<source>Settings</source> <source>Settings</source>
<translation>Настройки</translation> <translation>Настройки</translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.ui" line="235"/> <location filename="../serverlmswidget.ui" line="237"/>
<source>Server: </source>
<translation>Сервер: </translation>
</message>
<message>
<location filename="../serverlmswidget.ui" line="295"/>
<source>Data base: </source> <source>Data base: </source>
<translation>База данных: </translation> <translation>База данных: </translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.ui" line="242"/> <location filename="../serverlmswidget.ui" line="256"/>
<location filename="../serverlmswidget.ui" line="302"/>
<source>...</source> <source>...</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.ui" line="264"/> <location filename="../serverlmswidget.ui" line="324"/>
<source>Authorization</source> <source>Authorization</source>
<translation>Авторизация</translation> <translation>Авторизация</translation>
</message> </message>
@@ -110,32 +201,68 @@
<translation>Остановить</translation> <translation>Остановить</translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.cpp" line="201"/> <location filename="../serverlmswidget.cpp" line="151"/>
<location filename="../serverlmswidget.cpp" line="250"/> <source>Server is started!</source>
<translation>Сервер запущен!</translation>
</message>
<message>
<location filename="../serverlmswidget.cpp" line="164"/>
<source>Server is stoped!</source>
<translation>Сервер остановлен!</translation>
</message>
<message>
<location filename="../serverlmswidget.cpp" line="194"/>
<location filename="../serverlmswidget.cpp" line="243"/>
<source>Warning!</source> <source>Warning!</source>
<translation>Внимание!</translation> <translation>Внимание!</translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.cpp" line="201"/> <location filename="../serverlmswidget.cpp" line="194"/>
<source>Database settings have been changed. <source>Database settings have been changed.
The server will be restarted.</source> The server will be restarted.</source>
<translation>Настройки Базы Данных были изменены. <translation>Настройки Базы Данных были изменены.
Сервер будет перезапущен.</translation> Сервер будет перезапущен.</translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.cpp" line="250"/> <location filename="../serverlmswidget.cpp" line="243"/>
<source>The file could not be opened </source> <source>The file could not be opened </source>
<translation>Файл не может быть открыт </translation> <translation>Файл не может быть открыт </translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.cpp" line="320"/> <location filename="../serverlmswidget.cpp" line="312"/>
<location filename="../serverlmswidget.cpp" line="316"/>
<source>Database connection error!</source>
<translation>Ошибка подключения Базы данных!</translation>
</message>
<message>
<location filename="../serverlmswidget.cpp" line="316"/>
<source>Error!</source> <source>Error!</source>
<translation>Ошибка!</translation> <translation>Ошибка!</translation>
</message> </message>
<message> <message>
<location filename="../serverlmswidget.cpp" line="320"/> <location filename="../serverlmswidget.cpp" line="329"/>
<source>Database connection error</source> <source>Database connection OK!</source>
<translation>Ошибка подключения к Базе Данных</translation> <translation>База данных подключена!</translation>
</message>
<message>
<location filename="../serverlmswidget.cpp" line="343"/>
<source>started</source>
<translation>запущен</translation>
</message>
<message>
<location filename="../serverlmswidget.cpp" line="348"/>
<source>stoped</source>
<translation>остановлен</translation>
</message>
<message>
<location filename="../serverlmswidget.cpp" line="368"/>
<source>connected</source>
<translation>подключена</translation>
</message>
<message>
<location filename="../serverlmswidget.cpp" line="377"/>
<source>not connected</source>
<translation>не подключена</translation>
</message> </message>
</context> </context>
</TS> </TS>

View File

@@ -52,9 +52,6 @@ MainWindow::MainWindow(QWidget *parent) :
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(slot_Activated(QSystemTrayIcon::ActivationReason))); this, SLOT(slot_Activated(QSystemTrayIcon::ActivationReason)));
slot_Tray_ShowMessage(tr("Starting the server..."));
serverLMSWidget = new ServerLMSWidget(this); serverLMSWidget = new ServerLMSWidget(this);
ui->verticalLayout_Main->addWidget(serverLMSWidget); ui->verticalLayout_Main->addWidget(serverLMSWidget);
@@ -62,14 +59,17 @@ MainWindow::MainWindow(QWidget *parent) :
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);
serverLMSWidget->start(); connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_ShowWindow, this, &MainWindow::slot_Menu_ShowWindow);
connect(serverLMSWidget, &ServerLMSWidget::signal_Menu_HideWindow, this, &MainWindow::slot_Menu_HideWindow);
qtLanguageTranslator.load(QString("translations/TrayServerLMS_") + serverLMSWidget->getLanguage(), "."); qtLanguageTranslator.load(QString("translations/TrayServerLMS_") + serverLMSWidget->getLanguage(), ".");
qApp->installTranslator(&qtLanguageTranslator); qApp->installTranslator(&qtLanguageTranslator);
errorCheck(); slot_Tray_ShowMessage(tr("Starting the server..."));
slot_Menu_HideWindow(); serverLMSWidget->start();
errorCheck();
} }
/* Метод, который обрабатывает событие закрытия окна приложения /* Метод, который обрабатывает событие закрытия окна приложения

View File

@@ -53,7 +53,6 @@ public slots:
//Слот вывода сообщения из трея //Слот вывода сообщения из трея
void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information); void slot_Tray_ShowMessage(QString textMsg, QSystemTrayIcon::MessageIcon iconMsg = QSystemTrayIcon::Information);
signals: signals:
//сигнал об изменении языка интерфейса //сигнал об изменении языка интерфейса
void signal_LanguageChanged(QString language); void signal_LanguageChanged(QString language);

View File

@@ -9,47 +9,58 @@
<translation>Сервер Системы управления обучением (СУО)</translation> <translation>Сервер Системы управления обучением (СУО)</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.ui" line="63"/> <location filename="../mainwindow.cpp" line="25"/>
<source>Language</source> <location filename="../mainwindow.cpp" line="146"/>
<translation>Язык</translation> <location filename="../mainwindow.cpp" line="204"/>
</message>
<message>
<location filename="../mainwindow.cpp" line="39"/>
<location filename="../mainwindow.cpp" line="184"/>
<source>Server LMS</source> <source>Server LMS</source>
<translation>Сервер СУО</translation> <translation>Сервер СУО</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="43"/> <location filename="../mainwindow.cpp" line="29"/>
<location filename="../mainwindow.cpp" line="147"/>
<source>Expand window</source> <source>Expand window</source>
<translation>Развернуть окно</translation> <translation>Развернуть окно</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="44"/> <location filename="../mainwindow.cpp" line="30"/>
<location filename="../mainwindow.cpp" line="148"/>
<source>Minimize window</source> <source>Minimize window</source>
<translation>Свернуть окно</translation> <translation>Свернуть окно</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="45"/> <location filename="../mainwindow.cpp" line="31"/>
<location filename="../mainwindow.cpp" line="149"/>
<source>Exit</source> <source>Exit</source>
<translation>Выход</translation> <translation>Выход</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="155"/> <location filename="../mainwindow.cpp" line="55"/>
<source>Starting the server...</source>
<translation>Запуск сервера...</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="161"/>
<source>Error!</source>
<translation>Ошибка!</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="163"/>
<source>No Client files found!</source> <source>No Client files found!</source>
<translation>Файлы Клиента не найдены!</translation> <translation>Файлы Клиента не найдены!</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="156"/> <location filename="../mainwindow.cpp" line="164"/>
<source>* check Application for the presence of a folder with a build <source>* check Application for the presence of a folder with a build
* check SharedData for a folder with the base version and the name base</source> * check SharedData for a folder with the base version and the name base</source>
<translation>* проверьте Application на наличие папки со сборкой <translation>* проверьте Application на наличие папки со сборкой
* проверьте SharedData на наличие папки с базовой версией и именем base</translation> * проверьте SharedData на наличие папки с базовой версией и именем base</translation>
</message> </message>
<message> <message>
<location filename="../mainwindow.cpp" line="185"/> <location filename="../mainwindow.cpp" line="191"/>
<source>The application is minimized to the tray. To maximize the application window, click the application icon in the tray.</source> <source>The application is minimized to the tray.
<translation>Приложение свернуто в трей. Чтобы развернуть окно приложения, щелкните по иконке приложения в трее.</translation> To maximize the application window, click the application icon in the tray.</source>
<translation>Приложение свёрнуто в область уведомлений.
Чтобы развернуть окно приложения, нажмите на значок приложения в области уведомлений.</translation>
</message> </message>
</context> </context>
</TS> </TS>