2020-08-25 18:44:29 +00:00
|
|
|
import QtQuick 2.3
|
2020-10-19 00:57:38 +00:00
|
|
|
import "../../ChatComponents"
|
2020-08-25 18:44:29 +00:00
|
|
|
import "../../../../../../shared"
|
|
|
|
import "../../../../../../imports"
|
|
|
|
|
|
|
|
Item {
|
2020-09-03 20:43:08 +00:00
|
|
|
property int state: Constants.addressRequested
|
|
|
|
|
2020-08-25 18:44:29 +00:00
|
|
|
width: parent.width
|
|
|
|
height: childrenRect.height
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: separator1
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: acceptText
|
|
|
|
color: Style.current.blue
|
2020-09-14 12:12:47 +00:00
|
|
|
//% "Accept and share address"
|
|
|
|
text: root.state === Constants.addressRequested ?
|
|
|
|
qsTrId("accept-and-share-address") :
|
|
|
|
//% "Accept and send"
|
|
|
|
qsTrId("accept-and-send")
|
2020-09-03 20:43:08 +00:00
|
|
|
padding: Style.current.halfPadding
|
2020-08-25 18:44:29 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.weight: Font.Medium
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: separator1.bottom
|
|
|
|
font.pixelSize: 15
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: {
|
2020-09-03 20:43:08 +00:00
|
|
|
if (root.state === Constants.addressRequested) {
|
2020-10-21 12:30:41 +00:00
|
|
|
selectAccountModal.open()
|
2020-09-03 20:43:08 +00:00
|
|
|
} else if (root.state === Constants.transactionRequested) {
|
2020-10-19 00:57:38 +00:00
|
|
|
signTransactionModal.open()
|
2020-09-03 20:43:08 +00:00
|
|
|
}
|
2020-08-25 18:44:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: separator2
|
|
|
|
anchors.topMargin: 0
|
|
|
|
anchors.top: acceptText.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: declineText
|
|
|
|
color: Style.current.blue
|
2020-09-14 12:12:47 +00:00
|
|
|
//% "Decline"
|
|
|
|
text: qsTrId("decline")
|
2020-08-25 18:44:29 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.weight: Font.Medium
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
2020-09-03 20:43:08 +00:00
|
|
|
padding: Style.current.halfPadding
|
2020-08-25 18:44:29 +00:00
|
|
|
anchors.top: separator2.bottom
|
|
|
|
font.pixelSize: 15
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: {
|
2020-09-03 20:43:08 +00:00
|
|
|
if (root.state === Constants.addressRequested) {
|
|
|
|
chatsModel.declineRequestAddressForTransaction(messageId)
|
|
|
|
} else if (root.state === Constants.transactionRequested) {
|
|
|
|
chatsModel.declineRequestTransaction(messageId)
|
|
|
|
}
|
|
|
|
|
2020-08-25 18:44:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-10-19 00:57:38 +00:00
|
|
|
|
|
|
|
SignTransactionModal {
|
|
|
|
id: signTransactionModal
|
|
|
|
onOpened: {
|
|
|
|
walletModel.getGasPricePredictions()
|
|
|
|
}
|
|
|
|
selectedAccount: {}
|
|
|
|
selectedRecipient: {
|
|
|
|
return {
|
|
|
|
address: commandParametersObject.address,
|
|
|
|
identicon: chatsModel.activeChannel.identicon,
|
|
|
|
name: chatsModel.activeChannel.name,
|
|
|
|
type: RecipientSelector.Type.Contact
|
|
|
|
}
|
|
|
|
}
|
|
|
|
selectedAsset: token
|
|
|
|
selectedAmount: tokenAmount
|
|
|
|
selectedFiatAmount: fiatValue
|
|
|
|
//outgoing: root.outgoing
|
|
|
|
}
|
2020-10-21 12:30:41 +00:00
|
|
|
|
|
|
|
SelectAccountModal {
|
|
|
|
id: selectAccountModal
|
|
|
|
onSelectAndShareAddressButtonClicked: {
|
|
|
|
chatsModel.acceptRequestAddressForTransaction(messageId, accountSelector.selectedAccount)
|
|
|
|
selectAccountModal.close()
|
|
|
|
}
|
|
|
|
}
|
2020-08-25 18:44:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorColor:"#ffffff";formeditorZoom:1.25}
|
|
|
|
}
|
|
|
|
##^##*/
|