summary refs log tree commit diff
path: root/resources/qml/device-verification/Failed.qml
blob: 5e44fc6e9823b802421d859e03e171f8f6a25978 (plain) (blame)
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
import QtQuick 2.3
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.10
import im.nheko 1.0

Pane {
    property string title: qsTr("Verification failed")

    ColumnLayout {
        spacing: 16

        Text {
            id: content

            Layout.maximumWidth: 400
            Layout.fillHeight: true
            Layout.fillWidth: true
            wrapMode: Text.Wrap
            text: {
                switch (flow.error) {
                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.";
                }
            }
            color: colors.text
            verticalAlignment: Text.AlignVCenter
        }

        RowLayout {
            Item {
                Layout.fillWidth: true
            }

            Button {
                Layout.alignment: Qt.AlignRight
                text: qsTr("Close")
                onClicked: dialog.close()
            }

        }

    }

}