~nicohman/signal-rs

ref: 5084c926fb753fdc6dda5f3cc2c8af2df5f1190b signal-rs/qml/contacts/EditContact.qml -rw-r--r-- 1.6 KiB
5084c926 — nicohman Make SignalUI a singleton and add application icon 4 months ago
                                                                                
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.15
import org.kde.kirigami 2.13 as Kirigami
import SignalUI 0.1

Kirigami.Page {
	id: editContact
	title: qsTr("Edit Contact")
	property string contactName: ""
	property string contactTel: ""
	property string currentTel: ""
	property string uuid: ""
	Component.onCompleted: {
		editContact.contactTel = signalState.currentTel;
		editContact.uuid = signalState.current;
        editContact.currentTel = signalState.currentTel;
        editContact.contactName = signalState.currentName;
	}
	ColumnLayout {
		anchors.left: parent.left
		anchors.right: parent.right
		Layout.fillWidth: true
		Layout.fillHeight: true
		Row {
			Layout.alignment: Qt.AlignHCenter | Qt.AlignTop	
			Avatar {
				width: 100
				height: 100
				tel: signalState.current
				editable: true
			}
		}
		Row {
			Layout.alignment: Qt.AlignHCenter | Qt.AlignTop	
			Label {
				text: "Contact Name"
			}
		}
		Row {
			Layout.alignment: Qt.AlignHCenter | Qt.AlignTop	
			TextField {
				id: editContactName
				text: contactName
			}	
		}
		Row {
			Layout.alignment: Qt.AlignHCenter | Qt.AlignTop	
			Label {
				text: "Contact Phone"
			}
		}
		Row {
			Layout.alignment: Qt.AlignHCenter | Qt.AlignTop	
			TextField {
				id: editContactTel
				text: contactTel
			}
		}
		Row {
			Layout.alignment: Qt.AlignHCenter | Qt.AlignTop	
			Button {
				text: "Save changes"
				onClicked: {
					console.log("Sending edit contact");
					SignalUI.edit_contact(editContactName.text, editContactTel.text, editContact.uuid)
					window.pageStack.layers.pop();
				}
			}
		}
	}

}