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