2022-03-02 00:14:20 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQml.Models 2.3
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.controls 1.0
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
2022-03-28 09:38:58 +00:00
|
|
|
import StatusQ.Controls.Validators 0.1
|
2022-03-02 00:14:20 +00:00
|
|
|
|
|
|
|
StatusModal {
|
2022-03-28 09:38:58 +00:00
|
|
|
id: root
|
2022-03-02 00:14:20 +00:00
|
|
|
property var profileStore
|
|
|
|
|
2022-03-28 09:38:58 +00:00
|
|
|
width: 420
|
|
|
|
height: 250
|
|
|
|
closePolicy: Popup.NoAutoClose
|
|
|
|
header.title: qsTr("Edit")
|
2022-03-02 00:14:20 +00:00
|
|
|
contentItem: Item {
|
2022-03-28 09:38:58 +00:00
|
|
|
StatusInput {
|
|
|
|
id: displayNameInput
|
2022-08-29 18:03:50 +00:00
|
|
|
input.edit.objectName: "DisplayNamePopup_displayNameInput"
|
2022-03-28 09:38:58 +00:00
|
|
|
width: parent.width - Style.current.padding
|
2022-03-02 00:14:20 +00:00
|
|
|
anchors.top: parent.top
|
2022-03-28 09:38:58 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2022-03-02 00:14:20 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-07-22 10:28:04 +00:00
|
|
|
placeholderText: qsTr("Display Name")
|
2022-03-28 09:38:58 +00:00
|
|
|
input.text: root.profileStore.displayName
|
2022-04-01 08:06:39 +00:00
|
|
|
validators: Constants.validators.displayName
|
2022-03-02 00:14:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rightButtons: [
|
|
|
|
StatusButton {
|
2022-08-29 18:03:50 +00:00
|
|
|
id: okBtn
|
|
|
|
objectName: "DisplayNamePopup_okButton"
|
2022-07-19 08:34:27 +00:00
|
|
|
text: qsTr("OK")
|
2022-04-01 08:06:39 +00:00
|
|
|
enabled: !!displayNameInput.text && displayNameInput.valid
|
2022-03-02 00:14:20 +00:00
|
|
|
onClicked: {
|
2022-04-01 08:06:39 +00:00
|
|
|
root.profileStore.setDisplayName(displayNameInput.text)
|
2022-03-28 09:38:58 +00:00
|
|
|
root.close()
|
2022-03-02 00:14:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2022-03-28 09:38:58 +00:00
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
onOpened: { displayNameInput.input.edit.forceActiveFocus() }
|
2022-03-02 00:14:20 +00:00
|
|
|
}
|
|
|
|
|