feat: Make user id and user password input max length to 30.

This commit is contained in:
sunwen
2024-06-20 17:21:01 +08:00
parent 23f8aea990
commit fd8632e888
2 changed files with 12 additions and 1 deletions

View File

@@ -129,6 +129,7 @@ void LoginDialog::initializeEdit()
mAccountEdit->setObjectName("combobox_UserName");
mAccountEdit->setPlaceholderText(tr("Username"));
mAccountEdit->setFocusPolicy(Qt::ClickFocus);
mAccountEdit->setMaxLength(30);
accountEditAreaLayout->addWidget(mAccountEdit);
accountEditAreaLayout->addItem(new QSpacerItem(49,20,QSizePolicy::Fixed));
mDialogContentsLayout->addWidget(accountEditArea);
@@ -140,6 +141,7 @@ void LoginDialog::initializeEdit()
mPasswordEdit->setEchoMode(QLineEdit::Password);
mPasswordEdit->setPlaceholderText(tr("Password"));
mPasswordEdit->setFocusPolicy(Qt::ClickFocus);
mPasswordEdit->setMaxLength(30);
passwordEditAreaLayout->addWidget(mPasswordEdit);
passwordEditAreaLayout->addWidget(mShowPasswordButton);
mShowPasswordButton->setObjectName("ShowPasswordButton");
@@ -186,7 +188,7 @@ void LoginDialog::doLogin()
{
if (!(AppGlobalValues::DBconnected().toBool()))
{
mErrorMessage->setText(QString(tr("Can't connect db. Please reboot the device and retry, or call for the service help.")).arg(LOGIN_LOCK_MINUTIES));
mErrorMessage->setText(tr("Can't connect db. Please reboot the device and retry, or call for the service help."));
mErrorMessage->setVisible(true);
return;
}