Newer
Older
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.3
import QtQuick.Dialogs 1.2
import im.nheko 1.0
ApplicationWindow {
id: roomSettingsDialog
property var roomSettings
x: MainWindow.x + (MainWindow.width / 2) - (width / 2)
y: MainWindow.y + (MainWindow.height / 2) - (height / 2)
height: 600
width: 420
minimumHeight: 420
palette: colors
color: colors.window
Jedi18
committed
title: roomSettings.roomName
modality: Qt.WindowModal
flags: Qt.WindowStaysOnTopHint
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
74
75
76
77
78
79
Shortcut {
sequence: StandardKey.Cancel
onActivated: roomSettingsDialog.close()
}
ColumnLayout {
id: contentLayout
anchors.fill: parent
anchors.margins: 10
spacing: 10
Avatar {
url: ""
height: 130
width: 130
displayName: ""
userid: ""
Layout.alignment: Qt.AlignHCenter
}
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
MatrixText {
text: "room name"
font.pixelSize: 24
Layout.alignment: Qt.AlignHCenter
}
MatrixText {
text: "1 member"
Layout.alignment: Qt.AlignHCenter
}
}
ImageButton {
Layout.alignment: Qt.AlignHCenter
image: ":/icons/icons/ui/edit.png"
}
MatrixText {
text: "SETTINGS"
}
RowLayout {
MatrixText {
text: "Notifications"
}
Item {
Layout.fillWidth: true
}
ComboBox {
model: [ "Muted", "Mentions only", "All messages" ]
currentIndex: roomSettings.notifications
onActivated: {
roomSettings.changeNotifications(index)
}
}
}
RowLayout {
MatrixText {
text: "Room access"
}
ComboBox {
Layout.fillWidth: true
enabled: roomSettings.canChangeJoinRules
model: [ "Anyone and guests", "Anyone", "Invited users" ]
currentIndex: roomSettings.accessJoinRules
onActivated: {
roomSettings.changeAccessRules(index)
}
}
}
RowLayout {
MatrixText {
text: "Encryption"
}
Item {
Layout.fillWidth: true
}
Switch {
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
id: encryptionSwitch
checked: roomSettings.isEncryptionEnabled
onToggled: {
if(roomSettings.isEncryptionEnabled) {
checked=true;
return;
}
confirmEncryptionDialog.open();
}
}
MessageDialog {
id: confirmEncryptionDialog
title: qsTr("End-to-End Encryption")
text: qsTr("Encryption is currently experimental and things might break unexpectedly. <br>
Please take note that it can't be disabled afterwards.")
modality: Qt.WindowModal
icon: StandardIcon.Question
onAccepted: {
if(roomSettings.isEncryptionEnabled) {
return;
}
roomSettings.enableEncryption();
}
onRejected: {
encryptionSwitch.checked = false
}
standardButtons: Dialog.Ok | Dialog.Cancel
visible: roomSettings.isEncryptionEnabled
MatrixText {
text: "Respond to key requests"
}
Item {
Layout.fillWidth: true
}
Switch {
ToolTip.text: qsTr("Whether or not the client should respond automatically with the session keys
upon request. Use with caution, this is a temporary measure to test the
E2E implementation until device verification is completed.")
checked: roomSettings.respondsToKeyRequests
onToggled: {
roomSettings.changeKeyRequestsPreference(checked)
}
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
}
}
MatrixText {
text: "INFO"
}
RowLayout {
MatrixText {
text: "Internal ID"
}
Item {
Layout.fillWidth: true
}
MatrixText {
text: "asdajdhasjkdhaskjdhasjdks"
font.pixelSize: 12
}
}
RowLayout {
MatrixText {
text: "Room Version"
}
Item {
Layout.fillWidth: true
}
MatrixText {
text: "6"
font.pixelSize: 12
}
}
Button {
Layout.alignment: Qt.AlignRight
text: "Ok"
}
}
}