forked from mirror/nheko
parent
517a126a44
commit
1a029112d9
@ -1,39 +1,46 @@ |
||||
import QtQuick 2.3 |
||||
import QtQuick.Controls 2.10 |
||||
import QtQuick.Layouts 1.10 |
||||
|
||||
import im.nheko 1.0 |
||||
|
||||
Pane { |
||||
property string title: qsTr("Awaiting Confirmation") |
||||
|
||||
ColumnLayout { |
||||
spacing: 16 |
||||
|
||||
Label { |
||||
id: content |
||||
|
||||
Layout.maximumWidth: 400 |
||||
Layout.fillHeight: true |
||||
Layout.fillWidth: true |
||||
wrapMode: Text.Wrap |
||||
id: content |
||||
text: qsTr("Waiting for other side to complete verification.") |
||||
color:colors.text |
||||
color: colors.text |
||||
verticalAlignment: Text.AlignVCenter |
||||
} |
||||
|
||||
BusyIndicator { |
||||
Layout.alignment: Qt.AlignHCenter |
||||
} |
||||
|
||||
RowLayout { |
||||
Button { |
||||
Layout.alignment: Qt.AlignLeft |
||||
text: qsTr("Cancel") |
||||
|
||||
onClicked: { |
||||
flow.cancel(); |
||||
dialog.close(); |
||||
} |
||||
} |
||||
|
||||
Item { |
||||
Layout.fillWidth: true |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
@ -1,97 +1,144 @@ |
||||
import QtQuick 2.10 |
||||
import QtQuick.Controls 2.10 |
||||
import QtQuick.Window 2.10 |
||||
|
||||
import im.nheko 1.0 |
||||
|
||||
ApplicationWindow { |
||||
id: dialog |
||||
|
||||
property var flow |
||||
|
||||
onClosing: TimelineManager.removeVerificationFlow(flow) |
||||
|
||||
title: stack.currentItem.title |
||||
id: dialog |
||||
|
||||
flags: Qt.Dialog |
||||
|
||||
palette: colors |
||||
|
||||
height: stack.implicitHeight |
||||
width: stack.implicitWidth |
||||
|
||||
StackView { |
||||
id: stack |
||||
|
||||
initialItem: newVerificationRequest |
||||
implicitWidth: currentItem.implicitWidth |
||||
implicitHeight: currentItem.implicitHeight |
||||
} |
||||
|
||||
Component{ |
||||
Component { |
||||
id: newVerificationRequest |
||||
NewVerificationRequest {} |
||||
|
||||
NewVerificationRequest { |
||||
} |
||||
|
||||
} |
||||
|
||||
Component { |
||||
id: waiting |
||||
Waiting {} |
||||
|
||||
Waiting { |
||||
} |
||||
|
||||
} |
||||
|
||||
Component { |
||||
id: success |
||||
Success {} |
||||
|
||||
Success { |
||||
} |
||||
|
||||
} |
||||
|
||||
Component { |
||||
id: failed |
||||
Failed {} |
||||
|
||||
Failed { |
||||
} |
||||
|
||||
} |
||||
|
||||
Component { |
||||
id: digitVerification |
||||
DigitVerification {} |
||||
|
||||
DigitVerification { |
||||
} |
||||
|
||||
} |
||||
|
||||
Component { |
||||
id: emojiVerification |
||||
EmojiVerification {} |
||||
|
||||
EmojiVerification { |
||||
} |
||||
|
||||
} |
||||
|
||||
Item { |
||||
state: flow.state |
||||
|
||||
states: [ |
||||
State { |
||||
name: "PromptStartVerification" |
||||
StateChangeScript { script: stack.replace(newVerificationRequest) } |
||||
|
||||
StateChangeScript { |
||||
script: stack.replace(newVerificationRequest) |
||||
} |
||||
|
||||
}, |
||||
State { |
||||
name: "CompareEmoji" |
||||
StateChangeScript { script: stack.replace(emojiVerification) } |
||||
|
||||
StateChangeScript { |
||||
script: stack.replace(emojiVerification) |
||||
} |
||||
|
||||
}, |
||||
State { |
||||
name: "CompareNumber" |
||||
StateChangeScript { script: stack.replace(digitVerification) } |
||||
|
||||
StateChangeScript { |
||||
script: stack.replace(digitVerification) |
||||
} |
||||
|
||||
}, |
||||
State { |
||||
name: "WaitingForKeys" |
||||
StateChangeScript { script: stack.replace(waiting) } |
||||
|
||||
StateChangeScript { |
||||
script: stack.replace(waiting) |
||||
} |
||||
|
||||
}, |
||||
State { |
||||
name: "WaitingForOtherToAccept" |
||||
StateChangeScript { script: stack.replace(waiting) } |
||||
|
||||
StateChangeScript { |
||||
script: stack.replace(waiting) |
||||
} |
||||
|
||||
}, |
||||
State { |
||||
name: "WaitingForMac" |
||||
StateChangeScript { script: stack.replace(waiting) } |
||||
|
||||
StateChangeScript { |
||||
script: stack.replace(waiting) |
||||
} |
||||
|
||||
}, |
||||
State { |
||||
name: "Success" |
||||
StateChangeScript { script: stack.replace(success) } |
||||
|
||||
StateChangeScript { |
||||
script: stack.replace(success) |
||||
} |
||||
|
||||
}, |
||||
State { |
||||
name: "Failed" |
||||
StateChangeScript { script: stack.replace(failed); } |
||||
|
||||
StateChangeScript { |
||||
script: stack.replace(failed) |
||||
} |
||||
|
||||
} |
||||
] |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
@ -1,44 +1,56 @@ |
||||
import QtQuick 2.3 |
||||
import QtQuick.Controls 2.10 |
||||
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.") |
||||
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."; |
||||
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 |
||||
color: colors.text |
||||
verticalAlignment: Text.AlignVCenter |
||||
} |
||||
|
||||
RowLayout { |
||||
Item { |
||||
Layout.fillWidth: true |
||||
} |
||||
|
||||
Button { |
||||
Layout.alignment: Qt.AlignRight |
||||
text: qsTr("Close") |
||||
|
||||
onClicked: dialog.close() |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
@ -1,45 +1,56 @@ |
||||
import QtQuick 2.3 |
||||
import QtQuick.Controls 2.10 |
||||
import QtQuick.Layouts 1.10 |
||||
|
||||
import im.nheko 1.0 |
||||
|
||||
Pane { |
||||
property string title: qsTr("Waiting for other party") |
||||
|
||||
ColumnLayout { |
||||
spacing: 16 |
||||
|
||||
Label { |
||||
id: content |
||||
|
||||
Layout.maximumWidth: 400 |
||||
Layout.fillHeight: true |
||||
Layout.fillWidth: true |
||||
wrapMode: Text.Wrap |
||||
id: content |
||||
text: switch (flow.state) { |
||||
case "WaitingForOtherToAccept": return qsTr("Waiting for other side to accept the verification request.") |
||||
case "WaitingForKeys": return qsTr("Waiting for other side to continue the verification request.") |
||||
case "WaitingForMac": return qsTr("Waiting for other side to complete the verification request.") |
||||
text: { |
||||
switch (flow.state) { |
||||
case "WaitingForOtherToAccept": |
||||
return qsTr("Waiting for other side to accept the verification request."); |
||||
case "WaitingForKeys": |
||||
return qsTr("Waiting for other side to continue the verification request."); |
||||
case "WaitingForMac": |
||||
return qsTr("Waiting for other side to complete the verification request."); |
||||
} |
||||
} |
||||
|
||||
color: colors.text |
||||
verticalAlignment: Text.AlignVCenter |
||||
} |
||||
|
||||
BusyIndicator { |
||||
Layout.alignment: Qt.AlignHCenter |
||||
palette: colors |
||||
} |
||||
|
||||
RowLayout { |
||||
Button { |
||||
Layout.alignment: Qt.AlignLeft |
||||
text: qsTr("Cancel") |
||||
|
||||
onClicked: { |
||||
flow.cancel(); |
||||
dialog.close(); |
||||
} |
||||
} |
||||
|
||||
Item { |
||||
Layout.fillWidth: true |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
@ -1,17 +1,16 @@ |
||||
import "../" |
||||
import QtQuick 2.10 |
||||
import QtQuick.Controls 2.1 |
||||
import im.nheko 1.0 |
||||
import im.nheko.EmojiModel 1.0 |
||||
|
||||
import "../" |
||||
|
||||
ImageButton { |
||||
id: emojiButton |
||||
|
||||
property var colors: currentActivePalette |
||||
property var emojiPicker |
||||
property string event_id |
||||
|
||||
image: ":/icons/icons/ui/smile.png" |
||||
id: emojiButton |
||||
onClicked: emojiPicker.visible ? emojiPicker.close() : emojiPicker.show(emojiButton, event_id) |
||||
|
||||
} |
||||
|
Loading…
Reference in new issue