| 1 |
// SPDX-FileCopyrightText: Nheko Contributors |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: GPL-3.0-or-later |
| 4 |
|
| 5 |
import QtQuick 2.3 |
| 6 |
import QtQuick.Controls 2.3 |
| 7 |
import QtQuick.Layouts 1.10 |
| 8 |
import im.nheko 1.0 |
| 9 |
|
| 10 |
ColumnLayout { |
| 11 |
property string title: qsTr("Verification failed") |
| 12 |
spacing: 16 |
| 13 |
|
| 14 |
Text { |
| 15 |
id: content |
| 16 |
|
| 17 |
Layout.preferredWidth: 400 |
| 18 |
Layout.fillWidth: true |
| 19 |
wrapMode: Text.Wrap |
| 20 |
text: { |
| 21 |
switch (flow.error) { |
| 22 |
case DeviceVerificationFlow.UnknownMethod: |
| 23 |
return qsTr("Other client does not support our verification protocol."); |
| 24 |
case DeviceVerificationFlow.MismatchedCommitment: |
| 25 |
case DeviceVerificationFlow.MismatchedSAS: |
| 26 |
case DeviceVerificationFlow.KeyMismatch: |
| 27 |
return qsTr("Key mismatch detected!"); |
| 28 |
case DeviceVerificationFlow.Timeout: |
| 29 |
return qsTr("Device verification timed out."); |
| 30 |
case DeviceVerificationFlow.User: |
| 31 |
return qsTr("Other party canceled the verification."); |
| 32 |
case DeviceVerificationFlow.AcceptedOnOtherDevice: |
| 33 |
return qsTr("The verification was accepted by a different device."); |
| 34 |
case DeviceVerificationFlow.OutOfOrder: |
| 35 |
return qsTr("Verification messages received out of order!"); |
| 36 |
default: |
| 37 |
return qsTr("Unknown verification error."); |
| 38 |
} |
| 39 |
} |
| 40 |
color: palette.text |
| 41 |
verticalAlignment: Text.AlignVCenter |
| 42 |
} |
| 43 |
|
| 44 |
Item { Layout.fillHeight: true; } |
| 45 |
|
| 46 |
RowLayout { |
| 47 |
Item { |
| 48 |
Layout.fillWidth: true |
| 49 |
} |
| 50 |
|
| 51 |
Button { |
| 52 |
Layout.alignment: Qt.AlignRight |
| 53 |
text: qsTr("Close") |
| 54 |
onClicked: dialog.close() |
| 55 |
} |
| 56 |
|
| 57 |
} |
| 58 |
|
| 59 |
} |