diff --git a/GUIdataBaseLMS/CMakeLists.txt b/GUIdataBaseLMS/CMakeLists.txt index b37ea64..2164fab 100644 --- a/GUIdataBaseLMS/CMakeLists.txt +++ b/GUIdataBaseLMS/CMakeLists.txt @@ -2,6 +2,12 @@ project(GUIdataBaseLMS LANGUAGES CXX) common_info_for_project(GUIdataBaseLMS) +# Подключаем RC-файл (только для Windows) +if(WIN32) + # Предполагая, что файл app.rc расположен в корневом каталоге проекта + set(RC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/app.rc) +endif() + add_executable(GUIdataBaseLMS WIN32 main.cpp mainwindow.cpp @@ -10,6 +16,11 @@ mainwindow.ui GUIdataBaseLMS.qrc ) +# Подключаем RC-файл к цели +if(RC_FILE) + target_sources(${PROJECT_NAME} PRIVATE ${RC_FILE}) +endif() + target_link_libraries(GUIdataBaseLMS PRIVATE Qt5::Widgets) target_link_libraries(GUIdataBaseLMS PRIVATE Qt5::Sql) target_link_libraries(GUIdataBaseLMS PRIVATE Qt5::Xml) diff --git a/GUIdataBaseLMS/GUIdataBaseLMS.qrc b/GUIdataBaseLMS/GUIdataBaseLMS.qrc index 9b4a837..491b03b 100644 --- a/GUIdataBaseLMS/GUIdataBaseLMS.qrc +++ b/GUIdataBaseLMS/GUIdataBaseLMS.qrc @@ -1,5 +1,6 @@ - resources/lms.png + resources/IcoGUIRRJ.ico + resources/PngGUIRRJ.png diff --git a/GUIdataBaseLMS/app.rc b/GUIdataBaseLMS/app.rc new file mode 100644 index 0000000..37f5cba --- /dev/null +++ b/GUIdataBaseLMS/app.rc @@ -0,0 +1 @@ +IDI_APP_ICON ICON "resources\IcoGUIRRJ.ico" diff --git a/GUIdataBaseLMS/mainwindow.ui b/GUIdataBaseLMS/mainwindow.ui index 31303b8..4ea6216 100644 --- a/GUIdataBaseLMS/mainwindow.ui +++ b/GUIdataBaseLMS/mainwindow.ui @@ -20,7 +20,7 @@ - :/resources/lms.png:/resources/lms.png + :/resources/PngGUIRRJ.png:/resources/PngGUIRRJ.png Qt::ToolButtonIconOnly diff --git a/GUIdataBaseLMS/resources/IcoGUIRRJ.ico b/GUIdataBaseLMS/resources/IcoGUIRRJ.ico new file mode 100644 index 0000000..662894c Binary files /dev/null and b/GUIdataBaseLMS/resources/IcoGUIRRJ.ico differ diff --git a/GUIdataBaseLMS/resources/lms.png b/GUIdataBaseLMS/resources/PngGUIRRJ.png similarity index 100% rename from GUIdataBaseLMS/resources/lms.png rename to GUIdataBaseLMS/resources/PngGUIRRJ.png diff --git a/InstructorsAndTrainees/instructors/dialogeditinstructor.cpp b/InstructorsAndTrainees/instructors/dialogeditinstructor.cpp index 1eb1547..61ffbad 100644 --- a/InstructorsAndTrainees/instructors/dialogeditinstructor.cpp +++ b/InstructorsAndTrainees/instructors/dialogeditinstructor.cpp @@ -54,9 +54,15 @@ void DialogEditInstructor::setInstructor(Instructor instructor) ui->checkLoggedIn->setChecked(instructor.getLoggedIn()); if(instructor.getIsAdmin()) + { ui->editName->setEnabled(false); + ui->editLogin->setEnabled(false); + } else + { ui->editName->setEnabled(true); + ui->editLogin->setEnabled(true); + } if(instructor.getNeedSetPassword()) { diff --git a/InstructorsAndTrainees/instructors/editorinstructors.cpp b/InstructorsAndTrainees/instructors/editorinstructors.cpp index 223358a..5e7bc76 100644 --- a/InstructorsAndTrainees/instructors/editorinstructors.cpp +++ b/InstructorsAndTrainees/instructors/editorinstructors.cpp @@ -162,7 +162,7 @@ void EditorInstructors::on_btnEdit_clicked() int id = treeItemCurrent->text(ColumnsTreeUsers::clmn_ID).toInt(); - if(connectorToServer->isLoggedInInstructor(id)) + if(connectorToServer->isLoggedInInstructor(id) && !adminMode) {//Инструктор залогирован! SpecMsgBox::CriticalClose(this, tr("You cannot edit a logged-in instructor.")); return; @@ -233,9 +233,24 @@ void EditorInstructors::on_treeWidgetCurrentItemChanged(QTreeWidgetItem *current ui->btnToOrFromArchive->setIcon(QIcon(QStringLiteral(":/resources/icons/instructorArchive.png"))); } - ui->btnNewInstructor->setEnabled(true); + ui->btnNewInstructor->setEnabled(true); - if(connectorToServer->isAdminInstructor(id) || connectorToServer->isLoggedInInstructor(id)) + if(connectorToServer->isAdminInstructor(id)) + {//Это Админ! Удалять/Архивировать/Редактировать нельзя! (Только сменить пароль, если это он сам) + if(adminMode) + { + ui->btnDeleteInstructor->setEnabled(false); + ui->btnToOrFromArchive->setEnabled(false); + ui->btnEdit->setEnabled(true); + } + else + { + ui->btnDeleteInstructor->setEnabled(false); + ui->btnToOrFromArchive->setEnabled(false); + ui->btnEdit->setEnabled(false); + } + } + else if(connectorToServer->isLoggedInInstructor(id)) {//Это Админ или залогированный! Удалять/Архивировать/Редактировать нельзя! ui->btnDeleteInstructor->setEnabled(false); ui->btnToOrFromArchive->setEnabled(false); diff --git a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm index 08040d3..1d4405d 100644 Binary files a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm and b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm differ diff --git a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts index 5e0aa97..4380d59 100644 --- a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts +++ b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts @@ -34,56 +34,56 @@ Удалить - + actual актуально - + update required требуется обновление - + DM code DM код - + ID ID - + Procedure AMM Процедура AMM - + Canplay Режимы - + Status Статус - + The deletion will be irrevocable. Delete it anyway? Удаление будет безвозвратным. Всё равно удалить? - - + + Assign this task? Назначить эту задачу? @@ -141,33 +141,33 @@ Delete it anyway? Новая - + viewed Просмотрено - - + + completed выполнена - + failed неверно - + checkup на проверке - + new новая - + Change task status? The status will be set: 'failed' @@ -176,7 +176,7 @@ The status will be set: 'неверно' - + Change task status? The status will be set: 'new' @@ -185,8 +185,8 @@ The status will be set: 'новая' - - + + Change task status? The status will be set: 'completed' @@ -364,7 +364,7 @@ The status will be set: Сохранить - + Only Latin letters and numbers Только латинские буквы и цифры @@ -617,40 +617,40 @@ The status will be set: Управление версиями - + Yes Да - + No Нет - + Version name: Имя версии: - + Created: Создан: - + Changeable: Изменен: - + Author: Автор: - - - - + + + + Version not selected Версия не выбрана @@ -674,7 +674,7 @@ The status will be set: - + To archive Архивировать @@ -689,60 +689,60 @@ The status will be set: Показать архив - + You cannot delete the Administrator. Нельзя удалить администратора. - + You cannot delete a logged-in instructor. Вы не можете удалить инструктора, вошедшего в систему. - + The deletion will be irrevocable. Delete it anyway? Удаление будет безвозвратным. Всё равно удалить? - + You cannot archive a logged-in instructor. Вы не можете заархивировать инструктора, вошедшего в систему. - + You cannot edit a logged-in instructor. Вы не можете редактировать инструктора, вошедшего в систему. - + From archive Разархивировать - + Unacceptable instructor name has been entered. The changes will not be accepted. Введено неприемлемое имя инструктора. Изменения приняты не будут. - + Unacceptable instructor login has been entered. The changes will not be accepted. Введен неприемлемый логин инструктора. Изменения приняты не будут. - + Unacceptable instructor password has been entered. The changes will not be accepted. Введен неприемлемый пароль инструктора. Изменения приняты не будут. - + An existing instructor or trainee login has been entered. The changes will not be accepted. Введен существующий логин инструктора или обучаемого. @@ -778,8 +778,8 @@ The changes will not be accepted. - - + + To archive Архивировать @@ -794,76 +794,76 @@ The changes will not be accepted. Показать архив - + The group is not empty. It is not possible to delete a non-empty group. Группа не пуста. Невозможно удалить непустую группу. - - + + The deletion will be irrevocable. Delete it anyway? Удаление будет безвозвратным. Всё равно удалить? - + You cannot delete a logged-in trainee. Вы не можете удалить обучаемого, вошедшего в систему. - + You cannot archive a logged-in trainee. Вы не можете заархивировать обучаемого, вошедшего в систему. - + You cannot edit a logged-in trainee. Вы не можете редактировать обучаемого, вошедшего в систему. - + From archive Разархивировать - + Unacceptable group name has been entered. The changes will not be accepted. Введено неприемлемое название группы. Изменения приняты не будут. - + An existing group name has been entered. The changes will not be accepted. Введено существующее название группы. Изменения приняты не будут. - + Unacceptable trainee name has been entered. The changes will not be accepted. Введено неприемлемое имя обучаемого. Изменения приняты не будут. - + Unacceptable trainee login has been entered. The changes will not be accepted. Введен неприемлемый логин обучаемого. Изменения приняты не будут. - + Unacceptable trainee password has been entered. The changes will not be accepted. Был введен неприемлемый пароль обучаемого. Изменения приняты не будут. - + An existing instructor or trainee login has been entered. The changes will not be accepted. Введен существующий логин инструктора или обучаемого. @@ -893,32 +893,32 @@ The changes will not be accepted. Удалить - - + + ID ID - - + + Status Статус - - + + Procedure FIM Процедура FIM - + The deletion will be irrevocable. Delete it anyway? Удаление будет безвозвратным. Всё равно удалить? - + Assign this task? Назначить эту задачу? @@ -1003,7 +1003,7 @@ Delete it anyway? - + none нет @@ -1013,73 +1013,75 @@ Delete it anyway? Файл не может быть открыт - - + + Instructor authorization. Авторизация инструктора. - + Instructor deauthorization Деавторизация инструктора - + Error! Ошибка! - + Server blocked! Сервер заблокирован! - + Database error! Ошибка базы данных! - + The user is archived! Пользователь является архивным! - + The user is already logged in! Пользователь уже в сети! - + Login or password error! Ошибка логина или пароля! - + The server is not available! Сервер недоступен! - + Connection attempt Попытка соединения - + connected подключен - + not connected не подключен - - Server settings have been changed. Please reconnect to the server. - Настройки сервера изменены. Выполните переподключение к серверу. + + Server settings have been changed. +Please reconnect to the server. + Настройки сервера были изменены. +Пожалуйста, переподключитесь к серверу. - + Instructor authorization Авторизация инструктора @@ -1297,6 +1299,36 @@ Delete it anyway? Это имя уже существует + + SpecMsgBox + + + + Attention! + Внимание! + + + + + Close + Закрыть + + + + Error! + Ошибка! + + + + Information + Информация + + + + Ok + Хорошо + + SpecialMessageBox @@ -1319,33 +1351,6 @@ Delete it anyway? No Нет - - - - Attention! - Внимание! - - - - - Close - Закрыть - - - - Error! - Ошибка! - - - - Information - Информация - - - - Ok - Хорошо - SubProcItemWidget diff --git a/ServerLMS/translations/ServerLMS_ru_RU.qm b/ServerLMS/translations/ServerLMS_ru_RU.qm index 0da8f08..7263c52 100644 Binary files a/ServerLMS/translations/ServerLMS_ru_RU.qm and b/ServerLMS/translations/ServerLMS_ru_RU.qm differ diff --git a/ServerLMS/translations/ServerLMS_ru_RU.ts b/ServerLMS/translations/ServerLMS_ru_RU.ts index 191ce40..0c1d494 100644 --- a/ServerLMS/translations/ServerLMS_ru_RU.ts +++ b/ServerLMS/translations/ServerLMS_ru_RU.ts @@ -118,101 +118,101 @@ - Host name - Хост + Local + Локальная - - Localhost - + + IP address + IP адрес - + Port Порт - + Database name Имя базы данных - + User name Имя пользователя - + User password Пароль пользователя - - Check - Проверить - - - + Save Сохранить - + Additional Расширенные - + + Check DB + Проверить БД + + + Update Docs Обновить Docs - - + + Error! Ошибка! - + Driver PostgreSQL is not installed! Драйвер PostgreSQL не установлен! - + Superuser PostgreSQL authorization Авторизация суперпользователя PostgreSQL - + Error connecting to PostgreSQL! Ошибка соединения с PostgreSQL! - + Possible reasons: Возможные причины: - + *superuser PostgreSQL login or password is incorrect; *логин или пароль суперпользователя PostgreSQL некорректен; - + *Port is incorrect. *Порт некорректен. - + *Port is incorrect; *Порт некорректен; - + *file 'pg_hba.conf' does not contain an entry for the IP address: *файл 'pg_hba.conf не содержит записи доступа для IP адреса: @@ -220,136 +220,148 @@ ServerLMSWidget - + Form Форма - + Logger Логгер - + Clients Клиенты - + Settings Настройки - + Server: Сервер: - + Data base: База данных: - - - + + + ... - + Version of materials: Версия материалов: - + Authorization Авторизация - + Start Запустить - + Stop Остановить - + Server is started! Сервер запущен! - + Server is stoped! Сервер остановлен! - - + + Warning! Внимание! - + Database settings have been changed. The server will be restarted. Настройки Базы Данных были изменены. Сервер будет перезапущен. - + The file could not be opened Файл не может быть открыт - - + + Database connection error! Ошибка подключения Базы данных! - - + + Error! Ошибка! - + Error PostgreSQL! Ошибка PostgreSQL! - + Settings file could not be opened: Файл настроек не открыт: - + Database connection OK! База данных подключена! - + started запущен - + stoped остановлен - + connected подключена - + not connected не подключена + + + No Client files found! + Файлы клиента не найдены! + + + + * check Application for the presence of a folder with a build +* check SharedData for a folder with the base version and the name base + * проверьте Application на наличие папки со сборкой +* проверьте SharedData на наличие папки с базовой версией и именем base + diff --git a/TrayServerLMS/CMakeLists.txt b/TrayServerLMS/CMakeLists.txt index 6b5a501..53d3865 100644 --- a/TrayServerLMS/CMakeLists.txt +++ b/TrayServerLMS/CMakeLists.txt @@ -2,6 +2,12 @@ project(TrayServerLMS LANGUAGES CXX) common_info_for_project(TrayServerLMS) +# Подключаем RC-файл (только для Windows) +if(WIN32) + # Предполагая, что файл app.rc расположен в корневом каталоге проекта + set(RC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/app.rc) +endif() + add_executable(TrayServerLMS WIN32 main.cpp mainwindow.cpp @@ -10,6 +16,11 @@ mainwindow.ui TrayServerLMS.qrc ) +# Подключаем RC-файл к цели +if(RC_FILE) + target_sources(${PROJECT_NAME} PRIVATE ${RC_FILE}) +endif() + target_link_libraries(TrayServerLMS PRIVATE Qt5::Widgets) target_link_libraries(TrayServerLMS PRIVATE Qt5::Network) target_link_libraries(TrayServerLMS PRIVATE Qt5::Sql) diff --git a/TrayServerLMS/TrayServerLMS.qrc b/TrayServerLMS/TrayServerLMS.qrc index 5a7d4c1..a5f38ce 100644 --- a/TrayServerLMS/TrayServerLMS.qrc +++ b/TrayServerLMS/TrayServerLMS.qrc @@ -1,6 +1,6 @@ + resources/PngServerRRJ.png resources/IcoServerRRJ.ico - resources/database-management.png diff --git a/TrayServerLMS/app.rc b/TrayServerLMS/app.rc new file mode 100644 index 0000000..927cf9a --- /dev/null +++ b/TrayServerLMS/app.rc @@ -0,0 +1 @@ +IDI_APP_ICON ICON "resources\IcoServerRRJ.ico" diff --git a/TrayServerLMS/mainwindow.ui b/TrayServerLMS/mainwindow.ui index 7fa747d..8c4a832 100644 --- a/TrayServerLMS/mainwindow.ui +++ b/TrayServerLMS/mainwindow.ui @@ -21,7 +21,7 @@ - :/resources/database-management.png:/resources/database-management.png + :/resources/PngServerRRJ.png:/resources/PngServerRRJ.png diff --git a/TrayServerLMS/resources/IcoServerRRJ.ico b/TrayServerLMS/resources/IcoServerRRJ.ico index f6934b2..bd8461b 100644 Binary files a/TrayServerLMS/resources/IcoServerRRJ.ico and b/TrayServerLMS/resources/IcoServerRRJ.ico differ diff --git a/TrayServerLMS/resources/database-management.png b/TrayServerLMS/resources/PngServerRRJ.png similarity index 100% rename from TrayServerLMS/resources/database-management.png rename to TrayServerLMS/resources/PngServerRRJ.png diff --git a/TrayServerLMS/translations/TrayServerLMS_ru_RU.ts b/TrayServerLMS/translations/TrayServerLMS_ru_RU.ts index 3419fbd..88709f4 100644 --- a/TrayServerLMS/translations/TrayServerLMS_ru_RU.ts +++ b/TrayServerLMS/translations/TrayServerLMS_ru_RU.ts @@ -9,47 +9,30 @@ Сервер Системы управления обучением (СУО) - - + + Server LMS Сервер СУО - + Expand window Развернуть окно - + Minimize window Свернуть окно - + Exit Выход - + Starting the server... Запуск сервера... - - - Error! - Ошибка! - - - - No Client files found! - Файлы Клиента не найдены! - - - - * check Application for the presence of a folder with a build -* check SharedData for a folder with the base version and the name base - * проверьте Application на наличие папки со сборкой -* проверьте SharedData на наличие папки с базовой версией и именем base -