bugFixing 2

This commit is contained in:
2025-09-16 12:50:58 +03:00
parent b026bbe0d4
commit eaf5f0673a
12 changed files with 28 additions and 24 deletions

View File

@@ -8,5 +8,5 @@ NotifyController::NotifyController(QObject *parent) : QObject(parent)
void NotifyController::showWarning(QString text) void NotifyController::showWarning(QString text)
{ {
SpecialMessageBox(nullptr, SpecialMessageBox::TypeSpecMsgBox::warningWithoutButtons, text).exec(); SpecialMessageBox(nullptr, SpecialMessageBox::TypeSpecMsgBox::warningClose, text).exec();
} }

View File

@@ -18,6 +18,10 @@ DialogSettings::DialogSettings(ConnectorToServer* connectorToServer, bool instru
ui->btnSave->setObjectName("btnSave"); ui->btnSave->setObjectName("btnSave");
ui->checkAutoStart->setObjectName("checkAutoStart"); ui->checkAutoStart->setObjectName("checkAutoStart");
#ifndef PROJECT_TYPE_DEBUG
ui->btnUpdateStyle->setVisible(false);
#endif
this->connectorToServer = connectorToServer; this->connectorToServer = connectorToServer;
/* Создаем строку для регулярного выражения */ /* Создаем строку для регулярного выражения */

View File

@@ -119,7 +119,7 @@ void EditorInstructors::on_btnDeleteInstructor_clicked()
return; return;
} }
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted)
{ {
waitAnimationWidget->showWithPlay(); waitAnimationWidget->showWithPlay();
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_INSTRUCTOR, id); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_INSTRUCTOR, id);

View File

@@ -24,7 +24,7 @@ void InstructorsView::resizeEvent(QResizeEvent *event)
if(typeView == TypeView::onlyView) if(typeView == TypeView::onlyView)
{//onlyView {//onlyView
widthInstructor = width - (290 + 10); widthInstructor = width - (220 + 10);
} }
else else
{//control {//control

View File

@@ -186,7 +186,7 @@ void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *se
else else
{ {
ui->btnAuthorizationInstructor->setChecked(false); ui->btnAuthorizationInstructor->setChecked(false);
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor authorization") + "\n" + tr("Invalid login or password!")).exec(); SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("Instructor authorization.") + "\n" + tr("Invalid login or password!")).exec();
} }
} }
@@ -251,7 +251,7 @@ void InstructorsAndTraineesWidget::slot_ConnectedToServer(bool state)
updateLabelLoggedInInstructor(loginInstructorLoggedInLocal, nameInstructorLoggedInLocal); updateLabelLoggedInInstructor(loginInstructorLoggedInLocal, nameInstructorLoggedInLocal);
updateLabelServer(); updateLabelServer();
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::critical, tr("The server is not available!")).exec(); SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningClose, tr("The server is not available!")).exec();
} }
} }
@@ -439,7 +439,7 @@ void InstructorsAndTraineesWidget::on_btnSettings_clicked()
if(dlg.settingsServerIsChanged()) if(dlg.settingsServerIsChanged())
{ {
SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningWithoutButtons, tr("Server settings have been changed. Please reconnect to the server.")).exec(); SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningClose, tr("Server settings have been changed. Please reconnect to the server.")).exec();
if(authorizationIsCompleted()) if(authorizationIsCompleted())
deAuthorizationInstructor(loginInstructorLoggedInLocal); deAuthorizationInstructor(loginInstructorLoggedInLocal);

View File

@@ -10,31 +10,31 @@ SpecialMessageBox::SpecialMessageBox(QWidget *parent, TypeSpecMsgBox type, const
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
if(type == TypeSpecMsgBox::warning) if(type == TypeSpecMsgBox::warningYesNo)
{ {
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png"))); ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png")));
this->setWindowTitle(tr("Attention!")); this->setWindowTitle(tr("Attention!"));
} }
else if(type == TypeSpecMsgBox::warningWithoutButtons) else if(type == TypeSpecMsgBox::warningClose)
{ {
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png"))); ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png")));
this->setWindowTitle(tr("Attention!")); this->setWindowTitle(tr("Attention!"));
ui->btnYes->setVisible(false);
ui->btnNo->setVisible(false); ui->btnNo->setVisible(false);
ui->btnYes->setText(tr("Close"));
} }
else if(type == TypeSpecMsgBox::critical) else if(type == TypeSpecMsgBox::critical)
{ {
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/critical.png"))); ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/critical.png")));
this->setWindowTitle(tr("Error!")); this->setWindowTitle(tr("Error!"));
ui->btnYes->setVisible(false);
ui->btnNo->setVisible(false); ui->btnNo->setVisible(false);
ui->btnYes->setText(tr("Close"));
} }
else if(type == TypeSpecMsgBox::info) else if(type == TypeSpecMsgBox::info)
{ {
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/info.png"))); ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/info.png")));
this->setWindowTitle(tr("Information")); this->setWindowTitle(tr("Information"));
ui->btnYes->setVisible(false);
ui->btnNo->setVisible(false); ui->btnNo->setVisible(false);
ui->btnYes->setText(tr("Ok"));
} }
ui->lblText->setText(text); ui->lblText->setText(text);

View File

@@ -13,8 +13,8 @@ class SpecialMessageBox : public QDialog
public: public:
enum TypeSpecMsgBox { enum TypeSpecMsgBox {
warning, warningYesNo,
warningWithoutButtons, warningClose,
critical, critical,
info info
}; };

View File

@@ -292,7 +292,7 @@ void AMMtasksWidget::on_btnDelete_clicked()
int id = treeItemCurrent->text(ColumnsTreeAMM::clmnAMM_ID).toInt(); int id = treeItemCurrent->text(ColumnsTreeAMM::clmnAMM_ID).toInt();
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted)
{ {
waitAnimationWidget->showWithPlay(); waitAnimationWidget->showWithPlay();
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TASK_AMM_TO_TRAINEE, id); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TASK_AMM_TO_TRAINEE, id);
@@ -335,7 +335,7 @@ void AMMtasksWidget::on_btnCheck_clicked()
void AMMtasksWidget::on_btnAssignTask_clicked() void AMMtasksWidget::on_btnAssignTask_clicked()
{ {
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("Assign this task?")).exec() == QDialog::Accepted) if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("Assign this task?")).exec() == QDialog::Accepted)
assignTaskAMMtoTrainee(); assignTaskAMMtoTrainee();
} }

View File

@@ -139,7 +139,7 @@ void DialogCheckTask::on_btnWrong_clicked()
msgString = tr("Change task status?\nThe status will be set:\n'new'"); msgString = tr("Change task status?\nThe status will be set:\n'new'");
} }
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, msgString).exec() == QDialog::Accepted) if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, msgString).exec() == QDialog::Accepted)
{ {
connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status); connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status);
this->parentWidget()->close(); this->parentWidget()->close();
@@ -166,7 +166,7 @@ void DialogCheckTask::on_btnRight_clicked()
msgString = tr("Change task status?\nThe status will be set:\n'completed'"); msgString = tr("Change task status?\nThe status will be set:\n'completed'");
} }
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, msgString).exec() == QDialog::Accepted) if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, msgString).exec() == QDialog::Accepted)
{ {
connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status); connectorToServer->sendQueryToDB(typeQuery, id_task, (void*)&status);
this->parentWidget()->close(); this->parentWidget()->close();

View File

@@ -339,7 +339,7 @@ void FIMtasksWidget::on_btnDelete_clicked()
int id = treeItemCurrent->text(ColumnsTreeFIM::clmnFIM_ID).toInt(); int id = treeItemCurrent->text(ColumnsTreeFIM::clmnFIM_ID).toInt();
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted)
{ {
waitAnimationWidget->showWithPlay(); waitAnimationWidget->showWithPlay();
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TASK_FIM_TO_TRAINEE, id); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TASK_FIM_TO_TRAINEE, id);
@@ -386,7 +386,7 @@ void FIMtasksWidget::on_btnCheck_clicked()
void FIMtasksWidget::on_btnAssignTask_clicked() void FIMtasksWidget::on_btnAssignTask_clicked()
{ {
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("Assign this task?")).exec() == QDialog::Accepted) if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("Assign this task?")).exec() == QDialog::Accepted)
assignTaskFIMtoTrainee(); assignTaskFIMtoTrainee();
} }

View File

@@ -117,7 +117,7 @@ void EditorTrainees::on_btnDeleteGroup_clicked()
} }
else else
{//Пустая группа {//Пустая группа
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted)
{ {
waitAnimationWidget->showWithPlay(); waitAnimationWidget->showWithPlay();
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_GROUP, id_group); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_GROUP, id_group);
@@ -221,7 +221,7 @@ void EditorTrainees::on_btnDeleteTrainee_clicked()
return; return;
} }
if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warning, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted) if(SpecialMessageBox(this, SpecialMessageBox::TypeSpecMsgBox::warningYesNo, tr("The deletion will be irrevocable.\nDelete it anyway?")).exec() == QDialog::Accepted)
{ {
waitAnimationWidget->showWithPlay(); waitAnimationWidget->showWithPlay();
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TRAINEE, id_trainee); connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TRAINEE, id_trainee);

View File

@@ -25,14 +25,14 @@ void TraineesView::resizeEvent(QResizeEvent *event)
if(typeView == TypeView::onlyView) if(typeView == TypeView::onlyView)
{//onlyView {//onlyView
widthTrainee = width - (270 + 10); widthTrainee = width - (220 + 10);
} }
else else
{//control {//control
if(adminMode) if(adminMode)
widthTrainee = width - (450 + 10); widthTrainee = width - (470 + 10);
else else
widthTrainee = width - (320 + 10); widthTrainee = width - (340 + 10);
} }
if(widthTrainee < 250) if(widthTrainee < 250)
widthTrainee = 250; widthTrainee = 250;