diff options
| author | Sander Ferdinand <sa.ferdinand@gmail.com> | 2018-03-21 01:35:34 +0100 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-03-29 23:04:03 +0100 |
| commit | 70983136bccff61d7d72e0dd0e85cc27178f76d9 (patch) | |
| tree | 80aad964961352b8eef496c89831bb14e38159dd /components | |
| parent | 09935ba4b07e222fcc224110884976876e255baa (diff) | |
| download | monzero-gui-70983136bccff61d7d72e0dd0e85cc27178f76d9.tar.gz monzero-gui-70983136bccff61d7d72e0dd0e85cc27178f76d9.tar.xz monzero-gui-70983136bccff61d7d72e0dd0e85cc27178f76d9.zip | |
Generate proof from history view and made javascript file with tx related functions
Diffstat (limited to 'components')
| -rw-r--r-- | components/HistoryTable.qml | 72 |
1 files changed, 59 insertions, 13 deletions
diff --git a/components/HistoryTable.qml b/components/HistoryTable.qml index c083ef3c..b7a32d41 100644 --- a/components/HistoryTable.qml +++ b/components/HistoryTable.qml @@ -30,6 +30,7 @@ import QtQuick 2.0 import moneroComponents.Clipboard 1.0 import moneroComponents.AddressBookModel 1.0 import "../components" as MoneroComponents +import "../js/TxUtils.js" as TxUtils import "." 1.0 ListView { @@ -196,19 +197,17 @@ ListView { font.pixelSize: 18 * scaleRatio font.bold: true text: { - // hack, removes trailing zeros - var amount = (displayAmount * 1); + var amount = (displayAmount * 1); // * 1 removes trailing zeros // sometimes, displayAmount is 0 - no idea why. // in that case, we try to get the amount from // the `destinations` string. if(amount === 0){ - amount = destinations.split(" ")[0].split(":")[0]; + amount = TxUtils.destinationsToAmount(destinations); amount = (amount *1); } - // sometimes this destinations string also shows 0, - // at which point we run out of options. + // sometimes this destinations string also shows 0 at which point we run out of options. return amount + " XMR"; } color: isOut ? "white" : "#2eb358" @@ -251,18 +250,15 @@ ListView { font.pixelSize: 16 * scaleRatio text: { if(isOut){ - var _address = destinations.split(" ")[1]; - if(_address === undefined) return "" - - if(_address){ - address = _address; - var address_truncated = address.substring(0, 6) + "..." + address.substring(address.length-6); - return "To " + address_truncated; + address = TxUtils.destinationsToAddress(destinations); + if(address){ + var truncated = TxUtils.addressTruncate(address); + return "To " + truncated; } else { return "Unknown recipient"; } } - return "" + return ""; } MouseArea{ @@ -415,6 +411,56 @@ ListView { } Rectangle { + id: proofButton + visible: isOut + color: "#404040" + height: 24 * scaleRatio + width: 24 * scaleRatio + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.bottomMargin: 36 + radius: 20 * scaleRatio + + MouseArea { + id: proofButtonMouseArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: { + var address = TxUtils.destinationsToAddress(destinations); + if(address === undefined){ + console.log('getProof: Error fetching address') + return; + } + + var checked = (TxUtils.checkTxID(hash) && TxUtils.checkAddress(address, appWindow.persistentSettings.testnet)); + if(!checked){ + console.log('getProof: Error checking TxId and/or address'); + } + + console.log("getProof: Generate clicked: txid " + hash + ", address " + address); + root.getProofClicked(hash, address, ''); + } + + onEntered: { + proofButton.color = "#656565"; + } + + onExited: { + proofButton.color = "#404040"; + } + } + + Text { + color: Style.defaultFontColor + text: "P" + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + font.pixelSize: 14 * scaleRatio + } + } + + Rectangle { id: detailsButton color: "#404040" height: 24 * scaleRatio |
