mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
bugFixing 2
This commit is contained in:
@@ -8,5 +8,5 @@ NotifyController::NotifyController(QObject *parent) : QObject(parent)
|
||||
|
||||
void NotifyController::showWarning(QString text)
|
||||
{
|
||||
SpecialMessageBox(nullptr, SpecialMessageBox::TypeSpecMsgBox::warningWithoutButtons, text).exec();
|
||||
SpecialMessageBox(nullptr, SpecialMessageBox::TypeSpecMsgBox::warningClose, text).exec();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,10 @@ DialogSettings::DialogSettings(ConnectorToServer* connectorToServer, bool instru
|
||||
ui->btnSave->setObjectName("btnSave");
|
||||
ui->checkAutoStart->setObjectName("checkAutoStart");
|
||||
|
||||
#ifndef PROJECT_TYPE_DEBUG
|
||||
ui->btnUpdateStyle->setVisible(false);
|
||||
#endif
|
||||
|
||||
this->connectorToServer = connectorToServer;
|
||||
|
||||
/* Создаем строку для регулярного выражения */
|
||||
|
||||
@@ -119,7 +119,7 @@ void EditorInstructors::on_btnDeleteInstructor_clicked()
|
||||
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();
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_INSTRUCTOR, id);
|
||||
|
||||
@@ -24,7 +24,7 @@ void InstructorsView::resizeEvent(QResizeEvent *event)
|
||||
|
||||
if(typeView == TypeView::onlyView)
|
||||
{//onlyView
|
||||
widthInstructor = width - (290 + 10);
|
||||
widthInstructor = width - (220 + 10);
|
||||
}
|
||||
else
|
||||
{//control
|
||||
|
||||
@@ -186,7 +186,7 @@ void InstructorsAndTraineesWidget::slot_checkLoginResult(ServerAuthorization *se
|
||||
else
|
||||
{
|
||||
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);
|
||||
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())
|
||||
{
|
||||
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())
|
||||
deAuthorizationInstructor(loginInstructorLoggedInLocal);
|
||||
|
||||
@@ -10,31 +10,31 @@ SpecialMessageBox::SpecialMessageBox(QWidget *parent, TypeSpecMsgBox type, const
|
||||
|
||||
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
if(type == TypeSpecMsgBox::warning)
|
||||
if(type == TypeSpecMsgBox::warningYesNo)
|
||||
{
|
||||
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png")));
|
||||
this->setWindowTitle(tr("Attention!"));
|
||||
}
|
||||
else if(type == TypeSpecMsgBox::warningWithoutButtons)
|
||||
else if(type == TypeSpecMsgBox::warningClose)
|
||||
{
|
||||
ui->lbl_icon->setPixmap(QPixmap(QStringLiteral(":/resources/icons/warning.png")));
|
||||
this->setWindowTitle(tr("Attention!"));
|
||||
ui->btnYes->setVisible(false);
|
||||
ui->btnNo->setVisible(false);
|
||||
ui->btnYes->setText(tr("Close"));
|
||||
}
|
||||
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);
|
||||
ui->btnYes->setText(tr("Close"));
|
||||
}
|
||||
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->btnYes->setText(tr("Ok"));
|
||||
}
|
||||
|
||||
ui->lblText->setText(text);
|
||||
|
||||
@@ -13,8 +13,8 @@ class SpecialMessageBox : public QDialog
|
||||
|
||||
public:
|
||||
enum TypeSpecMsgBox {
|
||||
warning,
|
||||
warningWithoutButtons,
|
||||
warningYesNo,
|
||||
warningClose,
|
||||
critical,
|
||||
info
|
||||
};
|
||||
|
||||
@@ -292,7 +292,7 @@ void AMMtasksWidget::on_btnDelete_clicked()
|
||||
|
||||
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();
|
||||
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()
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ void DialogCheckTask::on_btnWrong_clicked()
|
||||
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);
|
||||
this->parentWidget()->close();
|
||||
@@ -166,7 +166,7 @@ void DialogCheckTask::on_btnRight_clicked()
|
||||
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);
|
||||
this->parentWidget()->close();
|
||||
|
||||
@@ -339,7 +339,7 @@ void FIMtasksWidget::on_btnDelete_clicked()
|
||||
|
||||
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();
|
||||
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()
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ void EditorTrainees::on_btnDeleteGroup_clicked()
|
||||
}
|
||||
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();
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_GROUP, id_group);
|
||||
@@ -221,7 +221,7 @@ void EditorTrainees::on_btnDeleteTrainee_clicked()
|
||||
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();
|
||||
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_DEL_TRAINEE, id_trainee);
|
||||
|
||||
@@ -25,14 +25,14 @@ void TraineesView::resizeEvent(QResizeEvent *event)
|
||||
|
||||
if(typeView == TypeView::onlyView)
|
||||
{//onlyView
|
||||
widthTrainee = width - (270 + 10);
|
||||
widthTrainee = width - (220 + 10);
|
||||
}
|
||||
else
|
||||
{//control
|
||||
if(adminMode)
|
||||
widthTrainee = width - (450 + 10);
|
||||
widthTrainee = width - (470 + 10);
|
||||
else
|
||||
widthTrainee = width - (320 + 10);
|
||||
widthTrainee = width - (340 + 10);
|
||||
}
|
||||
if(widthTrainee < 250)
|
||||
widthTrainee = 250;
|
||||
|
||||
Reference in New Issue
Block a user