2024-02-20 18:52:07 +00:00
import QtQuick 2.15
import QtQuick . Controls 2.15
import QtQuick . Layouts 1.15
import QtQml . Models 2.15
2021-10-21 15:07:13 +00:00
2024-02-20 18:52:07 +00:00
import StatusQ . Core 0.1
import StatusQ . Core . Theme 0.1
2021-10-21 15:07:13 +00:00
import StatusQ . Controls 0.1
2024-02-20 18:52:07 +00:00
import utils 1.0
2020-08-10 11:56:16 +00:00
2024-02-20 18:52:07 +00:00
CommonContactDialog {
id: root
2020-10-02 13:02:56 +00:00
2024-02-20 18:52:07 +00:00
readonly property bool removeIDVerification: ctrlRemoveIDVerification . checked
readonly property bool removeContact: ctrlRemoveContact . checked
2022-02-09 09:43:23 +00:00
2024-02-20 18:52:07 +00:00
title: qsTr ( "Block user" )
2022-02-09 09:43:23 +00:00
2024-02-20 18:52:07 +00:00
readonly property var d: QtObject {
id: d
2024-02-26 18:54:05 +00:00
readonly property bool isTrusted: contactDetails . outgoingVerificationStatus === Constants . verificationStatus . trusted ||
contactDetails . incomingVerificationStatus === Constants . verificationStatus . trusted
2024-02-20 18:52:07 +00:00
}
2020-08-10 11:56:16 +00:00
2024-02-20 18:52:07 +00:00
StatusBaseText {
2024-07-18 10:57:24 +00:00
objectName: "youWillNotSeeText"
2024-02-20 18:52:07 +00:00
Layout.fillWidth: true
2020-08-10 11:56:16 +00:00
wrapMode: Text . WordWrap
2024-02-20 18:52:07 +00:00
lineHeight: 22
lineHeightMode: Text . FixedHeight
text: qsTr ( "You will not see %1’ s messages but %1 can still see your messages in mutual group chats and communities. %1 will be unable to message you." ) . arg ( mainDisplayName )
2020-08-10 11:56:16 +00:00
}
2024-02-20 18:52:07 +00:00
StatusWarningBox {
2024-07-18 10:57:24 +00:00
objectName: "blockWarningBox"
2024-02-20 18:52:07 +00:00
Layout.fillWidth: true
Layout.topMargin: Style . current . padding
icon: "warning"
iconColor: Theme . palette . dangerColor1
bgColor: Theme . palette . dangerColor1
borderColor: Theme . palette . dangerColor2
textColor: Theme . palette . directColor1
textSize: Theme . secondaryTextFontSize
text: qsTr ( "Blocking a user purges the database of all messages that you’ ve previously received from %1 in all contexts. This can take a moment." ) . arg ( mainDisplayName )
}
2020-08-10 11:56:16 +00:00
2024-02-20 18:52:07 +00:00
StatusCheckBox {
Layout.topMargin: Style . current . halfPadding
2024-07-18 10:57:24 +00:00
objectName: "removeContactCheckbox"
2024-02-20 18:52:07 +00:00
id: ctrlRemoveContact
visible: contactDetails . isContact
checked: visible
enabled: false
text: qsTr ( "Remove contact" )
}
StatusCheckBox {
id: ctrlRemoveIDVerification
2024-02-26 18:54:05 +00:00
visible: ( contactDetails . isContact && d . isTrusted ) || contactDetails . trustStatus === Constants . trustStatus . trusted
2024-02-20 18:52:07 +00:00
checked: visible
enabled: false
text: qsTr ( "Remove ID verification" )
}
rightButtons: ObjectModel {
StatusFlatButton {
2024-07-18 10:57:24 +00:00
objectName: "cancelButton"
2024-02-20 18:52:07 +00:00
text: qsTr ( "Cancel" )
onClicked: root . close ( )
}
2021-01-28 11:04:10 +00:00
StatusButton {
2024-07-18 10:57:24 +00:00
objectName: "blockButton"
2021-10-21 15:07:13 +00:00
type: StatusBaseButton . Type . Danger
2024-02-20 18:52:07 +00:00
text: qsTr ( "Block" )
onClicked: root . accepted ( )
2020-08-10 11:56:16 +00:00
}
}
}