From 5a1952f7ac5a8b3faed076494067ea638f2bd810 Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Wed, 25 Apr 2018 21:43:01 +0200
Subject: [PATCH 01/15] Reordered QR/Tracking sections on the receive page
---
pages/Receive.qml | 245 ++++++++++++++++++++++++++++------------------
1 file changed, 148 insertions(+), 97 deletions(-)
diff --git a/pages/Receive.qml b/pages/Receive.qml
index a67e2124..e1f73b77 100644
--- a/pages/Receive.qml
+++ b/pages/Receive.qml
@@ -73,7 +73,7 @@ Rectangle {
function update() {
if (!appWindow.currentWallet || !trackingEnabled.checked) {
- setTrackingLineText("-")
+ setTrackingLineText("")
return
}
if (appWindow.currentWallet.connected() == Wallet.ConnectionStatus_Disconnected) {
@@ -156,7 +156,7 @@ Rectangle {
property int labelWidth: 120 * scaleRatio
property int editWidth: 400 * scaleRatio
property int lineEditFontSize: 12 * scaleRatio
- property int qrCodeSize: 240 * scaleRatio
+ property int qrCodeSize: 220 * scaleRatio
ColumnLayout {
id: addressRow
@@ -252,6 +252,7 @@ Rectangle {
inputDialog.open()
}
}
+
StandardButton {
small: true
enabled: table.currentIndex > 0
@@ -269,76 +270,155 @@ Rectangle {
}
}
- ColumnLayout {
- id: amountRow
- Label {
- id: amountLabel
- text: qsTr("Amount") + translationManager.emptyString
- width: mainLayout.labelWidth
- }
+ GridLayout {
+ columns: (isMobile)? 1 : 2
+ Layout.fillWidth: true
+ columnSpacing: 32 * scaleRatio
-
- LineEdit {
- id: amountLine
- placeholderText: qsTr("Amount to receive") + translationManager.emptyString
- readOnly: false
- width: mainLayout.editWidth
+ ColumnLayout {
+ Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
- validator: DoubleValidator {
- bottom: 0.0
- top: 18446744.073709551615
- decimals: 12
- notation: DoubleValidator.StandardNotation
- locale: "C"
- }
- }
- }
+ spacing: 20 * scaleRatio
- ColumnLayout {
- id: trackingRow
- visible: !isAndroid && !isIOS
- Label {
- id: trackingLabel
- textFormat: Text.RichText
- text: "" +
- qsTr("Tracking") +
- " (" +
- qsTr("help") +
- ")" +
- translationManager.emptyString
- width: mainLayout.labelWidth
- onLinkActivated: {
- trackingHowToUseDialog.title = qsTr("Tracking payments") + translationManager.emptyString;
- trackingHowToUseDialog.text = qsTr(
- "This is a simple sales tracker:
" +
- "Let your customer scan that QR code to make a payment (if that customer has software which " +
- "supports QR code scanning).
" +
- "This page will automatically scan the blockchain and the tx pool " +
- "for incoming transactions using this QR code. If you input an amount, it will also check " +
- "that incoming transactions total up to that amount.
" +
- "It's up to you whether to accept unconfirmed transactions or not. It is likely they'll be " +
- "confirmed in short order, but there is still a possibility they might not, so for larger " +
- "values you may want to wait for one or more confirmation(s).
"
- )
- trackingHowToUseDialog.icon = StandardIcon.Information
- trackingHowToUseDialog.open()
+ LabelSubheader {
+ Layout.fillWidth: true
+ textFormat: Text.RichText
+ text: "" +
+ qsTr("QR Code") +
+ " " +
+ qsTr("Help") + "" +
+ translationManager.emptyString
+ onLinkActivated: {
+ trackingHowToUseDialog.title = qsTr("QR Code") + translationManager.emptyString;
+ trackingHowToUseDialog.text = qsTr(
+ "This QR code includes the address you selected above and" +
+ "the amount you entered below. Share it with others (right-click->Save) " +
+ "so they can more easily send you exact amounts.
"
+ )
+ trackingHowToUseDialog.icon = StandardIcon.Information
+ trackingHowToUseDialog.open()
+ }
+ }
+
+ ColumnLayout {
+ id: amountRow
+
+ Layout.fillWidth: true
+ Layout.minimumWidth: 200
+
+ LineEdit {
+ id: amountLine
+ Layout.fillWidth: true
+ labelText: qsTr("Amount") + translationManager.emptyString
+ placeholderText: qsTr("Amount to receive") + translationManager.emptyString
+ fontBold: true
+ inlineIcon: true
+ validator: DoubleValidator {
+ bottom: 0.0
+ top: 18446744.073709551615
+ decimals: 12
+ notation: DoubleValidator.StandardNotation
+ locale: "C"
+ }
+ }
+ }
+
+ Rectangle {
+ color: "white"
+ Layout.topMargin: parent.spacing
+ Layout.fillWidth: true
+ Layout.maximumWidth: mainLayout.qrCodeSize
+ Layout.preferredHeight: width
+ radius: 4
+
+ Image {
+ id: qrCode
+ anchors.fill: parent
+ anchors.margins: 6
+
+ smooth: false
+ fillMode: Image.PreserveAspectFit
+ source: "image://qrcode/" + makeQRCodeString()
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.RightButton
+ onClicked: {
+ if (mouse.button == Qt.RightButton)
+ qrMenu.open()
+ }
+ onPressAndHold: qrFileDialog.open()
+ }
+ }
+
+ Menu {
+ id: qrMenu
+ title: "QrCode"
+ y: parent.height / 2
+
+ MenuItem {
+ text: qsTr("Save As") + translationManager.emptyString;
+ onTriggered: qrFileDialog.open()
+ }
+ }
}
}
- CheckBox {
- id: trackingEnabled
- text: qsTr("Enable") + translationManager.emptyString
- }
-
- TextEdit {
- id: trackingLine
- readOnly: true
- width: mainLayout.editWidth
+ ColumnLayout {
+ id: trackingRow
+ Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
- textFormat: Text.RichText
- text: ""
- selectByMouse: true
- color: 'white'
+ spacing: 32 * scaleRatio
+
+ LabelSubheader {
+ Layout.fillWidth: true
+ textFormat: Text.RichText
+ text: "" +
+ qsTr("Tracking") +
+ " " +
+ qsTr("Help") + "" +
+ translationManager.emptyString
+ onLinkActivated: {
+ trackingHowToUseDialog.title = qsTr("Tracking payments") + translationManager.emptyString;
+ trackingHowToUseDialog.text = qsTr(
+ "This is a simple sales tracker:
" +
+ "Let your customer scan that QR code to make a payment (if that customer has software which " +
+ "supports QR code scanning).
" +
+ "This page will automatically scan the blockchain and the tx pool " +
+ "for incoming transactions using this QR code. If you input an amount, it will also check " +
+ "that incoming transactions total up to that amount.
" +
+ "It's up to you whether to accept unconfirmed transactions or not. It is likely they'll be " +
+ "confirmed in short order, but there is still a possibility they might not, so for larger " +
+ "values you may want to wait for one or more confirmation(s)."
+ )
+ trackingHowToUseDialog.icon = StandardIcon.Information
+ trackingHowToUseDialog.open()
+ }
+ }
+
+ RowLayout {
+ Layout.fillWidth: true
+ Layout.minimumWidth: 200
+
+ CheckBox {
+ id: trackingEnabled
+ text: qsTr("Enable") + translationManager.emptyString
+ }
+ }
+
+ RowLayout {
+ Layout.fillWidth: true
+ Layout.minimumWidth: 200
+
+ TextEdit {
+ id: trackingLine
+ readOnly: true
+ Layout.fillWidth: true
+ textFormat: Text.RichText
+ text: ""
+ selectByMouse: true
+ color: 'white'
+ }
+ }
}
}
@@ -352,46 +432,17 @@ Rectangle {
title: "Please choose a name"
folder: shortcuts.pictures
selectExisting: false
- nameFilters: [ "Image (*.png)"]
+ nameFilters: ["Image (*.png)"]
onAccepted: {
- if( ! walletManager.saveQrCode(makeQRCodeString(), walletManager.urlToLocalPath(fileUrl))) {
+ if(!walletManager.saveQrCode(makeQRCodeString(), walletManager.urlToLocalPath(fileUrl))) {
console.log("Failed to save QrCode to file " + walletManager.urlToLocalPath(fileUrl) )
- trackingHowToUseDialog.title = qsTr("Save QrCode") + translationManager.emptyString;
+ trackingHowToUseDialog.title = qsTr("Save QrCode") + translationManager.emptyString;
trackingHowToUseDialog.text = qsTr("Failed to save QrCode to ") + walletManager.urlToLocalPath(fileUrl) + translationManager.emptyString;
trackingHowToUseDialog.icon = StandardIcon.Error
trackingHowToUseDialog.open()
}
}
}
- ColumnLayout {
- Menu {
- id: qrMenu
- title: "QrCode"
- MenuItem {
- text: qsTr("Save As") + translationManager.emptyString;
- onTriggered: qrFileDialog.open()
- }
- }
-
- Image {
- id: qrCode
- anchors.margins: 50 * scaleRatio
- Layout.fillWidth: true
- Layout.minimumHeight: mainLayout.qrCodeSize
- smooth: false
- fillMode: Image.PreserveAspectFit
- source: "image://qrcode/" + makeQRCodeString()
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.RightButton
- onClicked: {
- if (mouse.button == Qt.RightButton)
- qrMenu.popup()
- }
- onPressAndHold: qrFileDialog.open()
- }
- }
- }
}
Timer {
From 44ad8a3be12e1f6d31b1bfe013762557ce661b6f Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Fri, 27 Apr 2018 19:49:45 +0200
Subject: [PATCH 02/15] Redesigned the tracking section
---
components/Style.qml | 2 +-
pages/Receive.qml | 208 +++++++++++++++++++++++++++++++++----------
2 files changed, 162 insertions(+), 48 deletions(-)
diff --git a/components/Style.qml b/components/Style.qml
index 3b917f97..a2c6f9b7 100644
--- a/components/Style.qml
+++ b/components/Style.qml
@@ -25,5 +25,5 @@ QtObject {
property string buttonTextColor: "white"
property string buttonTextColorDisabled: "black"
property string dividerColor: "white"
- property real dividerOpacity: 0.25
+ property real dividerOpacity: 0.20
}
diff --git a/pages/Receive.qml b/pages/Receive.qml
index e1f73b77..bec96789 100644
--- a/pages/Receive.qml
+++ b/pages/Receive.qml
@@ -47,7 +47,6 @@ Rectangle {
property var model
property var current_address
property alias addressText : pageReceive.current_address
- property string trackingLineText: ""
function makeQRCodeString() {
var s = "monero:"
@@ -61,23 +60,13 @@ Rectangle {
return s
}
- function setTrackingLineText(text) {
- // don't replace with same text, it wrecks selection while the user is selecting
- // also keep track of text, because when we read back the text from the widget,
- // we do not get what we put it, but some extra HTML stuff on top
- if (text != trackingLineText) {
- trackingLine.text = text
- trackingLineText = text
- }
- }
-
function update() {
if (!appWindow.currentWallet || !trackingEnabled.checked) {
- setTrackingLineText("")
+ trackingLineText.text = "";
return
}
if (appWindow.currentWallet.connected() == Wallet.ConnectionStatus_Disconnected) {
- setTrackingLineText(qsTr("WARNING: no connection to daemon"))
+ trackingLineText.text = qsTr("WARNING: no connection to daemon");
return
}
@@ -85,8 +74,9 @@ Rectangle {
var count = model.rowCount()
var totalAmount = 0
var nTransactions = 0
- var list = []
var blockchainHeight = 0
+ var txs = []
+
for (var i = 0; i < count; ++i) {
var idx = model.index(i, 0)
var isout = model.data(idx, TransactionHistoryModel.TransactionIsOutRole);
@@ -99,45 +89,71 @@ Rectangle {
var txid = model.data(idx, TransactionHistoryModel.TransactionHashRole);
var blockHeight = model.data(idx, TransactionHistoryModel.TransactionBlockHeightRole);
+
+ var in_txpool = false;
+ var confirmations = 0;
+ var displayAmount = 0;
+
if (blockHeight == 0) {
- list.push(qsTr("in the txpool: %1").arg(txid) + translationManager.emptyString)
+ in_txpool = true;
} else {
if (blockchainHeight == 0)
blockchainHeight = walletManager.blockchainHeight()
- var confirmations = blockchainHeight - blockHeight - 1
- var displayAmount = model.data(idx, TransactionHistoryModel.TransactionDisplayAmountRole);
- if (confirmations > 1) {
- list.push(qsTr("%2 confirmations: %3 (%1)").arg(txid).arg(confirmations).arg(displayAmount) + translationManager.emptyString)
- } else {
- list.push(qsTr("1 confirmation: %2 (%1)").arg(txid).arg(displayAmount) + translationManager.emptyString)
- }
+ confirmations = blockchainHeight - blockHeight - 1
+ displayAmount = model.data(idx, TransactionHistoryModel.TransactionDisplayAmountRole);
}
+
+ txs.push({
+ "amount": displayAmount,
+ "confirmations": confirmations,
+ "blockheight": blockHeight,
+ "in_txpool": in_txpool,
+ "txid": txid
+ })
}
}
- // if there are too many txes, only show the first 3
- if (list.length > 3) {
- list.length = 3;
- list.push("...");
- }
+ // Update tracking status label
if (nTransactions == 0) {
- setTrackingLineText(qsTr("No transaction found yet...") + translationManager.emptyString)
+ trackingLineText.text = qsTr("No transaction found yet...") + translationManager.emptyString
return
}
+ else if(nTransactions === 1){
+ trackingLineText.text = qsTr("Transaction found") + translationManager.emptyString;
+ } else {
+ trackingLineText.text = qsTr("%1 transactions found").arg(nTransactions) + translationManager.emptyString
+ }
- var text = ((nTransactions == 1) ? qsTr("Transaction found") : qsTr("%1 transactions found").arg(nTransactions)) + translationManager.emptyString
+ var max_tracking = 3;
var expectedAmount = walletManager.amountFromString(amountLine.text)
if (expectedAmount && expectedAmount != amount) {
var displayTotalAmount = walletManager.displayAmount(totalAmount)
if (amount > expectedAmount) {
+
text += qsTr(" with more money (%1)").arg(displayTotalAmount) + translationManager.emptyString
} else if (amount < expectedAmount) {
text += qsTr(" with not enough money (%1)").arg(displayTotalAmount) + translationManager.emptyString
}
}
- setTrackingLineText(text + "
" + list.join("
"))
+ trackingModel.clear();
+
+ if (txs.length > 3) {
+ txs.length = 3;
+ }
+
+ txs.forEach(function(tx){
+ trackingModel.append({
+ "amount": tx.amount,
+ "confirmations": tx.confirmations,
+ "blockheight": tx.blockHeight,
+ "in_txpool": tx.in_txpool,
+ "txid": tx.txid
+ });
+ });
+
+ //setTrackingLineText(text + "
" + list.join("
"))
}
Clipboard { id: clipboard }
@@ -305,6 +321,7 @@ Rectangle {
Layout.fillWidth: true
Layout.minimumWidth: 200
+ Layout.maximumWidth: mainLayout.qrCodeSize
LineEdit {
id: amountLine
@@ -325,7 +342,7 @@ Rectangle {
Rectangle {
color: "white"
- Layout.topMargin: parent.spacing
+ Layout.topMargin: parent.spacing - 4
Layout.fillWidth: true
Layout.maximumWidth: mainLayout.qrCodeSize
Layout.preferredHeight: width
@@ -367,7 +384,7 @@ Rectangle {
id: trackingRow
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
- spacing: 32 * scaleRatio
+ spacing: 0 * scaleRatio
LabelSubheader {
Layout.fillWidth: true
@@ -395,7 +412,119 @@ Rectangle {
}
}
+ ListModel {
+ id: trackingModel
+ }
+
+ RowLayout{
+ Layout.topMargin: 14
+ Layout.bottomMargin: 10
+ visible: trackingTableRow.visible
+
+ Label {
+ id: trackingLineText
+ color: "white"
+ fontFamily: Style.fontLight.name
+ fontSize: 16 * scaleRatio
+ text: ""
+ }
+ }
+
+ ColumnLayout {
+ id: trackingTableRow
+ visible: vv.count >= 1
+ Layout.fillWidth: true
+ Layout.minimumWidth: 240
+ Layout.preferredHeight: 46 * vv.count
+
+ ListView {
+ id: vv
+ Layout.fillWidth: true
+ anchors.fill: parent
+ clip: true
+ boundsBehavior: ListView.StopAtBounds
+ model: trackingModel
+ delegate: Item {
+ id: trackingTableItem
+ height: 46
+ width: parent.width
+ Layout.fillWidth: true
+
+ Rectangle{
+ anchors.right: parent.right
+ anchors.left: parent.left
+ anchors.top: parent.top
+ height: 1
+ color: "#404040"
+ visible: index !== 0
+ }
+
+ Image {
+ id: arrowImage
+ source: "../images/upArrow-green.png"
+ height: 18 * scaleRatio
+ width: 12 * scaleRatio
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 12
+ }
+
+ Label {
+ id: trackingConfirmationLine
+ color: "white"
+ anchors.top: parent.top
+ anchors.topMargin: 6
+ anchors.left: arrowImage.right
+ anchors.leftMargin: 10
+ fontSize: 14 * scaleRatio
+ text: {
+ if(in_txpool){
+ return "Awaiting in txpool"
+ } else {
+ if(confirmations > 1){
+ if(confirmations > 100){
+ return "100+ " + qsTr("confirmations") + translationManager.emptyString;
+ } else {
+ return confirmations + " " + qsTr("confirmations") + translationManager.emptyString;
+ }
+ } else {
+ return "1 " + qsTr("confirmation") + translationManager.emptyString;
+ }
+ }
+ }
+ }
+
+ Label {
+ id: trackingAmountLine
+ color: "#2eb358"
+ anchors.top: trackingConfirmationLine.bottom
+ anchors.left: arrowImage.right
+ anchors.leftMargin: 10
+ fontSize: 14 * scaleRatio
+ fontBold: true
+ text: amount
+ }
+
+ IconButton {
+ id: clipboardButton
+ imageSource: "../images/copyToClipboard.png"
+
+ onClicked: {
+ console.log("tx_id copied to clipboard");
+ clipboard.setText(txid);
+ appWindow.showStatusMessage(qsTr("Transaction ID copied to clipboard"),3);
+ }
+
+ anchors.right: parent.right
+ anchors.rightMargin: 4
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+ }
+ }
+
RowLayout {
+ Layout.topMargin: 32 * scaleRatio
Layout.fillWidth: true
Layout.minimumWidth: 200
@@ -404,21 +533,6 @@ Rectangle {
text: qsTr("Enable") + translationManager.emptyString
}
}
-
- RowLayout {
- Layout.fillWidth: true
- Layout.minimumWidth: 200
-
- TextEdit {
- id: trackingLine
- readOnly: true
- Layout.fillWidth: true
- textFormat: Text.RichText
- text: ""
- selectByMouse: true
- color: 'white'
- }
- }
}
}
From cb94523747fe9cde85e90dd8b23210c32241394c Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Fri, 27 Apr 2018 23:22:09 +0200
Subject: [PATCH 03/15] This doesnt belong here
---
components/LabelButton.qml | 1 -
1 file changed, 1 deletion(-)
diff --git a/components/LabelButton.qml b/components/LabelButton.qml
index c2067117..532f4901 100644
--- a/components/LabelButton.qml
+++ b/components/LabelButton.qml
@@ -43,7 +43,6 @@ Rectangle {
width: labelButtonText.width + 14
anchors.right: copyButton.left
anchors.rightMargin: 6
- visible: isValidOpenAliasAddress(addressLine.text)
Text {
id: labelButtonText
From 6ff273fd3262e12c747765969da1a14129072e56 Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Fri, 27 Apr 2018 23:24:41 +0200
Subject: [PATCH 04/15] First iteration of the subaddress table restyle
---
pages/Receive.qml | 188 +++++++++++++++++++++++++++++-----------------
1 file changed, 118 insertions(+), 70 deletions(-)
diff --git a/pages/Receive.qml b/pages/Receive.qml
index bec96789..ff4d8d2c 100644
--- a/pages/Receive.qml
+++ b/pages/Receive.qml
@@ -40,12 +40,14 @@ import moneroComponents.TransactionHistory 1.0
import moneroComponents.TransactionHistoryModel 1.0
import moneroComponents.Subaddress 1.0
import moneroComponents.SubaddressModel 1.0
+import "../js/TxUtils.js" as TxUtils
Rectangle {
id: pageReceive
color: "transparent"
property var model
property var current_address
+ property var current_subaddress_table_index: 0
property alias addressText : pageReceive.current_address
function makeQRCodeString() {
@@ -82,7 +84,7 @@ Rectangle {
var isout = model.data(idx, TransactionHistoryModel.TransactionIsOutRole);
var subaddrAccount = model.data(idx, TransactionHistoryModel.TransactionSubaddrAccountRole);
var subaddrIndex = model.data(idx, TransactionHistoryModel.TransactionSubaddrIndexRole);
- if (!isout && subaddrAccount == appWindow.currentWallet.currentSubaddressAccount && subaddrIndex == table.currentIndex) {
+ if (!isout && subaddrAccount == appWindow.currentWallet.currentSubaddressAccount && subaddrIndex == current_subaddress_table_index) {
var amount = model.data(idx, TransactionHistoryModel.TransactionAtomicAmountRole);
totalAmount = walletManager.addi(totalAmount, amount)
nTransactions += 1
@@ -177,75 +179,120 @@ Rectangle {
ColumnLayout {
id: addressRow
spacing: 0
- Label {
- id: addressLabel
- text: qsTr("Addresses") + translationManager.emptyString
- width: mainLayout.labelWidth
- }
- Rectangle {
- id: header
+ LabelSubheader {
Layout.fillWidth: true
- Layout.topMargin: 10
- visible: table.count > 0
-
- height: 10
- color: "transparent"
-
- Rectangle {
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.rightMargin: 10
- anchors.leftMargin: 10
-
- height: 1
- color: "#404040"
- }
-
- Image {
- anchors.top: parent.top
- anchors.left: parent.left
-
- width: 10
- height: 10
-
- source: "../images/historyBorderRadius.png"
- }
-
- Image {
- anchors.top: parent.top
- anchors.right: parent.right
-
- width: 10
- height: 10
-
- source: "../images/historyBorderRadius.png"
- rotation: 90
+ textFormat: Text.RichText
+ text: "" +
+ qsTr("Addresses") +
+ " " +
+ qsTr("Help") + "" +
+ translationManager.emptyString
+ onLinkActivated: {
+ trackingHowToUseDialog.title = qsTr("Tracking payments") + translationManager.emptyString;
+ trackingHowToUseDialog.text = qsTr(
+ "This QR code includes the address you selected above and" +
+ "the amount you entered below. Share it with others (right-click->Save) " +
+ "so they can more easily send you exact amounts.
"
+ )
+ trackingHowToUseDialog.icon = StandardIcon.Information
+ trackingHowToUseDialog.open()
}
}
- Rectangle {
- id: tableRect
- property int table_max_height: 260
+ ColumnLayout {
+ id: trackingTableRow2
+ visible: subaddressListView.count >= 1
+ Layout.topMargin: 22 * scaleRatio
Layout.fillWidth: true
- Layout.preferredHeight: table.contentHeight < table_max_height ? table.contentHeight : table_max_height
- color: "transparent"
+ Layout.minimumWidth: 240
+ Layout.preferredHeight: 32 * subaddressListView.count
- Scroll {
- id: flickableScroll
- anchors.right: table.right
- anchors.top: table.top
- anchors.bottom: table.bottom
- flickable: table
- }
-
- SubaddressTable {
- id: table
+ ListView {
+ id: subaddressListView
+ Layout.fillWidth: true
anchors.fill: parent
- onContentYChanged: flickableScroll.flickableContentYChanged()
+ clip: true
+ boundsBehavior: ListView.StopAtBounds
+ delegate: Rectangle {
+ id: tableItem2
+ height: 32
+ width: parent.width
+ Layout.fillWidth: true
+ color: "transparent"
+
+ Rectangle{
+ anchors.right: parent.right
+ anchors.left: parent.left
+ anchors.top: parent.top
+ height: 1
+ color: "#404040"
+ visible: index !== 0
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ anchors.rightMargin: 80
+ color: "transparent"
+
+ Label {
+ id: idLabel
+ color: index === current_subaddress_table_index ? "white" : "#757575"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 6
+ fontSize: 14 * scaleRatio
+ fontBold: true
+ text: "#" + index
+ }
+
+ Label {
+ id: nameLabel
+ color: "#a5a5a5"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: idLabel.right
+ anchors.leftMargin: 6
+ fontSize: 14 * scaleRatio
+ fontBold: true
+ text: label
+ }
+
+ Label {
+ color: "white"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: nameLabel.right
+ anchors.leftMargin: 6
+ fontSize: 14 * scaleRatio
+ fontBold: true
+ text: TxUtils.addressTruncate(address)
+ }
+
+ MouseArea{
+ cursorShape: Qt.PointingHandCursor
+ anchors.fill: parent
+ hoverEnabled: true
+ onEntered: {
+ tableItem2.color = "#26FFFFFF"
+ }
+ onExited: {
+ tableItem2.color = "transparent"
+ }
+ onClicked: {
+ subaddressListView.currentIndex = index;
+ }
+ }
+ }
+ }
onCurrentItemChanged: {
- current_address = appWindow.currentWallet.address(appWindow.currentWallet.currentSubaddressAccount, table.currentIndex);
+ // reset global vars
+ current_subaddress_table_index = subaddressListView.currentIndex;
+ current_address = appWindow.currentWallet.address(
+ appWindow.currentWallet.currentSubaddressAccount,
+ subaddressListView.currentIndex
+ );
+
+ // reset tracking table
+ trackingModel.clear();
}
}
}
@@ -262,7 +309,7 @@ Rectangle {
inputDialog.inputText = qsTr("(Untitled)")
inputDialog.onAcceptedCallback = function() {
appWindow.currentWallet.subaddress.addRow(appWindow.currentWallet.currentSubaddressAccount, inputDialog.inputText)
- table.currentIndex = appWindow.currentWallet.numSubaddresses() - 1
+ current_subaddress_table_index = appWindow.currentWallet.numSubaddresses() - 1
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
@@ -271,13 +318,13 @@ Rectangle {
StandardButton {
small: true
- enabled: table.currentIndex > 0
+ enabled: current_subaddress_table_index > 0
text: qsTr("Rename") + translationManager.emptyString;
onClicked: {
inputDialog.labelText = qsTr("Set the label of the selected address:") + translationManager.emptyString
- inputDialog.inputText = appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, table.currentIndex)
+ inputDialog.inputText = appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, current_subaddress_table_index)
inputDialog.onAcceptedCallback = function() {
- appWindow.currentWallet.subaddress.setLabel(appWindow.currentWallet.currentSubaddressAccount, table.currentIndex, inputDialog.inputText)
+ appWindow.currentWallet.subaddress.setLabel(appWindow.currentWallet.currentSubaddressAccount, current_subaddress_table_index, inputDialog.inputText)
}
inputDialog.onRejectedCallback = null;
inputDialog.open()
@@ -432,13 +479,13 @@ Rectangle {
ColumnLayout {
id: trackingTableRow
- visible: vv.count >= 1
+ visible: trackingListView.count >= 1
Layout.fillWidth: true
Layout.minimumWidth: 240
- Layout.preferredHeight: 46 * vv.count
+ Layout.preferredHeight: 46 * trackingListView.count
ListView {
- id: vv
+ id: trackingListView
Layout.fillWidth: true
anchors.fill: parent
clip: true
@@ -567,12 +614,13 @@ Rectangle {
function onPageCompleted() {
console.log("Receive page loaded");
- table.model = currentWallet.subaddressModel;
+ subaddressListView.model = appWindow.currentWallet.subaddressModel;
if (appWindow.currentWallet) {
current_address = appWindow.currentWallet.address(appWindow.currentWallet.currentSubaddressAccount, 0)
appWindow.currentWallet.subaddress.refresh(appWindow.currentWallet.currentSubaddressAccount)
- table.currentIndex = 0
+ current_subaddress_table_index = 0;
+ subaddressListView.currentIndex = 0;
}
update()
From 0e49e4ad37657d7def61341f96d34eaae75ab60b Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Sat, 28 Apr 2018 00:37:09 +0200
Subject: [PATCH 05/15] Reimplemented create/edit/copy (sub)address icons and
buttons
---
pages/Receive.qml | 158 +++++++++++++++++++++++++++++++---------------
qml.qrc | 1 +
2 files changed, 109 insertions(+), 50 deletions(-)
diff --git a/pages/Receive.qml b/pages/Receive.qml
index ff4d8d2c..28cedd91 100644
--- a/pages/Receive.qml
+++ b/pages/Receive.qml
@@ -47,7 +47,7 @@ Rectangle {
color: "transparent"
property var model
property var current_address
- property var current_subaddress_table_index: 0
+ property int current_subaddress_table_index: 0
property alias addressText : pageReceive.current_address
function makeQRCodeString() {
@@ -158,6 +158,16 @@ Rectangle {
//setTrackingLineText(text + "
" + list.join("
"))
}
+ function renameSubaddressLabel(_index){
+ inputDialog.labelText = qsTr("Set the label of the selected address:") + translationManager.emptyString;
+ inputDialog.inputText = appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, _index);
+ inputDialog.onAcceptedCallback = function() {
+ appWindow.currentWallet.subaddress.setLabel(appWindow.currentWallet.currentSubaddressAccount, _index, inputDialog.inputText);
+ }
+ inputDialog.onRejectedCallback = null;
+ inputDialog.open()
+ }
+
Clipboard { id: clipboard }
/* main layout */
@@ -189,24 +199,25 @@ Rectangle {
qsTr("Help") + "" +
translationManager.emptyString
onLinkActivated: {
- trackingHowToUseDialog.title = qsTr("Tracking payments") + translationManager.emptyString;
- trackingHowToUseDialog.text = qsTr(
+ receivePageDialog.title = qsTr("Tracking payments") + translationManager.emptyString;
+ receivePageDialog.text = qsTr(
"This QR code includes the address you selected above and" +
"the amount you entered below. Share it with others (right-click->Save) " +
"so they can more easily send you exact amounts.
"
)
- trackingHowToUseDialog.icon = StandardIcon.Information
- trackingHowToUseDialog.open()
+ receivePageDialog.icon = StandardIcon.Information
+ receivePageDialog.open()
}
}
ColumnLayout {
- id: trackingTableRow2
- visible: subaddressListView.count >= 1
+ id: subaddressListRow
+ property int subaddressListItemHeight: 32 * scaleRatio
Layout.topMargin: 22 * scaleRatio
Layout.fillWidth: true
Layout.minimumWidth: 240
- Layout.preferredHeight: 32 * subaddressListView.count
+ Layout.preferredHeight: subaddressListItemHeight * subaddressListView.count
+ visible: subaddressListView.count >= 1
ListView {
id: subaddressListView
@@ -216,7 +227,7 @@ Rectangle {
boundsBehavior: ListView.StopAtBounds
delegate: Rectangle {
id: tableItem2
- height: 32
+ height: subaddressListRow.subaddressListItemHeight
width: parent.width
Layout.fillWidth: true
color: "transparent"
@@ -282,6 +293,34 @@ Rectangle {
}
}
}
+
+ IconButton {
+ id: renameButton
+ imageSource: "../images/editIcon.png"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: index !== 0 ? copyButton.left : parent.right
+ anchors.rightMargin: index !== 0 ? 0 : 6
+ anchors.top: undefined
+ visible: index !== 0
+
+ onClicked: {
+ renameSubaddressLabel(index);
+ }
+ }
+
+ IconButton {
+ id: copyButton
+ imageSource: "../images/copyToClipboard.png"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.top: undefined
+ anchors.right: parent.right
+
+ onClicked: {
+ console.log("Address copied to clipboard");
+ clipboard.setText(address);
+ appWindow.showStatusMessage(qsTr("Address copied to clipboard"),3);
+ }
+ }
}
onCurrentItemChanged: {
// reset global vars
@@ -297,37 +336,55 @@ Rectangle {
}
}
- RowLayout {
- spacing: 20
- Layout.topMargin: 20
+ // 'fake' row for 'create new address'
+ ColumnLayout{
+ id: createAddressRow
+ Layout.fillWidth: true
+ spacing: 0
- StandardButton {
- small: true
- text: qsTr("Create new address") + translationManager.emptyString;
- onClicked: {
- inputDialog.labelText = qsTr("Set the label of the new address:") + translationManager.emptyString
- inputDialog.inputText = qsTr("(Untitled)")
- inputDialog.onAcceptedCallback = function() {
- appWindow.currentWallet.subaddress.addRow(appWindow.currentWallet.currentSubaddressAccount, inputDialog.inputText)
- current_subaddress_table_index = appWindow.currentWallet.numSubaddresses() - 1
- }
- inputDialog.onRejectedCallback = null;
- inputDialog.open()
- }
+ Rectangle {
+ color: "#404040"
+ Layout.fillWidth: true
+ height: 1
}
- StandardButton {
- small: true
- enabled: current_subaddress_table_index > 0
- text: qsTr("Rename") + translationManager.emptyString;
- onClicked: {
- inputDialog.labelText = qsTr("Set the label of the selected address:") + translationManager.emptyString
- inputDialog.inputText = appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, current_subaddress_table_index)
- inputDialog.onAcceptedCallback = function() {
- appWindow.currentWallet.subaddress.setLabel(appWindow.currentWallet.currentSubaddressAccount, current_subaddress_table_index, inputDialog.inputText)
+ Rectangle{
+ id: createAddressRect
+ Layout.preferredHeight: subaddressListRow.subaddressListItemHeight
+ color: "transparent"
+ Layout.fillWidth: true
+
+ Label {
+ color: "#757575"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 6
+ fontSize: 14 * scaleRatio
+ fontBold: true
+ text: "+ " + qsTr("Create new address") + translationManager.emptyString;
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ cursorShape: Qt.PointingHandCursor
+
+ onEntered: {
+ createAddressRect.color = "#26FFFFFF"
+ }
+ onExited: {
+ createAddressRect.color = "transparent"
+ }
+ onClicked: {
+ inputDialog.labelText = qsTr("Set the label of the new address:") + translationManager.emptyString
+ inputDialog.inputText = qsTr("(Untitled)")
+ inputDialog.onAcceptedCallback = function() {
+ appWindow.currentWallet.subaddress.addRow(appWindow.currentWallet.currentSubaddressAccount, inputDialog.inputText)
+ current_subaddress_table_index = appWindow.currentWallet.numSubaddresses() - 1
+ }
+ inputDialog.onRejectedCallback = null;
+ inputDialog.open()
}
- inputDialog.onRejectedCallback = null;
- inputDialog.open()
}
}
}
@@ -352,14 +409,14 @@ Rectangle {
qsTr("Help") + "" +
translationManager.emptyString
onLinkActivated: {
- trackingHowToUseDialog.title = qsTr("QR Code") + translationManager.emptyString;
- trackingHowToUseDialog.text = qsTr(
+ receivePageDialog.title = qsTr("QR Code") + translationManager.emptyString;
+ receivePageDialog.text = qsTr(
"This QR code includes the address you selected above and" +
"the amount you entered below. Share it with others (right-click->Save) " +
"so they can more easily send you exact amounts.
"
)
- trackingHowToUseDialog.icon = StandardIcon.Information
- trackingHowToUseDialog.open()
+ receivePageDialog.icon = StandardIcon.Information
+ receivePageDialog.open()
}
}
@@ -442,8 +499,8 @@ Rectangle {
qsTr("Help") + "" +
translationManager.emptyString
onLinkActivated: {
- trackingHowToUseDialog.title = qsTr("Tracking payments") + translationManager.emptyString;
- trackingHowToUseDialog.text = qsTr(
+ receivePageDialog.title = qsTr("Tracking payments") + translationManager.emptyString;
+ receivePageDialog.text = qsTr(
"This is a simple sales tracker:
" +
"Let your customer scan that QR code to make a payment (if that customer has software which " +
"supports QR code scanning).
" +
@@ -454,8 +511,8 @@ Rectangle {
"confirmed in short order, but there is still a possibility they might not, so for larger " +
"values you may want to wait for one or more confirmation(s)."
)
- trackingHowToUseDialog.icon = StandardIcon.Information
- trackingHowToUseDialog.open()
+ receivePageDialog.icon = StandardIcon.Information
+ receivePageDialog.open()
}
}
@@ -513,7 +570,7 @@ Rectangle {
width: 12 * scaleRatio
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
- anchors.leftMargin: 12
+ anchors.leftMargin: 8
}
Label {
@@ -564,6 +621,7 @@ Rectangle {
anchors.right: parent.right
anchors.rightMargin: 4
+ anchors.top: undefined
anchors.verticalCenter: parent.verticalCenter
}
}
@@ -584,7 +642,7 @@ Rectangle {
}
MessageDialog {
- id: trackingHowToUseDialog
+ id: receivePageDialog
standardButtons: StandardButton.Ok
}
@@ -597,10 +655,10 @@ Rectangle {
onAccepted: {
if(!walletManager.saveQrCode(makeQRCodeString(), walletManager.urlToLocalPath(fileUrl))) {
console.log("Failed to save QrCode to file " + walletManager.urlToLocalPath(fileUrl) )
- trackingHowToUseDialog.title = qsTr("Save QrCode") + translationManager.emptyString;
- trackingHowToUseDialog.text = qsTr("Failed to save QrCode to ") + walletManager.urlToLocalPath(fileUrl) + translationManager.emptyString;
- trackingHowToUseDialog.icon = StandardIcon.Error
- trackingHowToUseDialog.open()
+ receivePageDialog.title = qsTr("Save QrCode") + translationManager.emptyString;
+ receivePageDialog.text = qsTr("Failed to save QrCode to ") + walletManager.urlToLocalPath(fileUrl) + translationManager.emptyString;
+ receivePageDialog.icon = StandardIcon.Error
+ receivePageDialog.open()
}
}
}
diff --git a/qml.qrc b/qml.qrc
index 1e730ff3..68eb8936 100644
--- a/qml.qrc
+++ b/qml.qrc
@@ -208,5 +208,6 @@
js/Windows.js
js/Utils.js
components/RadioButton.qml
+ images/editIcon.png
From 5487383068811967dc0b79eeea7babd89185a8a6 Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Sat, 28 Apr 2018 00:50:33 +0200
Subject: [PATCH 06/15] Variable address truncation (for mobile)
---
js/TxUtils.js | 5 +++--
pages/Receive.qml | 8 +++++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/js/TxUtils.js b/js/TxUtils.js
index 4a4b01c4..cdb7e719 100644
--- a/js/TxUtils.js
+++ b/js/TxUtils.js
@@ -11,8 +11,9 @@ function destinationsToAddress(destinations){
return address;
}
-function addressTruncate(address){
- return address.substring(0, 6) + "..." + address.substring(address.length-6);
+function addressTruncate(address, range){
+ if(typeof(range) === "undefined") range = 8;
+ return address.substring(0, range) + "..." + address.substring(address.length-range);
}
function check256(str, length) {
diff --git a/pages/Receive.qml b/pages/Receive.qml
index 28cedd91..b89c636c 100644
--- a/pages/Receive.qml
+++ b/pages/Receive.qml
@@ -275,7 +275,13 @@ Rectangle {
anchors.leftMargin: 6
fontSize: 14 * scaleRatio
fontBold: true
- text: TxUtils.addressTruncate(address)
+ text: {
+ if(isMobile){
+ TxUtils.addressTruncate(address, 6);
+ } else {
+ return TxUtils.addressTruncate(address, 10);
+ }
+ }
}
MouseArea{
From 9018ae3afe5f934c65a3e3c5be15e519ea4f5a92 Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Sat, 28 Apr 2018 02:50:22 +0200
Subject: [PATCH 07/15] Dynamic page height for the receive page
---
MiddlePanel.qml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MiddlePanel.qml b/MiddlePanel.qml
index 73cae42a..6101b28d 100644
--- a/MiddlePanel.qml
+++ b/MiddlePanel.qml
@@ -121,7 +121,7 @@ Rectangle {
}, State {
name: "Receive"
PropertyChanges { target: root; currentView: receiveView }
- PropertyChanges { target: mainFlickable; contentHeight: 1000 * scaleRatio }
+ PropertyChanges { target: mainFlickable; contentHeight: receiveView.receiveHeight + 100 }
}, State {
name: "TxKey"
PropertyChanges { target: root; currentView: txkeyView }
From dc1d5e9e0a1af6b8b3b9ce48a378e2b57a618a36 Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Sat, 28 Apr 2018 02:54:12 +0200
Subject: [PATCH 08/15] Check the 'to receive amount' with the transaction
tracker
---
pages/Receive.qml | 48 +++++++++++++++++++++++++++++++++--------------
1 file changed, 34 insertions(+), 14 deletions(-)
diff --git a/pages/Receive.qml b/pages/Receive.qml
index b89c636c..9ab742c9 100644
--- a/pages/Receive.qml
+++ b/pages/Receive.qml
@@ -48,13 +48,14 @@ Rectangle {
property var model
property var current_address
property int current_subaddress_table_index: 0
+ property alias receiveHeight: mainLayout.height
property alias addressText : pageReceive.current_address
function makeQRCodeString() {
var s = "monero:"
var nfields = 0
s += current_address;
- var amount = amountLine.text.trim()
+ var amount = amountToReceiveLine.text.trim()
if (amount !== "") {
s += (nfields++ ? "&" : "?")
s += "tx_amount=" + amount
@@ -65,10 +66,12 @@ Rectangle {
function update() {
if (!appWindow.currentWallet || !trackingEnabled.checked) {
trackingLineText.text = "";
+ trackingModel.clear();
return
}
if (appWindow.currentWallet.connected() == Wallet.ConnectionStatus_Disconnected) {
trackingLineText.text = qsTr("WARNING: no connection to daemon");
+ trackingModel.clear();
return
}
@@ -121,22 +124,21 @@ Rectangle {
return
}
else if(nTransactions === 1){
- trackingLineText.text = qsTr("Transaction found") + translationManager.emptyString;
+ trackingLineText.text = qsTr("Transaction found") + ":" + translationManager.emptyString;
} else {
- trackingLineText.text = qsTr("%1 transactions found").arg(nTransactions) + translationManager.emptyString
+ trackingLineText.text = qsTr("%1 transactions found").arg(nTransactions) + ":" + translationManager.emptyString
}
var max_tracking = 3;
-
- var expectedAmount = walletManager.amountFromString(amountLine.text)
+ toReceiveSatisfiedLine.text = "";
+ var expectedAmount = walletManager.amountFromString(amountToReceiveLine.text)
if (expectedAmount && expectedAmount != amount) {
var displayTotalAmount = walletManager.displayAmount(totalAmount)
- if (amount > expectedAmount) {
-
- text += qsTr(" with more money (%1)").arg(displayTotalAmount) + translationManager.emptyString
- } else if (amount < expectedAmount) {
- text += qsTr(" with not enough money (%1)").arg(displayTotalAmount) + translationManager.emptyString
- }
+ if (amount > expectedAmount) toReceiveSatisfiedLine.text += qsTr("With more Monero");
+ else if (amount < expectedAmount) toReceiveSatisfiedLine.text = qsTr("With not enough Monero")
+ toReceiveSatisfiedLine.text += ": " + "
" +
+ qsTr("Expected") + ": " + amountToReceiveLine.text + "
" +
+ qsTr("Total received") + ": " + displayTotalAmount + translationManager.emptyString;
}
trackingModel.clear();
@@ -434,7 +436,7 @@ Rectangle {
Layout.maximumWidth: mainLayout.qrCodeSize
LineEdit {
- id: amountLine
+ id: amountToReceiveLine
Layout.fillWidth: true
labelText: qsTr("Amount") + translationManager.emptyString
placeholderText: qsTr("Amount to receive") + translationManager.emptyString
@@ -626,7 +628,6 @@ Rectangle {
}
anchors.right: parent.right
- anchors.rightMargin: 4
anchors.top: undefined
anchors.verticalCenter: parent.verticalCenter
}
@@ -635,9 +636,26 @@ Rectangle {
}
RowLayout {
- Layout.topMargin: 32 * scaleRatio
+ visible: trackingTableRow.visible && x.text !== "" && amountToReceiveLine.text !== ""
+ Layout.topMargin: 14 * scaleRatio
+ Layout.fillWidth: true
+ Layout.preferredHeight: 40 * scaleRatio
+
+ Label {
+ id: toReceiveSatisfiedLine
+ color: "white"
+ fontFamily: Style.fontLight.name
+ fontSize: 14 * scaleRatio
+ textFormat: Text.RichText
+ text: ""
+ height: 40 * scaleRatio
+ }
+ }
+
+ RowLayout {
Layout.fillWidth: true
Layout.minimumWidth: 200
+ Layout.topMargin: trackingTableRow.visible ? 20 * scaleRatio : 32 * scaleRatio
CheckBox {
id: trackingEnabled
@@ -695,5 +713,7 @@ Rectangle {
function onPageClosed() {
timer.running = false
+ trackingEnabled.checked = false
+ trackingModel.clear()
}
}
From 229fba2de9337e8a16449fc7a20b11b8560d7601 Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Sat, 28 Apr 2018 17:37:59 +0200
Subject: [PATCH 09/15] Introduced 'show advanced options' checkbox
---
pages/Receive.qml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/pages/Receive.qml b/pages/Receive.qml
index 9ab742c9..f5cac4a9 100644
--- a/pages/Receive.qml
+++ b/pages/Receive.qml
@@ -48,6 +48,7 @@ Rectangle {
property var model
property var current_address
property int current_subaddress_table_index: 0
+ property bool advancedRowVisible: false
property alias receiveHeight: mainLayout.height
property alias addressText : pageReceive.current_address
@@ -398,10 +399,23 @@ Rectangle {
}
}
+ RowLayout {
+ CheckBox2 {
+ id: showAdvancedCheckbox
+ checked: false
+ onClicked: {
+ advancedRowVisible = !advancedRowVisible;
+ }
+ text: qsTr("Advanced options") + translationManager.emptyString
+ }
+ }
+
GridLayout {
+ id: advancedRow
columns: (isMobile)? 1 : 2
Layout.fillWidth: true
columnSpacing: 32 * scaleRatio
+ visible: advancedRowVisible
ColumnLayout {
Layout.alignment: Qt.AlignTop
From d6427a1efb334fdc7e9a82ef2d61349d4083d36a Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Sat, 28 Apr 2018 18:50:07 +0200
Subject: [PATCH 10/15] Fixes undefined references to 'bg', was previously
moved to main.inactiveOverlay
---
components/InputDialog.qml | 8 --------
components/NewPasswordDialog.qml | 2 +-
components/PasswordDialog.qml | 2 +-
3 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/components/InputDialog.qml b/components/InputDialog.qml
index 5119c9fc..7cb37ef4 100644
--- a/components/InputDialog.qml
+++ b/components/InputDialog.qml
@@ -153,12 +153,4 @@ Item {
}
}
}
-
- Rectangle {
- id: bg
- z: parent.z + 1
- anchors.fill: parent
- color: "black"
- opacity: 0.8
- }
}
diff --git a/components/NewPasswordDialog.qml b/components/NewPasswordDialog.qml
index d94b5407..032acbc8 100644
--- a/components/NewPasswordDialog.qml
+++ b/components/NewPasswordDialog.qml
@@ -80,7 +80,7 @@ Item {
}
ColumnLayout {
- z: bg.z + 1
+ z: inactiveOverlay.z + 1
id: mainLayout
spacing: 10
anchors { fill: parent; margins: 35 * scaleRatio }
diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml
index 1534e1f3..e8e39e4c 100644
--- a/components/PasswordDialog.qml
+++ b/components/PasswordDialog.qml
@@ -70,7 +70,7 @@ Item {
}
ColumnLayout {
- z: bg.z + 1
+ z: inactiveOverlay.z + 1
id: mainLayout
spacing: 10
anchors { fill: parent; margins: 35 * scaleRatio }
From 1541d87122414e8673fc92d38a5304dfbd1a8744 Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Sat, 28 Apr 2018 18:53:17 +0200
Subject: [PATCH 11/15] Fixes undefined reference to 's'
---
components/TitleBar.qml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/TitleBar.qml b/components/TitleBar.qml
index 166e2be9..fcbe53dc 100644
--- a/components/TitleBar.qml
+++ b/components/TitleBar.qml
@@ -26,7 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import QtQuick 2.2
+import QtQuick 2.5
import QtQuick.Window 2.0
import QtQuick.Layouts 1.1
@@ -64,7 +64,7 @@ Rectangle {
Item {
// Background gradient
width: parent.width
- height: s
+ height: parent.height
z: parent.z + 1
Image {
From 178be387bbf264d9fa5084b0d5fcfa098ef7d981 Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Sat, 28 Apr 2018 18:53:32 +0200
Subject: [PATCH 12/15] Cursor pointer on link hover for richtexts
---
components/Label.qml | 3 ++-
components/LabelSubheader.qml | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/components/Label.qml b/components/Label.qml
index 11d43fa3..5b0a25c9 100644
--- a/components/Label.qml
+++ b/components/Label.qml
@@ -26,7 +26,7 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import QtQuick 2.0
+import QtQuick 2.5
import QtQuick.Layouts 1.1
import "../components" as MoneroComponents
@@ -43,6 +43,7 @@ Item {
property string fontFamily: ""
property alias wrapMode: label.wrapMode
property alias horizontalAlignment: label.horizontalAlignment
+ property alias hoveredLink: label.hoveredLink
signal linkActivated()
height: label.height * scaleRatio
width: label.width * scaleRatio
diff --git a/components/LabelSubheader.qml b/components/LabelSubheader.qml
index 96274f4d..50288ecf 100644
--- a/components/LabelSubheader.qml
+++ b/components/LabelSubheader.qml
@@ -43,4 +43,10 @@ Label {
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
}
+
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.NoButton
+ cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
+ }
}
From bfbe00e11c7dc80ead55b7cc7b13b5a47881e23f Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Mon, 30 Apr 2018 01:02:37 +0200
Subject: [PATCH 13/15] Removed obsolete SubaddressTable.qml component
---
components/SubaddressTable.qml | 160 ---------------------------------
qml.qrc | 1 -
2 files changed, 161 deletions(-)
delete mode 100644 components/SubaddressTable.qml
diff --git a/components/SubaddressTable.qml b/components/SubaddressTable.qml
deleted file mode 100644
index a024e519..00000000
--- a/components/SubaddressTable.qml
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright (c) 2014-2018, The Monero Project
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without modification, are
-// permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice, this list of
-// conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright notice, this list
-// of conditions and the following disclaimer in the documentation and/or other
-// materials provided with the distribution.
-//
-// 3. Neither the name of the copyright holder nor the names of its contributors may be
-// used to endorse or promote products derived from this software without specific
-// prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
-// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
-// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import QtQuick 2.0
-import moneroComponents.Clipboard 1.0
-
-import "../components" as MoneroComponents
-
-ListView {
- id: listView
- clip: true
- boundsBehavior: ListView.StopAtBounds
- highlightMoveDuration: 0
- highlightFollowsCurrentItem: true
- anchors.topMargin: 0
- spacing: 0
-
- delegate: Rectangle {
- id: delegate
- height: 80
- color: 'transparent';
- anchors.topMargin: 0
- width: listView.width
- clip: true
-
- MoneroComponents.LineEditMulti {
- id: addressLine
-
- fontSize: 14
- readOnly: true
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.leftMargin: 10
- anchors.topMargin: 12
- anchors.rightMargin: 54
- anchors.bottomMargin: 0
- text: address
-
- showingHeader: false
- showBorder: false
- addressValidation: false
- }
-
- MoneroComponents.IconButton {
- id: clipboardButton
- imageSource: "../images/copyToClipboard.png"
-
- onClicked: {
- console.log(addressLine.text + " copied to clipboard");
- clipboard.setText(addressLine.text);
- appWindow.showStatusMessage(qsTr("Address copied to clipboard"),3);
- }
-
- anchors.right: parent.right
- anchors.rightMargin: 0
- anchors.verticalCenter: parent.verticalCenter
- }
-
- Text {
- id: indexText
- anchors.top: addressLine.bottom
- anchors.left: parent.left
- anchors.leftMargin: 20
- font.family: "Arial"
- font.bold: true
- font.pixelSize: 12
- color: "#444444"
- text: "#" + index
- }
-
- Text {
- id: labelText
- anchors.top: addressLine.bottom
- anchors.left: indexText.right
- anchors.right: parent.right
- anchors.leftMargin: 10
- font.family: "Arial"
- font.bold: true
- font.pixelSize: 12
- color: MoneroComponents.Style.greyFontColor
- text: label
- }
-
- MouseArea {
- z: 5
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- anchors.rightMargin: clipboardButton.width
- cursorShape: Qt.PointingHandCursor
- onClicked: {
- listView.currentIndex = index;
- }
- }
-
- Rectangle {
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- width: 1
- color: MoneroComponents.Style.grey
- z: 6
- }
-
- Rectangle {
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- width: 1
- color: MoneroComponents.Style.grey
- z: 6
- }
-
- Rectangle {
- anchors.right: parent.right
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- color: MoneroComponents.Style.grey
- height: 1
- z: 6
- }
-
- Rectangle {
- width: 3
- color: 'white'
- visible: listView.currentIndex == index
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- }
- }
-}
diff --git a/qml.qrc b/qml.qrc
index 68eb8936..4ec763f8 100644
--- a/qml.qrc
+++ b/qml.qrc
@@ -51,7 +51,6 @@
tabs/TweetsModel.qml
components/Scroll.qml
components/AddressBookTable.qml
- components/SubaddressTable.qml
images/deleteIcon.png
images/moneroIcon.png
components/StandardDropdown.qml
From 3e5f5f324540ffd98516c84a869dc2f8675a72fc Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Wed, 2 May 2018 18:53:35 +0200
Subject: [PATCH 14/15] Adding editIcon.png
---
images/editIcon.png | Bin 0 -> 15319 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100755 images/editIcon.png
diff --git a/images/editIcon.png b/images/editIcon.png
new file mode 100755
index 0000000000000000000000000000000000000000..c3cd37185d9ac4c94ac5468c9585243869d1eb33
GIT binary patch
literal 15319
zcmeI3Yitx%6vwCGT~ouOJVeFGRtku-^Vr>Xci3I5E!YMZN~yHq2bi6?+a1~6S!Sl}
zwi*G^2vHs(2#5`V03jwSC?6y-5hLK^3qq^~(I62~UJ*$UP#f{izI)r=G!eg;J4w5H
z?*E>1=l0c9B6*_l>ds
zil`kO6DZ1aO>Jy8n*&davKF;ViWUU+WHb(EQfJp~IiyHIUu77mIMyra?
z*5nFsfp|3ttF`SqSkOMVQEp!*dlcJDf3Y_y!T?cVN^~+Bi5X(jXG_Hu;dg78wb7|5
z<}#nH%36?a4%E}tnht1}y@HW>o~J84cHZT72(HIzf#Y2)=V5t{;dqhfM1i9-m(5=c
zzj<{fBsSE{&MXHlpDk>fagk*ciG)4juxok?%X>T?mJ?V(VBieKXp5Orl8G5*=^)uS
zHNcQ{HEya}jJD!RL9NyF*=*KAxhu1;Xgs%2%*e2V6xpN{XL&ov_Tv-?;N7CpK0OU{
z)(UthnVt2ypwZYC2W$f{v{qdPvsQqZS=QH0C~_`Nyj72+_$V?9A|MJ~40!W=pSKVX
zYo=y|wSM-Ull$GhsfO~0(_;&k(ytpxs{OcGO4==z3h5K_!u%7fbs(9V-l%C2e>%(R
zvv*HdSEsUyp4z0w6fI#)^RlQ*{=Drr!#NqDvQcn|yh9W!r*neHaRour
zGm#hpnEQ%kN&|_~V=fv;Q`At~fTHAQ_KXn-h;=c;lwvZdtMS9V+f`K&9YH~sTon!m
zxCNeZ!i#ZNIvh-hmlVJ&l1mcYsZI8D?-ja6lUuDsf}zueuV^w1pGyx>aq@0SRw@{$
zn3pNs)p%)?O62n9CUqDV2(c0U^Q3
zNI|EA2?k|}@d&W3RB|DwB=FfK`Uul&san;5+0<5$WiZ!Loo4}9-g7i7MATFViA%Zx
ztitr!vXz-@Ik}Ev`J@V5lw_;-_+=}7f#PL*jOK4E=b3R+dmrb(5TxT5xc9$CA`D`<
z^iPLM&FVjhp@qzZq=Tv!m>~nH%yiVAZfJNfYxU}g`X3yGA+7j#$1t#}`d=JFK8xkB
z6l(#BpUoz4c3@y9mp;#)m6fg5-j(Q8WHF@aQOWeHQK<#6@mPzO%@5|+^yYg|wHDFz
zfTjSy!^`$HT;OH>IEk=Jz>Jkr)d^ciuQ7CfvsLYp*3|q;frA%(gn?JawNOS~7vWtC
zWz;qA`AkeT{X%9nWVpb~`UMqJFc!dvJ>ai!xg4n
zGXY=F+#doD!IwK}xwaudQSFl{YSkKw`r|JAyi8H897SDON>So=iW;wNUUGakMHRu9
z#Ht#TXFED));7&A{p7}1^Bx&;d1P(Z7J6~G2Gr{u{rrKUPvTy6&`5f2L(f#!%
znyFe{8nusFw`Hxp>QdLZ(tT?V4<)>f>Y2mn=V7-x7YKvsNE=
z`{dYjC3}3EcdWcqwDQogy>#22qV~0axt@3y?0U0)!nA2V=kE81J2$Mpv|hd0MFlQQ
z*}A-O@N={0oM}3>c;w16eQW#iH51DYZsfh6o&KWk!JoOw4te8m)E;orj9=xwqCuhn>DxQy(gEx^bhbC%RK-9
literal 0
HcmV?d00001
From bff27010f34459476effccbb9f03bf3e242bfaae Mon Sep 17 00:00:00 2001
From: Sander Ferdinand
Date: Thu, 3 May 2018 12:29:04 +0200
Subject: [PATCH 15/15] Fixes the background for 2 popups
---
components/InputDialog.qml | 2 ++
components/NewPasswordDialog.qml | 2 ++
2 files changed, 4 insertions(+)
diff --git a/components/InputDialog.qml b/components/InputDialog.qml
index 7cb37ef4..fd1c3e3d 100644
--- a/components/InputDialog.qml
+++ b/components/InputDialog.qml
@@ -46,6 +46,7 @@ Item {
signal rejected()
function open() {
+ inactiveOverlay.visible = true
leftPanel.enabled = false
middlePanel.enabled = false
titleBar.enabled = false
@@ -56,6 +57,7 @@ Item {
}
function close() {
+ inactiveOverlay.visible = false
leftPanel.enabled = true
middlePanel.enabled = true
titleBar.enabled = true
diff --git a/components/NewPasswordDialog.qml b/components/NewPasswordDialog.qml
index 032acbc8..f974965d 100644
--- a/components/NewPasswordDialog.qml
+++ b/components/NewPasswordDialog.qml
@@ -48,6 +48,7 @@ Item {
signal closeCallback()
function open() {
+ inactiveOverlay.visible = true
leftPanel.enabled = false
middlePanel.enabled = false
titleBar.enabled = false
@@ -59,6 +60,7 @@ Item {
}
function close() {
+ inactiveOverlay.visible = false
leftPanel.enabled = true
middlePanel.enabled = true
titleBar.enabled = true