diff --git a/src/forms/settings/AboutForm.cpp b/src/forms/settings/AboutForm.cpp index bf1650b..f0b1eb3 100644 --- a/src/forms/settings/AboutForm.cpp +++ b/src/forms/settings/AboutForm.cpp @@ -46,7 +46,7 @@ void AboutForm::initUiWidget() QLabel* pProductVer; QPushButton* pBtnHelp; QLabel* pCompanyCopyRight; - QLabel* pGuiVer; + QLabel* pMainVer; QLabel* pEmbededSoftVer; QLabel* pFEBVer; QLabel* pQtVer; @@ -90,12 +90,12 @@ void AboutForm::initUiWidget() pMainLayout->addSpacing(subContentSpacing); - pGuiVer = new QLabel(this); - pGuiVer->setText(QString(tr("GUI Software V%1")).arg(getGUIVersion())); - pMainLayout->addWidget(pGuiVer); + pMainVer = new QLabel(this); + pMainVer->setText(QString(tr("USCT Software V0.1.0"))); + pMainLayout->addWidget(pMainVer); pEmbededSoftVer = new QLabel(this); - pEmbededSoftVer->setText(tr("Embedded Software %1").arg(getEmbVersion())); + pEmbededSoftVer->setText(DeviceManager::Default()->getSoftwareVersion()); pMainLayout->addWidget(pEmbededSoftVer); @@ -104,7 +104,7 @@ void AboutForm::initUiWidget() pMainLayout->addSpacing(subContentSpacing); pFEBVer = new QLabel(this); - pFEBVer->setText(tr("FEB Information")); + pFEBVer->setText(QString(tr("GUI Software V%1")).arg(getGUIVersion())); pMainLayout->addWidget(pFEBVer); pMainLayout->addSpacing(subContentSpacing); @@ -113,12 +113,12 @@ void AboutForm::initUiWidget() pMainLayout->addSpacing(subContentSpacing); pSUSEVer = new QLabel(this); - pSUSEVer->setText(tr("Loading...")); + pSUSEVer->setText(tr("Operation System Information Loading...")); pMainLayout->addWidget(pSUSEVer); pMainLayout->addSpacing(subContentSpacing); pDcmtkVer = new QLabel(this); - pDcmtkVer->setText(tr("Loading...")); + pDcmtkVer->setText(tr("DICOM Library Information Loading...")); pMainLayout->addWidget(pDcmtkVer); pDcmtkCopyright = new QLabel(this); pDcmtkCopyright->setObjectName("normal"); @@ -151,7 +151,7 @@ void AboutForm::initUiWidget() pProductVer->setText(tr("HJ-USCT-01 V1.0")); pBtnHelp->setText(tr("?")); pCompanyCopyRight->setText(tr("Copyright © 2017-2020 Zhejiang Equilibrium Nine Medical Equipment Co., Ltd. All Rights Reversed")); - pGuiVer->setText(QString(tr("GUI Software V%1")).arg(getGUIVersion())); + pMainVer->setText(QString(tr("GUI Software V%1")).arg(getGUIVersion())); pEmbededSoftVer->setText(tr("Embedded Software %1").arg(getEmbVersion())); mReconSotfVer->setText(tr("Reconstruction Software V1.2")); pFEBVer->setText(tr("FEB Information")); diff --git a/src/icons/turnoff.png b/src/icons/turnoff.png new file mode 100644 index 0000000..34a99b4 Binary files /dev/null and b/src/icons/turnoff.png differ diff --git a/src/res.qrc b/src/res.qrc index 9fb4bc1..787958f 100644 --- a/src/res.qrc +++ b/src/res.qrc @@ -57,5 +57,6 @@ icons/query.png icons/radio_check.png icons/radio_uncheck.png + icons/turnoff.png diff --git a/src/stylesheet/Dark2.css b/src/stylesheet/Dark2.css index f82fd9c..ad3441b 100644 --- a/src/stylesheet/Dark2.css +++ b/src/stylesheet/Dark2.css @@ -260,6 +260,11 @@ QFrame#loginFrame { stop: 1.0 darkgray); } +QFrame#TurnoffFrame { + max-height: 100px; + min-height: 100px; +} + QDialog#loginForm { background-color: #3c3c3c; color: white; @@ -307,6 +312,16 @@ QDialog#loginForm QToolButton#btnlogin { QDialog#loginForm QToolButton#btnlogin:hover { background: #505050; } +QToolButton#TurnoffBtn { + border: 1px solid #0078d8; + min-height:80px; + max-height:80px; + min-width:80px; + max-width:80px; + qproperty-icon:url(":/icons/turnoff.png"); + qproperty-iconSize:60px 60px; + qproperty-toolButtonStyle:ToolButtonIconOnly; +} /*------MainWindow------------------------------------------------------------------*/ diff --git a/src/windows/LoginDialog.cpp b/src/windows/LoginDialog.cpp index ec22bd8..501dd42 100644 --- a/src/windows/LoginDialog.cpp +++ b/src/windows/LoginDialog.cpp @@ -7,6 +7,7 @@ #include #include "event/EventCenter.h" +#include "dialogs/DialogManager.h" #include "models/User.h" #include "log/UserOperationLog.h" #include "json/jsonobject.h" @@ -17,6 +18,7 @@ LoginDialog::LoginDialog(QWidget* aParent) , mVMainLayout(new QVBoxLayout(this)) , mDialogTitle(new QLabel(this)) , mDialogFrame(new QFrame(this)) + , mTurnoffFrame(new QFrame(this)) , mDialogContentsLayout(new QVBoxLayout(mDialogFrame)) , mAccountEdit(new ULineEdit(mDialogFrame)) , mPasswordEdit(new ULineEdit(mDialogFrame)) @@ -55,7 +57,21 @@ void LoginDialog::initializeLayout() mVMainLayout->addWidget(mDialogTitle, 0, Qt::AlignCenter); mVMainLayout->addWidget(mDialogFrame, 0, Qt::AlignCenter); mVMainLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding)); - + mTurnoffFrame->setObjectName("TurnoffFrame"); + mVMainLayout->addWidget(mTurnoffFrame, 0, Qt::AlignRight); + QHBoxLayout * hLayout = new QHBoxLayout(mTurnoffFrame); + hLayout->setDirection(QBoxLayout::RightToLeft); + QToolButton * turnOffBtn = new QToolButton(mTurnoffFrame); + turnOffBtn->setObjectName("TurnoffBtn"); + hLayout->addWidget(turnOffBtn); + connect(turnOffBtn, &QToolButton::clicked, []() + { + if(DialogManager::Default()->requestAlertMessage(QString(tr("Shut down now ?")), DialogButtonMode::OkAndCancel,tr("Shut Down")) == QDialog::Accepted) + { + LOG_USER_OPERATION("Shut Down") + EventCenter::Default()->triggerEvent(GUIEvents::RequestShutdown, nullptr, nullptr); + } + }); mDialogContentsLayout->setSpacing(30); mDialogContentsLayout->setContentsMargins(20, 60, 20, 20); } diff --git a/src/windows/LoginDialog.h b/src/windows/LoginDialog.h index 5fc765b..dc48ac2 100644 --- a/src/windows/LoginDialog.h +++ b/src/windows/LoginDialog.h @@ -47,6 +47,7 @@ private: QVBoxLayout* mVMainLayout; QLabel* mDialogTitle; QFrame* mDialogFrame; + QFrame* mTurnoffFrame; QVBoxLayout* mDialogContentsLayout; ULineEdit* mAccountEdit; ULineEdit* mPasswordEdit;