Merge branch 'master' of http://192.168.1.9:3000/Bug/GUI
This commit is contained in:
26
src/dialogs/AdminSPwdDialog.cpp
Normal file
26
src/dialogs/AdminSPwdDialog.cpp
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#include "AdminSPwdDialog.h"
|
||||||
|
|
||||||
|
#include <QtWidgets/QVBoxLayout>
|
||||||
|
#include <QtWidgets/QLabel>
|
||||||
|
|
||||||
|
AdminSPwdDialog::AdminSPwdDialog(QWidget *parent, Qt::WindowFlags f)
|
||||||
|
: GUIFormBaseDialog(parent, f)
|
||||||
|
{
|
||||||
|
this->setMinimumHeight(300);
|
||||||
|
this->setMinimumWidth(200);
|
||||||
|
mFormWidget->setObjectName("Adminform");
|
||||||
|
auto layout = new QVBoxLayout(mFormWidget);
|
||||||
|
layout->setSpacing(0);
|
||||||
|
QLabel* lblMsg = new QLabel(mFormWidget);
|
||||||
|
lblMsg->setObjectName("Notice");
|
||||||
|
lblMsg->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);
|
||||||
|
lblMsg->setWordWrap(true);
|
||||||
|
lblMsg->setText(tr("Please give this code to producer for getting the SP Code to reset admininistrator's password to\"123456\"!"));
|
||||||
|
layout->addWidget(lblMsg, Qt::AlignHCenter);
|
||||||
|
QLabel* lblSCode = new QLabel(mFormWidget);
|
||||||
|
lblSCode->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
|
||||||
|
layout->addWidget(lblSCode, Qt::AlignHCenter);
|
||||||
|
lblSCode->setObjectName("resetCode");
|
||||||
|
lblSCode->setText("U S C T");
|
||||||
|
lblSCode->setAlignment(Qt::AlignCenter);
|
||||||
|
}
|
||||||
16
src/dialogs/AdminSPwdDialog.h
Normal file
16
src/dialogs/AdminSPwdDialog.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef CF2CD71D_5155_4FC5_B382_331CBD884F97
|
||||||
|
#define CF2CD71D_5155_4FC5_B382_331CBD884F97
|
||||||
|
#include "GUIFormBaseDialog.h"
|
||||||
|
class AdminSPwdDialog :public GUIFormBaseDialog{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit AdminSPwdDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||||
|
~AdminSPwdDialog() override = default;
|
||||||
|
protected:
|
||||||
|
bool updateReferenceData() override{return true;}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* CF2CD71D_5155_4FC5_B382_331CBD884F97 */
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "dialogs/SelectDialog.h"
|
#include "dialogs/SelectDialog.h"
|
||||||
#include "dialogs/GetWorkListDialog.h"
|
#include "dialogs/GetWorkListDialog.h"
|
||||||
#include "dialogs/PatientConfirmDialog.h"
|
#include "dialogs/PatientConfirmDialog.h"
|
||||||
|
#include "dialogs/AdminSPwdDialog.h"
|
||||||
|
|
||||||
#include "network/DicomCfgDialog.h"
|
#include "network/DicomCfgDialog.h"
|
||||||
#include "network/GetAdminPsw.h"
|
#include "network/GetAdminPsw.h"
|
||||||
@@ -118,6 +119,16 @@ void DialogManager::requestScreenSaverStop(bool aIsStopLocker)
|
|||||||
mScreenSaverWindow->stop(aIsStopLocker);
|
mScreenSaverWindow->stop(aIsStopLocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DialogManager::requestResetAdminPwd()
|
||||||
|
{
|
||||||
|
AdminSPwdDialog dialog(mTopWidget);
|
||||||
|
setTopWidget(&dialog);
|
||||||
|
dialog.setWindowModality(Qt::WindowModal);
|
||||||
|
int ret = dialog.exec();
|
||||||
|
releaseTopWidget(&dialog);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int DialogManager::requestAddAccount(QSqlTableModel* model) {
|
int DialogManager::requestAddAccount(QSqlTableModel* model) {
|
||||||
AccountFormDialog dialog(mTopWidget, New);
|
AccountFormDialog dialog(mTopWidget, New);
|
||||||
setTopWidget(&dialog);
|
setTopWidget(&dialog);
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public:
|
|||||||
void requestLogin(QWidget* aParent);
|
void requestLogin(QWidget* aParent);
|
||||||
void requestScreenSaverPlay();
|
void requestScreenSaverPlay();
|
||||||
void requestScreenSaverStop(bool aIsStopLocker = false);
|
void requestScreenSaverStop(bool aIsStopLocker = false);
|
||||||
|
int requestResetAdminPwd();
|
||||||
int requestAddAccount(QSqlTableModel* model);
|
int requestAddAccount(QSqlTableModel* model);
|
||||||
int requestEditSelfAccount();
|
int requestEditSelfAccount();
|
||||||
int requestEditAdminAccount(const QMap<QString, QVariant>& values);
|
int requestEditAdminAccount(const QMap<QString, QVariant>& values);
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ QDialog#loginForm {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDialog#loginForm QLabel#title {
|
QLabel#loginTitle {
|
||||||
font-Size: 98px;
|
font-Size: 98px;
|
||||||
color: qlineargradient(x1:0,
|
color: qlineargradient(x1:0,
|
||||||
y1: 0,
|
y1: 0,
|
||||||
@@ -338,6 +338,17 @@ QToolButton#TurnoffBtn {
|
|||||||
qproperty-toolButtonStyle:ToolButtonIconOnly;
|
qproperty-toolButtonStyle:ToolButtonIconOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QToolButton#HideBtn {
|
||||||
|
border: none;
|
||||||
|
min-height:50px;
|
||||||
|
max-height:50px;
|
||||||
|
min-width:50px;
|
||||||
|
max-width:50px;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*------MainWindow------------------------------------------------------------------*/
|
/*------MainWindow------------------------------------------------------------------*/
|
||||||
|
|
||||||
/*------TopbarWidget--------------------------------------------------------------- */
|
/*------TopbarWidget--------------------------------------------------------------- */
|
||||||
@@ -1006,3 +1017,19 @@ QListView#LeftBtnBar::item
|
|||||||
QWidget#settingContentWidget QWidget{
|
QWidget#settingContentWidget QWidget{
|
||||||
font-size:26px;
|
font-size:26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QLabel#Notice{
|
||||||
|
font-size:20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLabel#resetCode {
|
||||||
|
font-Size: 60px;
|
||||||
|
color: qlineargradient(x1:0,
|
||||||
|
y1: 0,
|
||||||
|
x2: 0,
|
||||||
|
y2: 1,
|
||||||
|
stop: 0.0 darkgray,
|
||||||
|
stop: 0.5 lightgray,
|
||||||
|
stop: 1.0 darkgray);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ LoginDialog::LoginDialog(QWidget* aParent)
|
|||||||
, mVMainLayout(new QVBoxLayout(this))
|
, mVMainLayout(new QVBoxLayout(this))
|
||||||
, mDialogTitle(new QLabel(this))
|
, mDialogTitle(new QLabel(this))
|
||||||
, mDialogFrame(new QFrame(this))
|
, mDialogFrame(new QFrame(this))
|
||||||
|
, mHideFrame(new QFrame(this))
|
||||||
, mTurnoffFrame(new QFrame(this))
|
, mTurnoffFrame(new QFrame(this))
|
||||||
, mDialogContentsLayout(new QVBoxLayout(mDialogFrame))
|
, mDialogContentsLayout(new QVBoxLayout(mDialogFrame))
|
||||||
, mAccountEdit(new ULineEdit(mDialogFrame))
|
, mAccountEdit(new ULineEdit(mDialogFrame))
|
||||||
@@ -25,6 +26,7 @@ LoginDialog::LoginDialog(QWidget* aParent)
|
|||||||
, mLoginButton(nullptr)
|
, mLoginButton(nullptr)
|
||||||
, mErrorMessage(new QLabel(this))
|
, mErrorMessage(new QLabel(this))
|
||||||
, mIsRunning(false)
|
, mIsRunning(false)
|
||||||
|
, mHideClickCount(0)
|
||||||
{
|
{
|
||||||
initializeAllWidget();
|
initializeAllWidget();
|
||||||
setWindowFlags(windowFlags() | Qt::Window | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint| Qt::BypassWindowManagerHint);
|
setWindowFlags(windowFlags() | Qt::Window | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint| Qt::BypassWindowManagerHint);
|
||||||
@@ -53,6 +55,20 @@ void LoginDialog::initializeLayout()
|
|||||||
{
|
{
|
||||||
mVMainLayout->setContentsMargins(0, 0, 0, 0);
|
mVMainLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
mVMainLayout->setSpacing(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->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||||
mVMainLayout->addWidget(mDialogTitle, 0, Qt::AlignCenter);
|
mVMainLayout->addWidget(mDialogTitle, 0, Qt::AlignCenter);
|
||||||
mVMainLayout->addWidget(mDialogFrame, 0, Qt::AlignCenter);
|
mVMainLayout->addWidget(mDialogFrame, 0, Qt::AlignCenter);
|
||||||
@@ -78,7 +94,7 @@ void LoginDialog::initializeLayout()
|
|||||||
|
|
||||||
void LoginDialog::initializeTitle()
|
void LoginDialog::initializeTitle()
|
||||||
{
|
{
|
||||||
mDialogTitle->setObjectName("title");
|
mDialogTitle->setObjectName("loginTitle");
|
||||||
mDialogTitle->setText(tr("U S C T"));
|
mDialogTitle->setText(tr("U S C T"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +158,7 @@ void LoginDialog::doLogin()
|
|||||||
accept();
|
accept();
|
||||||
LOG_USER_OPERATION("Login Sucessful");
|
LOG_USER_OPERATION("Login Sucessful");
|
||||||
JsonObject::Instance()->setDefaultUser(strUserCode);
|
JsonObject::Instance()->setDefaultUser(strUserCode);
|
||||||
|
mHideClickCount = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ private:
|
|||||||
QVBoxLayout* mVMainLayout;
|
QVBoxLayout* mVMainLayout;
|
||||||
QLabel* mDialogTitle;
|
QLabel* mDialogTitle;
|
||||||
QFrame* mDialogFrame;
|
QFrame* mDialogFrame;
|
||||||
|
QFrame* mHideFrame;
|
||||||
QFrame* mTurnoffFrame;
|
QFrame* mTurnoffFrame;
|
||||||
QVBoxLayout* mDialogContentsLayout;
|
QVBoxLayout* mDialogContentsLayout;
|
||||||
ULineEdit* mAccountEdit;
|
ULineEdit* mAccountEdit;
|
||||||
@@ -54,6 +55,7 @@ private:
|
|||||||
QToolButton* mLoginButton;
|
QToolButton* mLoginButton;
|
||||||
QLabel* mErrorMessage;
|
QLabel* mErrorMessage;
|
||||||
bool mIsRunning;
|
bool mIsRunning;
|
||||||
|
int mHideClickCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LOGINDIALOG_H
|
#endif // LOGINDIALOG_H
|
||||||
|
|||||||
Reference in New Issue
Block a user