Add encryption check box to FindSomeone page

This commit is contained in:
miruka 2019-11-09 14:57:46 -04:00
parent 793024434f
commit 72c480471a
3 changed files with 22 additions and 11 deletions

View File

@ -103,17 +103,8 @@ HBox {
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
} }
HCheckBox { EncryptCheckBox {
id: encryptCheckBox id: encryptCheckBox
text: qsTr("Encrypt messages")
subtitle.text:
qsTr("Protect the room against eavesdropper. Only you " +
"and those you trust can read the conversation.") +
"<br><font color='" + theme.colors.middleBackground + "'>" +
qsTr("Cannot be disabled later!") +
"</font>"
subtitle.textFormat: Text.StyledText
spacing: addChatBox.horizontalSpacing
Layout.maximumWidth: parent.width Layout.maximumWidth: parent.width
} }

View File

@ -0,0 +1,14 @@
import QtQuick 2.12
import "../../Base"
HCheckBox {
text: qsTr("Encrypt messages")
subtitle.text:
qsTr("Protect the room against eavesdropper. Only you " +
"and those you trust can read the conversation.") +
"<br><font color='" + theme.colors.middleBackground + "'>" +
qsTr("Cannot be disabled later!") +
"</font>"
subtitle.textFormat: Text.StyledText
spacing: addChatBox.horizontalSpacing
}

View File

@ -20,7 +20,7 @@ HBox {
button.loading = true button.loading = true
errorMessage.text = "" errorMessage.text = ""
let args = [userField.text] let args = [userField.text, encryptCheckBox.checked]
py.callClientCoro(userId, "new_direct_chat", args, roomId => { py.callClientCoro(userId, "new_direct_chat", args, roomId => {
button.loading = false button.loading = false
@ -61,6 +61,12 @@ HBox {
Layout.fillWidth: true Layout.fillWidth: true
} }
EncryptCheckBox {
id: encryptCheckBox
Layout.maximumWidth: parent.width
}
HLabel { HLabel {
id: errorMessage id: errorMessage
wrapMode: Text.Wrap wrapMode: Text.Wrap