diff --git a/InstructorsAndTrainees/CMakeLists.txt b/InstructorsAndTrainees/CMakeLists.txt index 3063048..9ce5454 100644 --- a/InstructorsAndTrainees/CMakeLists.txt +++ b/InstructorsAndTrainees/CMakeLists.txt @@ -103,6 +103,10 @@ add_library(InstructorsAndTrainees SHARED widgets/waitanimationwidget.h widgets/waitanimationwidget.ui + specialmessagebox.cpp + specialmessagebox.h + specialmessagebox.ui + resources.qrc ) diff --git a/InstructorsAndTrainees/connectorToServer/Core/notifycontroller.cpp b/InstructorsAndTrainees/connectorToServer/Core/notifycontroller.cpp index 86d4ca6..d6a69a7 100644 --- a/InstructorsAndTrainees/connectorToServer/Core/notifycontroller.cpp +++ b/InstructorsAndTrainees/connectorToServer/Core/notifycontroller.cpp @@ -1,4 +1,5 @@ #include "notifycontroller.h" +#include "specialmessagebox.h" NotifyController::NotifyController(QObject *parent) : QObject(parent) { @@ -7,10 +8,5 @@ NotifyController::NotifyController(QObject *parent) : QObject(parent) void NotifyController::showWarning(QString text) { - QMessageBox warning; - warning.setText(text); - - warning.setIcon(QMessageBox::Warning); - warning.setWindowTitle(tr("Error")); - warning.exec(); + SpecialMessageBox(nullptr, SpecialMessageBox::TypeSpecMsgBox::warningWithoutButtons, text).exec(); } diff --git a/InstructorsAndTrainees/connectorToServer/Core/recognizesystem.cpp b/InstructorsAndTrainees/connectorToServer/Core/recognizesystem.cpp index 016386c..dc4e86f 100644 --- a/InstructorsAndTrainees/connectorToServer/Core/recognizesystem.cpp +++ b/InstructorsAndTrainees/connectorToServer/Core/recognizesystem.cpp @@ -6,6 +6,7 @@ #include "instructor.h" #include "tasksAmmFim.h" #include "timingoftrainee.h" +#include "specialmessagebox.h" RecognizeSystem::RecognizeSystem(QObject *parent): @@ -392,7 +393,7 @@ void RecognizeSystem::recognize(QTcpSocket *socket) QFile xmlInFile(xmlFileName); if (!xmlInFile.open(QFile::ReadOnly | QFile::Text)) { - QMessageBox::critical(nullptr, tr("Attention!"), tr("The file could not be opened ") + xmlFileName); + SpecialMessageBox(nullptr, SpecialMessageBox::TypeSpecMsgBox::critical, tr("The file could not be opened ") + xmlFileName).exec(); return; } else diff --git a/InstructorsAndTrainees/instructors/editorinstructors.cpp b/InstructorsAndTrainees/instructors/editorinstructors.cpp index 3c2640f..0b7dc4c 100644 --- a/InstructorsAndTrainees/instructors/editorinstructors.cpp +++ b/InstructorsAndTrainees/instructors/editorinstructors.cpp @@ -1,6 +1,7 @@ #include #include "editorinstructors.h" #include "dialogeditinstructor.h" +#include "specialmessagebox.h" #include "ui_editorinstructors.h" EditorInstructors::EditorInstructors(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent) : @@ -108,17 +109,17 @@ void EditorInstructors::on_btnDeleteInstructor_clicked() if(connectorToServer->isAdminInstructor(id)) {//Это Админ! - QMessageBox::critical(this, tr("Error!"), tr("You cannot delete the Administrator.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("You cannot delete the Administrator.")).exec(); return; } if(connectorToServer->isLoggedInInstructor(id)) {//Инструктор залогирован! - QMessageBox::critical(this, tr("Error!"), tr("You cannot delete a logged-in instructor.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("You cannot delete a logged-in instructor.")).exec(); return; } - if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) + if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) { waitAnimationWidget->showWithPlay(); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_INSTRUCTOR, id); @@ -153,7 +154,7 @@ void EditorInstructors::on_btnToOrFromArchive_clicked() {//Не Архивный if(connectorToServer->isLoggedInInstructor(id)) {//Инструктор залогирован! - QMessageBox::critical(this, tr("Error!"), tr("You cannot archive a logged-in instructor.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("You cannot archive a logged-in instructor.")).exec(); return; } @@ -190,7 +191,7 @@ void EditorInstructors::on_btnEdit_clicked() if(connectorToServer->isLoggedInInstructor(id)) {//Инструктор залогирован! - QMessageBox::critical(this, tr("Error!"), tr("You cannot edit a logged-in instructor.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("You cannot edit a logged-in instructor.")).exec(); return; } @@ -276,22 +277,19 @@ bool EditorInstructors::verifyInstructor(Instructor instructor) if(instructor.getName() == QStringLiteral("")) {//Имя не корректно! - QMessageBox::critical(this, tr("Editing error!"), - tr("Unacceptable instructor name has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Unacceptable instructor name has been entered.\nThe changes will not be accepted.")).exec(); return false; } if(instructor.getLogin() == QStringLiteral("")) {//Логин не корректен! - QMessageBox::critical(this, tr("Editing error!"), - tr("Unacceptable instructor login has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Unacceptable instructor login has been entered.\nThe changes will not be accepted.")).exec(); return false; } if(instructor.getPassword() == QStringLiteral("")) {//Пароль не корректный! - QMessageBox::critical(this, tr("Editing error!"), - tr("Unacceptable instructor password has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Unacceptable instructor password has been entered.\nThe changes will not be accepted.")).exec(); return false; } @@ -300,8 +298,7 @@ bool EditorInstructors::verifyInstructor(Instructor instructor) int user_T = connectorToServer->getIdTraineeByLogin(instructor.getLogin()); if((user_I && (user_I != instructor.getID())) || (user_T && (user_T != instructor.getID()))) {//Логин уже существует! - QMessageBox::critical(this, tr("Editing error!"), - tr("An existing instructor or trainee login has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("An existing instructor or trainee login has been entered.\nThe changes will not be accepted.")).exec(); return 0; } diff --git a/InstructorsAndTrainees/instructorsandtraineeswidget.cpp b/InstructorsAndTrainees/instructorsandtraineeswidget.cpp index 96efabe..cabfc07 100644 --- a/InstructorsAndTrainees/instructorsandtraineeswidget.cpp +++ b/InstructorsAndTrainees/instructorsandtraineeswidget.cpp @@ -4,6 +4,7 @@ #include "ui_instructorsandtraineeswidget.h" #include "dialogauthorizationinstructor.h" #include "dialogsettings.h" +#include "specialmessagebox.h" const QString InstructorsAndTraineesWidget::languageENG = "en_EN"; @@ -124,7 +125,7 @@ QString InstructorsAndTraineesWidget::loadStyleSheet() QFile styleSheetFile(fileName); if (!styleSheetFile.open(QFile::ReadOnly | QFile::Text)) { - QMessageBox::critical(this, tr("Attention!"), tr("The file could not be opened ") + fileName); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("The file could not be opened ") + fileName).exec(); return QStringLiteral(""); } else @@ -181,12 +182,11 @@ void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *se connectorToServer->sendQueryTasksXML("fim"); connectorToServer->sendQueryTasksXML("amm"); - //QMessageBox::information(this, tr("Instructor authorization"), tr("Successfully!")); } else { ui->btnAuthorizationInstructor->setChecked(false); - QMessageBox::warning(this, tr("Instructor authorization"), tr("Invalid login or password!")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor authorization") + "\n" + tr("Invalid login or password!")).exec(); } } @@ -207,12 +207,11 @@ void InstructorsAndTraineesWidget::slot_checkDeLoginResult(ServerDeAuthorization ui->btnEditorInstructors->setEnabled(false); updateLabelLoggedInInstructor("",""); - //QMessageBox::information(this, tr("Instructor deauthorization"), tr("Successfully!")); } else { ui->btnAuthorizationInstructor->setChecked(true); - QMessageBox::warning(this, tr("Instructor deauthorization"), tr("Error!")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor deauthorization") + "\n" + tr("Error!")).exec(); } } @@ -252,7 +251,7 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state) updateLabelLoggedInInstructor(loginInstructorLoggedInLocal, nameInstructorLoggedInLocal); updateLabelServer(); - QMessageBox::warning(this, tr("Warning!"), tr("The server is not available")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("The server is not available!")).exec(); } } @@ -440,7 +439,7 @@ void InstructorsAndTraineesWidget::on_btnSettings_clicked() if(dlg.settingsServerIsChanged()) { - QMessageBox::warning(this, tr("Attention!"), tr("Server settings have been changed. Please reconnect to the server.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningWithoutButtons, tr("Server settings have been changed. Please reconnect to the server.")).exec(); if(authorizationIsCompleted()) deAuthorizationInstructor(loginInstructorLoggedInLocal); diff --git a/InstructorsAndTrainees/resources.qrc b/InstructorsAndTrainees/resources.qrc index d7c0f33..f2c273a 100644 --- a/InstructorsAndTrainees/resources.qrc +++ b/InstructorsAndTrainees/resources.qrc @@ -49,5 +49,8 @@ resources/icons/updateVersion.png resources/icons/editorDB.png resources/icons/lms.png + resources/icons/critical.png + resources/icons/warning.png + resources/icons/info.png diff --git a/InstructorsAndTrainees/resources/css/styleSheetMain.css b/InstructorsAndTrainees/resources/css/styleSheetMain.css index 8013ae5..d650e3e 100644 --- a/InstructorsAndTrainees/resources/css/styleSheetMain.css +++ b/InstructorsAndTrainees/resources/css/styleSheetMain.css @@ -71,9 +71,10 @@ QPushButton, QToolButton { qproperty-iconSize: 32px; } + QPushButton { height: 25px; - width: 75px; + width: 100px; } QToolButton { width: 180px; diff --git a/InstructorsAndTrainees/resources/icons/critical.png b/InstructorsAndTrainees/resources/icons/critical.png new file mode 100644 index 0000000..9f4f1cb Binary files /dev/null and b/InstructorsAndTrainees/resources/icons/critical.png differ diff --git a/InstructorsAndTrainees/resources/icons/info.png b/InstructorsAndTrainees/resources/icons/info.png new file mode 100644 index 0000000..0b84223 Binary files /dev/null and b/InstructorsAndTrainees/resources/icons/info.png differ diff --git a/InstructorsAndTrainees/resources/icons/warning.png b/InstructorsAndTrainees/resources/icons/warning.png new file mode 100644 index 0000000..6f8e275 Binary files /dev/null and b/InstructorsAndTrainees/resources/icons/warning.png differ diff --git a/InstructorsAndTrainees/specialmessagebox.cpp b/InstructorsAndTrainees/specialmessagebox.cpp new file mode 100644 index 0000000..e716f1e --- /dev/null +++ b/InstructorsAndTrainees/specialmessagebox.cpp @@ -0,0 +1,56 @@ +#include +#include "specialmessagebox.h" +#include "ui_specialmessagebox.h" + +SpecialMessageBox::SpecialMessageBox(QWidget *parent, TypeSpecMsgBox type, const QString& text) : + QDialog(parent), + ui(new Ui::SpecialMessageBox) +{ + ui->setupUi(this); + + this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); + + if(type == TypeSpecMsgBox::warning) + { + ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png"))); + this->setWindowTitle(tr("Attention!")); + } + else if(type == TypeSpecMsgBox::warningWithoutButtons) + { + ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png"))); + this->setWindowTitle(tr("Attention!")); + ui->btnYes->setVisible(false); + ui->btnNo->setVisible(false); + } + else if(type == TypeSpecMsgBox::critical) + { + ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/critical.png"))); + this->setWindowTitle(tr("Error!")); + ui->btnYes->setVisible(false); + ui->btnNo->setVisible(false); + } + else if(type == TypeSpecMsgBox::info) + { + ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/info.png"))); + this->setWindowTitle(tr("Information")); + ui->btnYes->setVisible(false); + ui->btnNo->setVisible(false); + } + + ui->lblText->setText(text); +} + +SpecialMessageBox::~SpecialMessageBox() +{ + delete ui; +} + +void SpecialMessageBox::on_btnYes_clicked() +{ + this->accept(); +} + +void SpecialMessageBox::on_btnNo_clicked() +{ + this->reject(); +} diff --git a/InstructorsAndTrainees/specialmessagebox.h b/InstructorsAndTrainees/specialmessagebox.h new file mode 100644 index 0000000..d73380d --- /dev/null +++ b/InstructorsAndTrainees/specialmessagebox.h @@ -0,0 +1,35 @@ +#ifndef SPECIALMESSAGEBOX_H +#define SPECIALMESSAGEBOX_H + +#include + +namespace Ui { +class SpecialMessageBox; +} + +class SpecialMessageBox : public QDialog +{ + Q_OBJECT + +public: + enum TypeSpecMsgBox { + warning, + warningWithoutButtons, + critical, + info + }; + +public: + explicit SpecialMessageBox(QWidget *parent, TypeSpecMsgBox type, const QString& text); + ~SpecialMessageBox(); + +private slots: + void on_btnYes_clicked(); + + void on_btnNo_clicked(); + +private: + Ui::SpecialMessageBox *ui; +}; + +#endif // SPECIALMESSAGEBOX_H diff --git a/InstructorsAndTrainees/specialmessagebox.ui b/InstructorsAndTrainees/specialmessagebox.ui new file mode 100644 index 0000000..92de763 --- /dev/null +++ b/InstructorsAndTrainees/specialmessagebox.ui @@ -0,0 +1,116 @@ + + + SpecialMessageBox + + + + 0 + 0 + 400 + 100 + + + + Dialog + + + + + + + + + + + 32 + 32 + + + + + 32 + 32 + + + + + + + :/resources/icons/circleGray.png + + + + + + + text + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 0 + + + + Yes + + + + + + + + 0 + 0 + + + + No + + + + + + + + + + + + + + diff --git a/InstructorsAndTrainees/tasks/ammtaskswidget.cpp b/InstructorsAndTrainees/tasks/ammtaskswidget.cpp index cb5ca0e..1705369 100644 --- a/InstructorsAndTrainees/tasks/ammtaskswidget.cpp +++ b/InstructorsAndTrainees/tasks/ammtaskswidget.cpp @@ -7,6 +7,7 @@ #include "ammtaskswidget.h" #include "ui_ammtaskswidget.h" #include "dialogchecktask.h" +#include "specialmessagebox.h" AMMtasksWidget::AMMtasksWidget(ConnectorToServer* connectorToServer, TypeListTreeAMMFIM type, QWidget *parent) : QWidget(parent), @@ -291,7 +292,7 @@ void AMMtasksWidget::on_btnDelete_clicked() int id = treeItemCurrent->text(ColumnsTreeAMM::clmnAMM_ID).toInt(); - if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) + if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) { waitAnimationWidget->showWithPlay(); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TASK_AMM_TO_TRAINEE, id); @@ -334,7 +335,7 @@ void AMMtasksWidget::on_btnCheck_clicked() void AMMtasksWidget::on_btnAssignTask_clicked() { - if(QMessageBox::question(this, tr("New task"), tr("Assign this task?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) + if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("Assign this task?")).exec() == QDialog::Accepted) assignTaskAMMtoTrainee(); } diff --git a/InstructorsAndTrainees/tasks/dialogchecktask.cpp b/InstructorsAndTrainees/tasks/dialogchecktask.cpp index ee9f38a..e0a1ccd 100644 --- a/InstructorsAndTrainees/tasks/dialogchecktask.cpp +++ b/InstructorsAndTrainees/tasks/dialogchecktask.cpp @@ -1,4 +1,5 @@ #include "dialogchecktask.h" +#include "specialmessagebox.h" #include "ui_dialogchecktask.h" DialogCheckTask::DialogCheckTask(ConnectorToServer* connectorToServer, QString type, QWidget *parent) : @@ -138,7 +139,7 @@ void DialogCheckTask::on_btnWrong_clicked() msgString = tr("Change task status?\nThe status will be set:\n'new'"); } - if(QMessageBox::warning(this, tr("Attention!"), msgString, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) + if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, msgString).exec() == QDialog::Accepted) { connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status); this->parentWidget()->close(); @@ -165,7 +166,7 @@ void DialogCheckTask::on_btnRight_clicked() msgString = tr("Change task status?\nThe status will be set:\n'completed'"); } - if(QMessageBox::warning(this, tr("Attention!"), msgString, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) + if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, msgString).exec() == QDialog::Accepted) { connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status); this->parentWidget()->close(); diff --git a/InstructorsAndTrainees/tasks/fimtaskswidget.cpp b/InstructorsAndTrainees/tasks/fimtaskswidget.cpp index 2557cb3..53c32b5 100644 --- a/InstructorsAndTrainees/tasks/fimtaskswidget.cpp +++ b/InstructorsAndTrainees/tasks/fimtaskswidget.cpp @@ -8,6 +8,7 @@ #include "ui_fimtaskswidget.h" #include "tasksAmmFim.h" #include "dialogchecktask.h" +#include "specialmessagebox.h" FIMtasksWidget::FIMtasksWidget(ConnectorToServer* connectorToServer, TypeListTreeAMMFIM type, QWidget *parent) : QWidget(parent), @@ -338,7 +339,7 @@ void FIMtasksWidget::on_btnDelete_clicked() int id = treeItemCurrent->text(ColumnsTreeFIM::clmnFIM_ID).toInt(); - if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) + if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) { waitAnimationWidget->showWithPlay(); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TASK_FIM_TO_TRAINEE, id); @@ -385,7 +386,7 @@ void FIMtasksWidget::on_btnCheck_clicked() void FIMtasksWidget::on_btnAssignTask_clicked() { - if(QMessageBox::question(this, tr("New task"), tr("Assign this task?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) + if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("Assign this task?")).exec() == QDialog::Accepted) assignTaskFIMtoTrainee(); } diff --git a/InstructorsAndTrainees/trainees/editortrainees.cpp b/InstructorsAndTrainees/trainees/editortrainees.cpp index 6156371..8432081 100644 --- a/InstructorsAndTrainees/trainees/editortrainees.cpp +++ b/InstructorsAndTrainees/trainees/editortrainees.cpp @@ -3,6 +3,7 @@ #include "ui_editortrainees.h" #include "dialogeditgroup.h" #include "dialogedittrainee.h" +#include "specialmessagebox.h" EditorTrainees::EditorTrainees(ConnectorToServer* connectorToServer, bool adminMode, QWidget *parent) : TraineesView(connectorToServer, CommonView::TypeView::control, parent), @@ -111,12 +112,12 @@ void EditorTrainees::on_btnDeleteGroup_clicked() if(connectorToServer->getListTraineesInGroup(id_group).count() > 0) { - QMessageBox::critical(this, tr("Editing error!"), tr("The group is not empty.\nIt is not possible to delete a non-empty group.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("The group is not empty.\nIt is not possible to delete a non-empty group.")).exec(); return; } else {//Пустая группа - if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) + if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) { waitAnimationWidget->showWithPlay(); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_GROUP, id_group); @@ -216,11 +217,11 @@ void EditorTrainees::on_btnDeleteTrainee_clicked() if(connectorToServer->isLoggedInTrainee(id_trainee)) {//Обучаемый залогирован! - QMessageBox::critical(this, tr("Error!"), tr("You cannot delete a logged-in trainee.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("You cannot delete a logged-in trainee.")).exec(); return; } - if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) + if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) { waitAnimationWidget->showWithPlay(); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TRAINEE, id_trainee); @@ -255,7 +256,7 @@ void EditorTrainees::on_btnToOrFromArchiveTrainee_clicked() {//Не Архивный if(connectorToServer->isLoggedInTrainee(id_trainee)) {//Обучаемый залогирован! - QMessageBox::critical(this, tr("Error!"), tr("You cannot archive a logged-in trainee.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("You cannot archive a logged-in trainee.")).exec(); return; } @@ -301,7 +302,7 @@ void EditorTrainees::on_btnEdit_clicked() if(connectorToServer->isLoggedInTrainee(id_trainee)) {//Обучаемый залогирован! - QMessageBox::critical(this, tr("Error!"), tr("You cannot edit a logged-in trainee.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("You cannot edit a logged-in trainee.")).exec(); return; } @@ -431,8 +432,7 @@ bool EditorTrainees::verifyGroup(Group group) if(group.getName() == QStringLiteral("")) {//Имя не корректно! - QMessageBox::critical(this, tr("Editing error!"), - tr("Unacceptable group name has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Unacceptable group name has been entered.\nThe changes will not be accepted.")).exec(); return false; } @@ -442,8 +442,7 @@ bool EditorTrainees::verifyGroup(Group group) { if(group.getName() == exist_group.getName() && group.getID() != exist_group.getID()) {//Имя уже существует - QMessageBox::critical(this, tr("Editing error!"), - tr("An existing group name has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("An existing group name has been entered.\nThe changes will not be accepted.")).exec(); return false; } } @@ -457,22 +456,19 @@ bool EditorTrainees::verifyTrainee(Trainee trainee) if(trainee.getName() == QStringLiteral("")) {//Имя не корректно! - QMessageBox::critical(this, tr("Editing error!"), - tr("Unacceptable trainee name has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Unacceptable trainee name has been entered.\nThe changes will not be accepted.")).exec(); return false; } if(trainee.getLogin() == QStringLiteral("")) {//Логин не корректен! - QMessageBox::critical(this, tr("Editing error!"), - tr("Unacceptable trainee login has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Unacceptable trainee login has been entered.\nThe changes will not be accepted.")).exec(); return false; } if(trainee.getPassword() == QStringLiteral("")) {//Пароль не корректный! - QMessageBox::critical(this, tr("Editing error!"), - tr("Unacceptable trainee password has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Unacceptable trainee password has been entered.\nThe changes will not be accepted.")).exec(); return false; } @@ -481,8 +477,7 @@ bool EditorTrainees::verifyTrainee(Trainee trainee) int user_T = connectorToServer->getIdTraineeByLogin(trainee.getLogin()); if((user_I && (user_I != trainee.getID())) || (user_T && (user_T != trainee.getID()))) {//Логин уже существует! - QMessageBox::critical(this, tr("Editing error!"), - tr("An existing instructor or trainee login has been entered.\nThe changes will not be accepted.")); + SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("An existing instructor or trainee login has been entered.\nThe changes will not be accepted.")).exec(); return 0; } diff --git a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.qm index c1be31f..24ea055 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 96c8f5f..4aa1c5d 100644 --- a/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts +++ b/InstructorsAndTrainees/translations/InstructorsAndTraineesWidget_ru_RU.ts @@ -24,54 +24,44 @@ Удалить - - + + Task AMM Задача AMM - - + + DM code DM код - - + + ID ID - - + + Status Статус - - Attention! - Внимание! - - - + The deletion will be irrevocable. Delete it anyway? Удаление будет безвозвратным. Всё равно удалить? - + Status Task Статус задачи - - New task - Новая задача - - - + Assign this task? Назначить эту задачу? @@ -133,27 +123,27 @@ Delete it anyway? Верно - + Completed Выполнена - + New Новая - + viewed Просмотрено - + completed Выполнена - + Change task status? The status will be set: 'failed' @@ -162,7 +152,7 @@ The status will be set: 'неверно' - + Change task status? The status will be set: 'new' @@ -171,14 +161,8 @@ The status will be set: 'новая' - - - Attention! - Внимание! - - - - + + Change task status? The status will be set: 'completed' @@ -363,7 +347,7 @@ The status will be set: - + To archive Архивировать @@ -378,58 +362,37 @@ The status will be set: Показать архив - - - - - Error! - Ошибка! - - - + You cannot delete the Administrator. Нельзя удалить администратора. - + You cannot delete a logged-in instructor. Вы не можете удалить инструктора, вошедшего в систему. - - Attention! - Внимание! - - - + The deletion will be irrevocable. Delete it anyway? Удаление будет безвозвратным. Всё равно удалить? - + You cannot archive a logged-in instructor. Вы не можете заархивировать инструктора, вошедшего в систему. - + You cannot edit a logged-in instructor. Вы не можете редактировать инструктора, вошедшего в систему. - + From archive Разархивировать - - - - - - Editing error! - Ошибка редактирования! - Unacceptable instructor name has been entered. @@ -438,21 +401,21 @@ 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. Введен существующий логин инструктора или обучаемого. @@ -488,8 +451,8 @@ The changes will not be accepted. - - + + To archive Архивировать @@ -504,59 +467,36 @@ The changes will not be accepted. Показать архив - - - - - - - - Editing error! - Ошибка редактирования! - - - + The group is not empty. It is not possible to delete a non-empty group. Группа не пуста. Невозможно удалить непустую группу. - - - Attention! - Внимание! - - - - + + The deletion will be irrevocable. -Delete anyway? - Удаление будет безвозвратным. Всё равно удалить? +Delete it anyway? + Удаление будет безвозвратным. +Всё равно удалить? - - - - Error! - Ошибка! - - - + You cannot delete a logged-in trainee. Вы не можете удалить обучаемого, вошедшего в систему. - + You cannot archive a logged-in trainee. Вы не можете заархивировать обучаемого, вошедшего в систему. - + You cannot edit a logged-in trainee. Вы не можете редактировать обучаемого, вошедшего в систему. - + From archive Разархивировать @@ -568,35 +508,35 @@ 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. Введен существующий логин инструктора или обучаемого. @@ -626,47 +566,37 @@ The changes will not be accepted. Удалить - - + + Task FIM Задача FIM - - + + ID ID - - + + Status Статус - - Attention! - Внимание! - - - + The deletion will be irrevocable. Delete it anyway? Удаление будет безвозвратным. Всё равно удалить? - + Check Task Проверка задачи - - New task - Новая задача - - - + Assign this task? Назначить эту задачу? @@ -731,50 +661,39 @@ Delete it anyway? - - + + none нет - - - Attention! - Внимание! - - - + The file could not be opened Файл не может быть открыт - + Instructor deauthorization Деавторизация инструктора - + Error! Ошибка! - - Warning! - Внимание! + + The server is not available! + Сервер не доступен! - - The server is not available - Сервер не доступен - - - + Server settings have been changed. Please reconnect to the server. Настройки сервера изменены. Выполните переподключение к серверу. - + Instructor authorization Авторизация инструктора @@ -924,14 +843,6 @@ Delete it anyway? Только латинские буквы и цифры - - NotifyController - - - Error - Ошибка - - PersonalCardTrainee @@ -1019,31 +930,65 @@ Delete it anyway? RecognizeSystem - - Attention! - Внимание! - - - + The file could not be opened Файл не может быть открыт - + You cannot delete the basic version! Вы не можете удалить базовую версию! - + You cannot delete the active version Вы не можете удалить активную версию - + This name already exists Это имя уже существует + + SpecialMessageBox + + + Dialog + + + + + text + + + + + Yes + Да + + + + No + Нет + + + + + Attention! + Внимание! + + + + Error! + Ошибка! + + + + Information + Информация + + TaskAMMFIMTreePreparation