Refactoring the new dialog manager module and fixed keyboard problem in Linux touch panel.
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
#include "log/UserOperationLog.h"
|
||||
#include "db/SQLHelper.h"
|
||||
#include "models/User.h"
|
||||
#include "AlertDialog.h"
|
||||
#include "components/ULineEdit.h"
|
||||
#include "DialogManager.h"
|
||||
|
||||
@@ -70,25 +69,17 @@ void AccountFormDialog::addEndLine(QVBoxLayout* layout)
|
||||
|
||||
void AccountFormDialog::resetUserPassword()
|
||||
{
|
||||
AlertDialog dialog(this);
|
||||
dialog.setGeometry(geometry());
|
||||
dialog.setButtonMode(OkAndCancel);
|
||||
dialog.setWindowModality(Qt::WindowModal);
|
||||
dialog.setAlertMessage(tr("Reset password to \"123456\" ?"));
|
||||
if (dialog.exec() == Accepted)
|
||||
if (DialogManager::Default()->requestAlertMessage(tr("Reset password to \"123456\" ?"),DialogButtonMode::OkAndCancel) == Accepted)
|
||||
{
|
||||
User user;
|
||||
dialog.setButtonMode(OkOnly);
|
||||
if (!User::getUser(mUserID, user))
|
||||
{
|
||||
dialog.setAlertMessage(tr("Inner error, can't find reference user!"));
|
||||
dialog.exec();
|
||||
DialogManager::Default()->requestAlertMessage(tr("Inner error, can't find reference user!"), DialogButtonMode::OkAndCancel);
|
||||
return;
|
||||
}
|
||||
if (!user.resetPassword())
|
||||
{
|
||||
dialog.setAlertMessage(tr("Submit change to database fail!"));
|
||||
dialog.exec();
|
||||
DialogManager::Default()->requestAlertMessage(tr("Submit change to database fail!"), DialogButtonMode::OkAndCancel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user