Add AdminSPwd Dialog
This commit is contained in:
@@ -18,6 +18,7 @@ LoginDialog::LoginDialog(QWidget* aParent)
|
||||
, mVMainLayout(new QVBoxLayout(this))
|
||||
, mDialogTitle(new QLabel(this))
|
||||
, mDialogFrame(new QFrame(this))
|
||||
, mHideFrame(new QFrame(this))
|
||||
, mTurnoffFrame(new QFrame(this))
|
||||
, mDialogContentsLayout(new QVBoxLayout(mDialogFrame))
|
||||
, mAccountEdit(new ULineEdit(mDialogFrame))
|
||||
@@ -25,6 +26,7 @@ LoginDialog::LoginDialog(QWidget* aParent)
|
||||
, mLoginButton(nullptr)
|
||||
, mErrorMessage(new QLabel(this))
|
||||
, mIsRunning(false)
|
||||
, mHideClickCount(0)
|
||||
{
|
||||
initializeAllWidget();
|
||||
setWindowFlags(windowFlags() | Qt::Window | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint| Qt::BypassWindowManagerHint);
|
||||
@@ -53,6 +55,20 @@ void LoginDialog::initializeLayout()
|
||||
{
|
||||
mVMainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mVMainLayout->setSpacing(0);
|
||||
mVMainLayout->addWidget(mHideFrame, 0, Qt::AlignLeft);
|
||||
QHBoxLayout * hLayout1 = new QHBoxLayout(mHideFrame);
|
||||
hLayout1->setDirection(QBoxLayout::RightToLeft);
|
||||
QToolButton * hideBtn = new QToolButton(mHideFrame);
|
||||
hideBtn->setObjectName("HideBtn");
|
||||
hLayout1->addWidget(hideBtn);
|
||||
connect(hideBtn, &QToolButton::clicked, [=]()
|
||||
{
|
||||
mHideClickCount++;
|
||||
if (mHideClickCount == 5){
|
||||
mHideClickCount = 0;
|
||||
DialogManager::Default()->requestResetAdminPwd();
|
||||
}
|
||||
});
|
||||
mVMainLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||
mVMainLayout->addWidget(mDialogTitle, 0, Qt::AlignCenter);
|
||||
mVMainLayout->addWidget(mDialogFrame, 0, Qt::AlignCenter);
|
||||
@@ -78,7 +94,7 @@ void LoginDialog::initializeLayout()
|
||||
|
||||
void LoginDialog::initializeTitle()
|
||||
{
|
||||
mDialogTitle->setObjectName("title");
|
||||
mDialogTitle->setObjectName("loginTitle");
|
||||
mDialogTitle->setText(tr("U S C T"));
|
||||
}
|
||||
|
||||
@@ -142,7 +158,7 @@ void LoginDialog::doLogin()
|
||||
accept();
|
||||
LOG_USER_OPERATION("Login Sucessful");
|
||||
JsonObject::Instance()->setDefaultUser(strUserCode);
|
||||
|
||||
mHideClickCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user