From 7211dd8fda271d6244babdcb253dba44659f9681 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 10 Sep 2019 21:58:28 -0400 Subject: [PATCH] Fix account settings name field getting reset --- TODO.md | 2 ++ src/qml/Pages/EditAccount/Profile.qml | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index 1d63b8d2..d9c4291f 100644 --- a/TODO.md +++ b/TODO.md @@ -18,6 +18,7 @@ - Message order isn't preserved when sending a first message in a E2E room, then while keys are being shared sending one with another account, then sending one with the first account again + - Left rooms reappear as joined rooms - If account not in config anymore, discard ui state last page on startup - Do something when access token is invalid @@ -169,5 +170,6 @@ - Previewing room without joining - Distribution + - requirements file - Include python dependencies in binary with rcc? - README.md diff --git a/src/qml/Pages/EditAccount/Profile.qml b/src/qml/Pages/EditAccount/Profile.qml index bcb29c63..d3a27a73 100644 --- a/src/qml/Pages/EditAccount/Profile.qml +++ b/src/qml/Pages/EditAccount/Profile.qml @@ -57,7 +57,7 @@ HGridLayout { id: avatar userId: editAccount.userId - displayName: accountInfo.display_name + displayName: nameField.field.text avatarUrl: accountInfo.avatar_url imageUrl: fileDialog.selectedFile || fileDialog.file || defaultImageUrl toolTipImageUrl: "" @@ -146,18 +146,19 @@ HGridLayout { HLabeledTextField { property bool changed: field.text != accountInfo.display_name - property string fText: field.text + readonly property string fText: field.text onFTextChanged: editAccount.headerName = field.text id: nameField label.text: qsTr("Display name:") - field.text: accountInfo.display_name field.onAccepted: applyChanges() + Component.onCompleted: field.text = accountInfo.display_name + + Keys.onEscapePressed: cancelChanges() + Layout.fillWidth: true Layout.maximumWidth: 480 - - Keys.onEscapePressed: cancelChanges() } HLabeledTextField { @@ -168,9 +169,10 @@ HGridLayout { id: aliasField label.text: qsTr("Write alias:") - field.text: currentAlias field.onAccepted: applyChanges() + Component.onCompleted: field.text = currentAlias + Layout.fillWidth: true Layout.maximumWidth: 480