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,7 @@
#include "event/EventCenter.h"
#include "json/jsonobject.h"
#include "dialogs/SelectDialog.h"
#include "dialogs/DialogManager.h"
#include "utilities/Locker.h"
#include "utilities/LanguageSwitcher.h"
#include "components/ULineEdit.h"
@@ -19,11 +19,10 @@
GeneralForm::GeneralForm(QWidget* aParent)
: QWidget(aParent)
, mLayout(new QVBoxLayout(this))
, mSelectDialog(new SelectDialog(this))
{
setFocusPolicy(Qt::ClickFocus);
QWidget* lanHeader = new QWidget(this);
mLayout->addWidget(lanHeader);
mSelectDialog->setWindowModality(Qt::WindowModal);
QHBoxLayout* lanHeaderLayout = new QHBoxLayout(lanHeader);
QLabel* languageLabel = new QLabel(tr("Language"));
@@ -94,11 +93,10 @@ GeneralForm::GeneralForm(QWidget* aParent)
connect(btnLan, &QPushButton::clicked, [=]()
{
mSelectDialog->setValues(JsonObject::Instance()->language());
mSelectDialog->setSelectedValue(JsonObject::Instance()->defaultLanguage());
if (mSelectDialog->exec() == QDialog::Accepted)
DialogResult result = DialogManager::Default()->requestSelectLanguage();
if (result.ResultCode == QDialog::Accepted)
{
QString language = mSelectDialog->getSelectedValue();
QString language = result.ResultData.toString();
//take effect
JsonObject::Instance()->setDefaultLanguage(language);