2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
//import QtQuick.Layouts 1.13
|
|
|
|
//import Qt.labs.platform 1.1
|
2020-05-27 20:50:39 +00:00
|
|
|
import "../../../imports"
|
|
|
|
import "../../../shared"
|
2020-06-04 20:56:44 +00:00
|
|
|
import "./components"
|
2020-05-27 20:50:39 +00:00
|
|
|
|
2020-06-26 16:08:51 +00:00
|
|
|
ModalPopup {
|
|
|
|
id: popup
|
|
|
|
|
|
|
|
title: qsTr("Send")
|
|
|
|
|
|
|
|
onOpened: {
|
|
|
|
sendModalContent.amountInput.text = ""
|
|
|
|
sendModalContent.amountInput.forceActiveFocus(Qt.MouseFocusReason)
|
2020-06-02 20:10:48 +00:00
|
|
|
sendModalContent.defaultAccount = walletModel.getDefaultAccount()
|
2020-06-26 19:43:20 +00:00
|
|
|
const accounts = walletModel.accounts
|
|
|
|
const numAccounts = accounts.rowCount()
|
|
|
|
const accountsData = []
|
|
|
|
for (let i = 0; i < numAccounts; i++) {
|
|
|
|
accountsData.push({
|
|
|
|
name: accounts.rowData(i, 'name'),
|
|
|
|
address: accounts.rowData(i, 'address'),
|
|
|
|
iconColor: accounts.rowData(i, 'iconColor')
|
|
|
|
})
|
|
|
|
}
|
|
|
|
sendModalContent.accounts = accountsData
|
2020-05-27 20:50:39 +00:00
|
|
|
}
|
|
|
|
|
2020-06-26 16:08:51 +00:00
|
|
|
SendModalContent {
|
|
|
|
id: sendModalContent
|
2020-06-29 14:33:21 +00:00
|
|
|
accounts: []
|
2020-05-27 20:50:39 +00:00
|
|
|
}
|
|
|
|
|
2020-06-26 16:08:51 +00:00
|
|
|
footer: StyledButton {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Theme.padding
|
|
|
|
label: qsTr("Send")
|
|
|
|
|
|
|
|
onClicked: {
|
2020-06-26 20:15:48 +00:00
|
|
|
if (!sendModalContent.validate()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-06-26 20:02:05 +00:00
|
|
|
let result = walletModel.onSendTransaction(sendModalContent.selectedAccountAddress,
|
2020-06-26 16:08:51 +00:00
|
|
|
sendModalContent.toText,
|
|
|
|
sendModalContent.amountText,
|
|
|
|
sendModalContent.passwordText)
|
|
|
|
console.log(result)
|
2020-05-27 20:50:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;autoSize:true;height:480;width:640}
|
|
|
|
}
|
|
|
|
##^##*/
|
2020-05-29 15:43:37 +00:00
|
|
|
|