Refactoring the new dialog manager module and fixed keyboard problem in Linux touch panel.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user