summaryrefslogtreecommitdiff
path: root/Profile.qml
blob: 3a50d4995ac1801298274e865e4a8debaf2af9a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import QtQuick 2.12
import KelakonUser 0.1
import "larva/features"

ProfileForm {
	backButton.onClicked: pageView.pop()
	editToolButton.onClicked: {
		userEmailTextField.text = User.emailAddress
		usernameTextField.text = User.name
		fullnameTextField.text = User.realName
		editToolButton.visible = false
		fullnameLabel.visible = false
		usernameLabel.visible = false
		userEmailLabel.visible = false
		saveProfileButton.visible = true
		fullnameTextField.visible = true
		usernameTextField.visible = true
		userEmailTextField.visible = true
	}
	saveProfileButton.onClicked: {
		User.emailAddress = userEmailTextField.text
		User.name = usernameTextField.text
		User.realName = fullnameTextField.text
		fullnameLabel.text = User.realName
		usernameLabel.text = User.name
		userEmailLabel.text = User.emailAddress
		saveProfileButton.visible = false
		fullnameTextField.visible = false
		usernameTextField.visible = false
		userEmailTextField.visible = false
		editToolButton.visible = true
		fullnameLabel.visible = true
		usernameLabel.visible = true
		userEmailLabel.visible = true
	}
	fullnameLabel.text: User.realName
	usernameLabel.text: User.name
	userEmailLabel.text: User.emailAddress
}