nheko/resources/qml/device-verification/Failed.qml

45 lines
1.2 KiB
QML
Raw Normal View History

2020-09-14 13:57:49 +02:00
import QtQuick 2.3
import QtQuick.Controls 2.10
import QtQuick.Layouts 1.10
2020-10-05 22:58:07 +02:00
import im.nheko 1.0
2020-09-14 13:57:49 +02:00
Pane {
2020-10-05 22:58:07 +02:00
property string title: qsTr("Verification failed")
2020-09-14 13:57:49 +02:00
ColumnLayout {
spacing: 16
Text {
2020-10-05 22:58:07 +02:00
id: content
2020-09-14 13:57:49 +02:00
Layout.maximumWidth: 400
Layout.fillHeight: true
Layout.fillWidth: true
2020-10-05 22:58:07 +02:00
2020-09-14 13:57:49 +02:00
wrapMode: Text.Wrap
text: switch (flow.error) {
2020-10-05 22:58:07 +02:00
case DeviceVerificationFlow.UnknownMethod: return qsTr("Other client does not support our verification protocol.")
case DeviceVerificationFlow.MismatchedCommitment:
case DeviceVerificationFlow.MismatchedSAS:
case DeviceVerificationFlow.KeyMismatch: return qsTr("Key mismatch detected!")
case DeviceVerificationFlow.Timeout: return qsTr("Device verification timed out.")
case DeviceVerificationFlow.User: return qsTr("Other party canceled the verification.")
case DeviceVerificationFlow.OutOfOrder: return qsTr("Device verification timed out.")
default: return "Unknown verification error.";
}
2020-09-14 13:57:49 +02:00
color:colors.text
verticalAlignment: Text.AlignVCenter
}
RowLayout {
Item {
Layout.fillWidth: true
}
Button {
Layout.alignment: Qt.AlignRight
text: qsTr("Close")
2020-10-02 17:33:04 +02:00
2020-10-05 22:58:07 +02:00
onClicked: dialog.close()
2020-09-14 13:57:49 +02:00
}
}
}
}