DialogEditTrainee (adminMode)

This commit is contained in:
2025-10-17 11:12:57 +03:00
parent b539f9fd2b
commit d643205323
7 changed files with 33 additions and 17 deletions

View File

@@ -4,11 +4,12 @@
#include <QPushButton>
#include <QRegExpValidator>
DialogEditInstructor::DialogEditInstructor(QWidget *parent) :
DialogEditInstructor::DialogEditInstructor(bool adminMode, QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogEditInstructor),
instructorInput(),
flNeedHashPassword(false)
flNeedHashPassword(false),
adminMode(adminMode)
{
ui->setupUi(this);
verify();
@@ -23,9 +24,9 @@ DialogEditInstructor::DialogEditInstructor(QWidget *parent) :
ui->editLogin->setValidator(new QRegExpValidator(QRegExp("[A-Za-z\\d]+"), this));
ui->editPassword->setEnabled(false);
#ifndef PROJECT_TYPE_DEBUG
//#ifndef PROJECT_TYPE_DEBUG
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
#endif
//#endif
ui->btnViewPassword->setEnabled(false);
ui->btnChangePassword->setEnabled(false);
@@ -61,7 +62,10 @@ void DialogEditInstructor::setInstructor(Instructor instructor)
ui->btnViewPassword->setEnabled(true);
}
else
ui->btnChangePassword->setEnabled(true);
{
if(adminMode)
ui->btnChangePassword->setEnabled(true);
}
ui->btnOK->setEnabled(false);
}
@@ -136,4 +140,6 @@ void DialogEditInstructor::on_btnChangePassword_clicked()
ui->editPassword->setText("");
flNeedHashPassword = true;
ui->editPassword->setFocus();
}