2020-03-09 02:25:00 +03:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtQuick.Controls 2.10
|
|
|
|
import QtQuick.Window 2.2
|
|
|
|
|
2020-03-13 23:05:18 +03:00
|
|
|
import im.nheko 1.0
|
|
|
|
|
|
|
|
ApplicationWindow {
|
2020-09-14 14:57:49 +03:00
|
|
|
property var flow
|
|
|
|
property var tran_id
|
|
|
|
|
2020-03-09 02:25:00 +03:00
|
|
|
title: stack.currentItem.title
|
|
|
|
id: dialog
|
|
|
|
|
|
|
|
flags: Qt.Dialog
|
|
|
|
|
2020-03-13 23:05:18 +03:00
|
|
|
palette: colors
|
2020-03-09 02:25:00 +03:00
|
|
|
|
|
|
|
height: stack.implicitHeight
|
|
|
|
width: stack.implicitWidth
|
2020-09-14 14:57:49 +03:00
|
|
|
|
|
|
|
Component{
|
|
|
|
id: newVerificationRequest
|
|
|
|
NewVerificationRequest {}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component{
|
|
|
|
id: acceptNewVerificationRequest
|
|
|
|
AcceptNewVerificationRequest {}
|
|
|
|
}
|
|
|
|
|
2020-03-09 02:25:00 +03:00
|
|
|
StackView {
|
|
|
|
id: stack
|
2020-06-24 20:35:32 +03:00
|
|
|
initialItem: flow.sender == true?newVerificationRequest:acceptNewVerificationRequest
|
2020-03-09 02:25:00 +03:00
|
|
|
implicitWidth: currentItem.implicitWidth
|
|
|
|
implicitHeight: currentItem.implicitHeight
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
2020-09-14 14:57:49 +03:00
|
|
|
id: partnerAborted
|
|
|
|
PartnerAborted {}
|
2020-06-04 16:44:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
2020-09-14 14:57:49 +03:00
|
|
|
id: timedout
|
|
|
|
TimedOut {}
|
2020-03-09 02:25:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
2020-09-14 14:57:49 +03:00
|
|
|
id: verificationSuccess
|
|
|
|
VerificationSuccess {}
|
2020-03-09 02:25:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: digitVerification
|
2020-09-14 14:57:49 +03:00
|
|
|
DigitVerification {}
|
2020-03-09 02:25:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: emojiVerification
|
2020-09-14 14:57:49 +03:00
|
|
|
EmojiVerification {}
|
2020-03-09 02:25:00 +03:00
|
|
|
}
|
|
|
|
|
2020-09-14 14:57:49 +03:00
|
|
|
Connections {
|
|
|
|
target: flow
|
|
|
|
onVerificationCanceled: stack.replace(partnerAborted)
|
|
|
|
onTimedout: stack.replace(timedout)
|
|
|
|
onDeviceVerified: stack.replace(verificationSuccess)
|
2020-03-09 02:25:00 +03:00
|
|
|
|
2020-09-14 14:57:49 +03:00
|
|
|
onVerificationRequestAccepted: switch(method) {
|
|
|
|
case DeviceVerificationFlow.Decimal: stack.replace(digitVerification); break;
|
|
|
|
case DeviceVerificationFlow.Emoji: stack.replace(emojiVerification); break;
|
2020-03-09 02:25:00 +03:00
|
|
|
}
|
2020-03-13 23:05:18 +03:00
|
|
|
|
2020-09-14 14:57:49 +03:00
|
|
|
onRefreshProfile: {
|
|
|
|
deviceVerificationList.updateProfile(flow.userId);
|
2020-03-13 23:05:18 +03:00
|
|
|
}
|
|
|
|
}
|
2020-03-09 02:25:00 +03:00
|
|
|
}
|