2022-03-27 12:00:29 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.0
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
Item {
|
2022-04-30 07:27:56 +00:00
|
|
|
id: root
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
width: childrenRect.width
|
|
|
|
height: childrenRect.height
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
signal finished()
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
ColumnLayout {
|
|
|
|
spacing: 20
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Username")
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: Self.screenName
|
|
|
|
font.pixelSize: 18
|
|
|
|
}
|
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Avatar")
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: avatarName
|
|
|
|
font.pixelSize: 18
|
|
|
|
text: Self.avatar
|
|
|
|
}
|
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Old Password")
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: oldPassword
|
|
|
|
echoMode: TextInput.Password
|
|
|
|
passwordCharacter: "*"
|
|
|
|
}
|
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("New Password")
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: newPassword
|
|
|
|
echoMode: TextInput.Password
|
|
|
|
passwordCharacter: "*"
|
|
|
|
}
|
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Button {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Update Avatar")
|
2022-04-30 07:27:56 +00:00
|
|
|
enabled: avatarName.text !== ""
|
|
|
|
onClicked: {
|
|
|
|
mainWindow.busy = true;
|
|
|
|
ClientInstance.notifyServer(
|
|
|
|
"UpdateAvatar",
|
|
|
|
JSON.stringify([avatarName.text])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Button {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Update Password")
|
2022-04-30 07:27:56 +00:00
|
|
|
enabled: oldPassword.text !== "" && newPassword.text !== ""
|
|
|
|
onClicked: {
|
|
|
|
mainWindow.busy = true;
|
|
|
|
ClientInstance.notifyServer(
|
|
|
|
"UpdatePassword",
|
|
|
|
JSON.stringify([oldPassword.text, newPassword.text])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Button {
|
2022-05-01 10:37:13 +00:00
|
|
|
text: Backend.translate("Quit")
|
2022-04-30 07:27:56 +00:00
|
|
|
onClicked: {
|
|
|
|
root.finished();
|
2022-03-27 12:00:29 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
}
|