2023-04-28 10:24:31 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
// anchors.centerIn: parent
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("Username")
|
2023-04-28 10:24:31 +00:00
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: Self.screenName
|
|
|
|
font.pixelSize: 18
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-07 13:14:51 +00:00
|
|
|
Timer {
|
|
|
|
id: opTimer
|
|
|
|
interval: 1000
|
|
|
|
}
|
|
|
|
|
2023-04-28 10:24:31 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("Avatar")
|
2023-04-28 10:24:31 +00:00
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: avatarName
|
2023-04-30 10:51:05 +00:00
|
|
|
maximumLength: 64
|
2023-04-28 10:24:31 +00:00
|
|
|
font.pixelSize: 18
|
|
|
|
text: Self.avatar
|
2023-10-27 14:53:25 +00:00
|
|
|
Layout.fillWidth: true
|
2023-04-28 10:24:31 +00:00
|
|
|
}
|
|
|
|
Button {
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("Update Avatar")
|
2023-11-07 13:14:51 +00:00
|
|
|
enabled: avatarName.text !== "" && !opTimer.running
|
2023-04-28 10:24:31 +00:00
|
|
|
onClicked: {
|
|
|
|
mainWindow.busy = true;
|
2023-11-07 13:14:51 +00:00
|
|
|
opTimer.start();
|
2023-04-28 10:24:31 +00:00
|
|
|
ClientInstance.notifyServer(
|
|
|
|
"UpdateAvatar",
|
|
|
|
JSON.stringify([avatarName.text])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("Old Password")
|
2023-04-28 10:24:31 +00:00
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: oldPassword
|
|
|
|
echoMode: TextInput.Password
|
|
|
|
passwordCharacter: "*"
|
2023-10-27 14:53:25 +00:00
|
|
|
Layout.rightMargin: 16
|
|
|
|
Layout.fillWidth: true
|
2023-04-28 10:24:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("New Password")
|
2023-04-28 10:24:31 +00:00
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
id: newPassword
|
|
|
|
echoMode: TextInput.Password
|
|
|
|
passwordCharacter: "*"
|
2023-10-27 14:53:25 +00:00
|
|
|
Layout.fillWidth: true
|
2023-04-28 10:24:31 +00:00
|
|
|
}
|
|
|
|
Button {
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr("Update Password")
|
|
|
|
enabled: oldPassword.text !== "" && newPassword.text !== ""
|
|
|
|
&& !opTimer.running
|
2023-04-28 10:24:31 +00:00
|
|
|
onClicked: {
|
|
|
|
mainWindow.busy = true;
|
2023-11-07 13:14:51 +00:00
|
|
|
opTimer.start();
|
2023-04-28 10:24:31 +00:00
|
|
|
ClientInstance.notifyServer(
|
|
|
|
"UpdatePassword",
|
|
|
|
JSON.stringify([oldPassword.text, newPassword.text])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|