2014-08-12 12:02:33 +03:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQuick.Controls 1.0;
|
|
|
|
import QtQuick.Layouts 1.0;
|
|
|
|
import QtQuick.Dialogs 1.0;
|
|
|
|
import QtQuick.Window 2.1;
|
|
|
|
import QtQuick.Controls.Styles 1.1
|
|
|
|
import Ethereum 1.0
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
property var iconFile: "../tx.png"
|
|
|
|
property var title: "Transactions"
|
2014-08-17 22:07:09 +03:00
|
|
|
property var menuItem
|
2014-08-12 12:02:33 +03:00
|
|
|
|
|
|
|
|
|
|
|
id: historyView
|
2014-08-18 02:35:42 +03:00
|
|
|
visible: false
|
2014-08-12 12:02:33 +03:00
|
|
|
anchors.fill: parent
|
|
|
|
objectName: "transactionView"
|
|
|
|
|
2014-08-18 02:35:42 +03:00
|
|
|
property var txModel: ListModel {
|
|
|
|
id: txModel
|
|
|
|
}
|
2014-08-12 12:02:33 +03:00
|
|
|
TableView {
|
|
|
|
id: txTableView
|
|
|
|
anchors.fill: parent
|
|
|
|
TableViewColumn{ role: "inout" ; title: "" ; width: 40 }
|
|
|
|
TableViewColumn{ role: "value" ; title: "Value" ; width: 100 }
|
|
|
|
TableViewColumn{ role: "address" ; title: "Address" ; width: 430 }
|
|
|
|
TableViewColumn{ role: "contract" ; title: "Contract" ; width: 100 }
|
|
|
|
|
|
|
|
model: txModel
|
|
|
|
}
|
|
|
|
|
2014-08-14 01:18:37 +03:00
|
|
|
function addTx(tx, inout) {
|
2014-08-12 12:02:33 +03:00
|
|
|
var isContract
|
|
|
|
if (tx.contract == true){
|
|
|
|
isContract = "Yes"
|
|
|
|
}else{
|
|
|
|
isContract = "No"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var address;
|
|
|
|
if(inout == "recv") {
|
|
|
|
address = tx.sender;
|
|
|
|
} else {
|
|
|
|
address = tx.address;
|
|
|
|
}
|
|
|
|
|
|
|
|
txModel.insert(0, {inout: inout, hash: tx.hash, address: address, value: tx.value, contract: isContract})
|
|
|
|
}
|
|
|
|
}
|