2023-02-15 11:54:35 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import QtQuick.Dialogs
|
2022-03-27 12:00:29 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2023-02-15 11:54:35 +00:00
|
|
|
Button {
|
|
|
|
text: Backend.translate("Update Avatar")
|
|
|
|
enabled: avatarName.text !== ""
|
|
|
|
onClicked: {
|
|
|
|
mainWindow.busy = true;
|
|
|
|
ClientInstance.notifyServer(
|
|
|
|
"UpdateAvatar",
|
|
|
|
JSON.stringify([avatarName.text])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
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: "*"
|
|
|
|
}
|
2023-02-15 11:54:35 +00:00
|
|
|
Button {
|
|
|
|
text: Backend.translate("Update Password")
|
|
|
|
enabled: oldPassword.text !== "" && newPassword.text !== ""
|
|
|
|
onClicked: {
|
|
|
|
mainWindow.busy = true;
|
|
|
|
ClientInstance.notifyServer(
|
|
|
|
"UpdatePassword",
|
|
|
|
JSON.stringify([oldPassword.text, newPassword.text])
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
2023-02-15 11:54:35 +00:00
|
|
|
Text {
|
|
|
|
text: Backend.translate("Lobby BG")
|
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
text: config.lobbyBg
|
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
Button {
|
2023-02-15 11:54:35 +00:00
|
|
|
text: "..."
|
2022-04-30 07:27:56 +00:00
|
|
|
onClicked: {
|
2023-02-15 11:54:35 +00:00
|
|
|
fdialog.nameFilters = ["Image Files (*.jpg *.png)"];
|
|
|
|
fdialog.configKey = "lobbyBg";
|
|
|
|
fdialog.open();
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
}
|
2023-02-15 11:54:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
|
|
|
text: Backend.translate("Room BG")
|
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
text: config.roomBg
|
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
Button {
|
2023-02-15 11:54:35 +00:00
|
|
|
text: "..."
|
2022-04-30 07:27:56 +00:00
|
|
|
onClicked: {
|
2023-02-15 11:54:35 +00:00
|
|
|
fdialog.nameFilters = ["Image Files (*.jpg *.png)"];
|
|
|
|
fdialog.configKey = "roomBg";
|
|
|
|
fdialog.open();
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
}
|
2023-02-15 11:54:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
|
|
|
text: Backend.translate("Game BGM")
|
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
text: config.bgmFile
|
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
Button {
|
2023-02-15 11:54:35 +00:00
|
|
|
text: "..."
|
2022-04-30 07:27:56 +00:00
|
|
|
onClicked: {
|
2023-02-15 11:54:35 +00:00
|
|
|
fdialog.nameFilters = ["Music Files (*.mp3)"];
|
|
|
|
fdialog.configKey = "bgmFile";
|
|
|
|
fdialog.open();
|
2022-03-27 12:00:29 +00:00
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
}
|
2023-02-27 02:23:48 +00:00
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
spacing: 16
|
|
|
|
Text {
|
|
|
|
text: "Language"
|
|
|
|
}
|
|
|
|
ComboBox {
|
|
|
|
model: ["zh_CN", "en_US"]
|
|
|
|
currentIndex: model.indexOf(config.language)
|
|
|
|
onCurrentTextChanged: { config.language = currentText; }
|
|
|
|
}
|
|
|
|
}
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
2023-02-15 11:54:35 +00:00
|
|
|
|
|
|
|
FileDialog {
|
|
|
|
id: fdialog
|
|
|
|
property string configKey
|
|
|
|
onAccepted: { config[configKey] = selectedFile; }
|
|
|
|
}
|
2022-03-27 12:00:29 +00:00
|
|
|
}
|