Refactoring the new dialog manager module and fixed keyboard problem in Linux touch panel.

This commit is contained in:
sunwen
2022-08-10 15:28:59 +08:00
parent 9b96af094b
commit 30df175f22
28 changed files with 485 additions and 303 deletions

View File

@@ -10,7 +10,6 @@
#include <QSqlRecord>
#include "components/AccountRoleComboDelegate.h"
#include "dialogs/AlertDialog.h"
#include "dialogs/DialogManager.h"
#include "db/SQLHelper.h"
#include "models/User.h"
@@ -127,18 +126,11 @@ AccountTableForm::AccountTableForm(QWidget* aParent)
if (User::Current()->getUserID() == id)
{
//尝试删除自己
AlertDialog dialog(this);
dialog.setButtonMode(OkOnly);
dialog.setWindowModality(Qt::WindowModal);
dialog.setAlertMessage(tr("Can't delete current log in account!"));
dialog.exec();
DialogManager::Default()->requestAlertMessage(tr("Can't delete current log in account!"), DialogButtonMode::OkOnly);
return;
}
AlertDialog dialog(this);
dialog.setWindowModality(Qt::WindowModal);
dialog.setAlertMessage(QString(tr("Delete account with ID:\"%1\"!")).arg(id));
if (dialog.exec() != QDialog::Accepted) return;
if ( DialogManager::Default()->requestAlertMessage(QString(tr("Delete account with ID:\"%1\"!")).arg(id), DialogButtonMode::OkAndCancel) != QDialog::Accepted) return;
model->removeRow(mCurrentRow);
model->select();
table->selectRow(model->rowCount() > mCurrentRow + 1 ? mCurrentRow : mCurrentRow - 1);