mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-03-28 10:08:57 +00:00
Transfer - mobile redesign
This commit is contained in:
parent
aded122465
commit
58030c67c8
1 changed files with 224 additions and 267 deletions
|
@ -71,10 +71,10 @@ Rectangle {
|
|||
}
|
||||
|
||||
function updateMixin() {
|
||||
var fillLevel = privacyLevelItem.fillLevel
|
||||
var fillLevel = (isMobile) ? privacyLevelItemSmall.fillLevel : privacyLevelItem.fillLevel
|
||||
var mixin = scaleValueToMixinCount(fillLevel)
|
||||
print ("PrivacyLevel changed:" + fillLevel)
|
||||
print ("mixin count: " + mixin)
|
||||
console.log("PrivacyLevel changed:" + fillLevel)
|
||||
console.log("mixin count: " + mixin)
|
||||
privacyLabel.text = qsTr("Privacy level (ringsize %1)").arg(mixin+1) + translationManager.emptyString
|
||||
}
|
||||
|
||||
|
@ -107,297 +107,226 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
ColumnLayout {
|
||||
id: pageRoot
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: 20
|
||||
height: 400
|
||||
anchors.margins: 17 * scaleRatio
|
||||
spacing: 0
|
||||
|
||||
Label {
|
||||
id: amountLabel
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.leftMargin: 17
|
||||
anchors.rightMargin: 17
|
||||
anchors.topMargin: 17
|
||||
text: qsTr("Amount") + translationManager.emptyString
|
||||
fontSize: 14
|
||||
}
|
||||
GridLayout {
|
||||
columns: (isMobile)? 1 : 2
|
||||
Layout.fillWidth: true
|
||||
|
||||
Label {
|
||||
id: transactionPriority
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 17
|
||||
fontSize: 14
|
||||
x: (parent.width - 17) / 2 + 17
|
||||
text: qsTr("Transaction priority") + translationManager.emptyString
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
id: amountLabel
|
||||
text: qsTr("Amount") + translationManager.emptyString
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
id: amountRow
|
||||
Layout.minimumWidth: 200
|
||||
Item {
|
||||
visible: !isMobile
|
||||
width: 37 * scaleRatio
|
||||
height: 37 * scaleRatio
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: "../images/moneroIcon.png"
|
||||
}
|
||||
}
|
||||
// Amount input
|
||||
LineEdit {
|
||||
Layout.fillWidth: true
|
||||
id: amountLine
|
||||
placeholderText: qsTr("") + translationManager.emptyString
|
||||
width:100
|
||||
validator: DoubleValidator {
|
||||
bottom: 0.0
|
||||
top: 18446744.073709551615
|
||||
decimals: 12
|
||||
notation: DoubleValidator.StandardNotation
|
||||
locale: "C"
|
||||
}
|
||||
}
|
||||
|
||||
StandardButton {
|
||||
id: amountAllButton
|
||||
width: 60 * scaleRatio
|
||||
text: qsTr("All") + translationManager.emptyString
|
||||
shadowReleasedColor: "#FF4304"
|
||||
shadowPressedColor: "#B32D00"
|
||||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
enabled : true
|
||||
onClicked: amountLine.text = "(all)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Row {
|
||||
id: amountRow
|
||||
anchors.top: amountLabel.bottom
|
||||
anchors.topMargin: 5
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 7
|
||||
width: (parent.width - 17) / 2 + 10
|
||||
Item {
|
||||
width: 37
|
||||
height: 37
|
||||
}
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: "../images/moneroIcon.png"
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
id: transactionPriority
|
||||
text: qsTr("Transaction priority") + translationManager.emptyString
|
||||
}
|
||||
// Note: workaround for translations in listElements
|
||||
// ListElement: cannot use script for property value, so
|
||||
// code like this wont work:
|
||||
// ListElement { column1: qsTr("LOW") + translationManager.emptyString ; column2: ""; priority: PendingTransaction.Priority_Low }
|
||||
// For translations to work, the strings need to be listed in
|
||||
// the file components/StandardDropdown.qml too.
|
||||
|
||||
// Priorities before v5
|
||||
ListModel {
|
||||
id: priorityModel
|
||||
|
||||
ListElement { column1: qsTr("Low (x1 fee)") ; column2: ""; priority: PendingTransaction.Priority_Low }
|
||||
ListElement { column1: qsTr("Medium (x20 fee)") ; column2: ""; priority: PendingTransaction.Priority_Medium }
|
||||
ListElement { column1: qsTr("High (x166 fee)") ; column2: ""; priority: PendingTransaction.Priority_High }
|
||||
}
|
||||
|
||||
// Priorites after v5
|
||||
ListModel {
|
||||
id: priorityModelV5
|
||||
|
||||
ListElement { column1: qsTr("Slow (x0.25 fee)") ; column2: ""; priority: 1}
|
||||
ListElement { column1: qsTr("Default (x1 fee)") ; column2: ""; priority: 2 }
|
||||
ListElement { column1: qsTr("Fast (x5 fee)") ; column2: ""; priority: 3 }
|
||||
ListElement { column1: qsTr("Fastest (x41.5 fee)") ; column2: ""; priority: 4 }
|
||||
|
||||
}
|
||||
|
||||
StandardDropdown {
|
||||
Layout.fillWidth: true
|
||||
id: priorityDropdown
|
||||
shadowReleasedColor: "#FF4304"
|
||||
shadowPressedColor: "#B32D00"
|
||||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
}
|
||||
}
|
||||
// Amount input
|
||||
LineEdit {
|
||||
id: amountLine
|
||||
placeholderText: qsTr("") + translationManager.emptyString
|
||||
width: parent.width - 37 - 17 - 60
|
||||
validator: DoubleValidator {
|
||||
bottom: 0.0
|
||||
top: 18446744.073709551615
|
||||
decimals: 12
|
||||
notation: DoubleValidator.StandardNotation
|
||||
locale: "C"
|
||||
// Make sure dropdown is on top
|
||||
z: parent.z + 1
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
id: addressLabel
|
||||
textFormat: Text.RichText
|
||||
text: qsTr("<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style>\
|
||||
Address <font size='2'> ( Paste in or select from </font> <a href='#'>Address book</a><font size='2'> )</font>")
|
||||
+ translationManager.emptyString
|
||||
|
||||
onLinkActivated: appWindow.showPageRequest("AddressBook")
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
// recipient address input
|
||||
RowLayout {
|
||||
id: addressLineRow
|
||||
Layout.fillWidth: true
|
||||
|
||||
StandardButton {
|
||||
id: qrfinderButton
|
||||
text: qsTr("QR Code") + translationManager.emptyString
|
||||
shadowReleasedColor: "#FF4304"
|
||||
shadowPressedColor: "#B32D00"
|
||||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
visible : appWindow.qrScannerEnabled
|
||||
enabled : visible
|
||||
width: visible ? 60 * scaleRatio : 0
|
||||
onClicked: {
|
||||
cameraUi.state = "Capture"
|
||||
cameraUi.qrcode_decoded.connect(updateFromQrCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StandardButton {
|
||||
id: amountAllButton
|
||||
//anchors.left: amountLine.right
|
||||
//anchors.top: amountLine.top
|
||||
//anchors.bottom: amountLine.bottom
|
||||
width: 60
|
||||
text: qsTr("All") + translationManager.emptyString
|
||||
shadowReleasedColor: "#FF4304"
|
||||
shadowPressedColor: "#B32D00"
|
||||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
enabled : true
|
||||
onClicked: amountLine.text = "(all)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Note: workaround for translations in listElements
|
||||
// ListElement: cannot use script for property value, so
|
||||
// code like this wont work:
|
||||
// ListElement { column1: qsTr("LOW") + translationManager.emptyString ; column2: ""; priority: PendingTransaction.Priority_Low }
|
||||
// For translations to work, the strings need to be listed in
|
||||
// the file components/StandardDropdown.qml too.
|
||||
|
||||
// Priorities before v5
|
||||
ListModel {
|
||||
id: priorityModel
|
||||
|
||||
ListElement { column1: qsTr("Low (x1 fee)") ; column2: ""; priority: PendingTransaction.Priority_Low }
|
||||
ListElement { column1: qsTr("Medium (x20 fee)") ; column2: ""; priority: PendingTransaction.Priority_Medium }
|
||||
ListElement { column1: qsTr("High (x166 fee)") ; column2: ""; priority: PendingTransaction.Priority_High }
|
||||
}
|
||||
|
||||
// Priorites after v5
|
||||
ListModel {
|
||||
id: priorityModelV5
|
||||
|
||||
ListElement { column1: qsTr("Slow (x0.25 fee)") ; column2: ""; priority: 1}
|
||||
ListElement { column1: qsTr("Default (x1 fee)") ; column2: ""; priority: 2 }
|
||||
ListElement { column1: qsTr("Fast (x5 fee)") ; column2: ""; priority: 3 }
|
||||
ListElement { column1: qsTr("Fastest (x41.5 fee)") ; column2: ""; priority: 4 }
|
||||
|
||||
}
|
||||
|
||||
StandardDropdown {
|
||||
id: priorityDropdown
|
||||
anchors.top: transactionPriority.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 17
|
||||
anchors.topMargin: 5
|
||||
anchors.left: transactionPriority.left
|
||||
shadowReleasedColor: "#FF4304"
|
||||
shadowPressedColor: "#B32D00"
|
||||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
z: 1
|
||||
}
|
||||
|
||||
Label {
|
||||
id: addressLabel
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: amountRow.bottom
|
||||
anchors.leftMargin: 17
|
||||
anchors.rightMargin: 17
|
||||
anchors.topMargin: 30
|
||||
fontSize: 14
|
||||
textFormat: Text.RichText
|
||||
text: qsTr("<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style>\
|
||||
Address <font size='2'> ( Paste in or select from </font> <a href='#'>Address book</a><font size='2'> )</font>")
|
||||
+ translationManager.emptyString
|
||||
|
||||
onLinkActivated: appWindow.showPageRequest("AddressBook")
|
||||
}
|
||||
// recipient address input
|
||||
RowLayout {
|
||||
id: addressLineRow
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: addressLabel.bottom
|
||||
|
||||
StandardButton {
|
||||
id: qrfinderButton
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 17
|
||||
anchors.topMargin: 5
|
||||
text: qsTr("QR Code") + translationManager.emptyString
|
||||
shadowReleasedColor: "#FF4304"
|
||||
shadowPressedColor: "#B32D00"
|
||||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
visible : appWindow.qrScannerEnabled
|
||||
enabled : visible
|
||||
width: visible ? 60 : 0
|
||||
onClicked: {
|
||||
cameraUi.state = "Capture"
|
||||
cameraUi.qrcode_decoded.connect(updateFromQrCode)
|
||||
LineEdit {
|
||||
id: addressLine
|
||||
Layout.fillWidth: true
|
||||
anchors.topMargin: 5 * scaleRatio
|
||||
placeholderText: "4..."
|
||||
// validator: RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }
|
||||
}
|
||||
}
|
||||
LineEdit {
|
||||
id: addressLine
|
||||
anchors.left: qrfinderButton.right
|
||||
anchors.right: resolveButton.left
|
||||
//anchors.leftMargin: 17
|
||||
anchors.topMargin: 5
|
||||
placeholderText: "4..."
|
||||
// validator: RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }
|
||||
}
|
||||
|
||||
StandardButton {
|
||||
id: resolveButton
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 17
|
||||
anchors.topMargin: 17
|
||||
anchors.rightMargin: 17
|
||||
width: 60
|
||||
text: qsTr("Resolve") + translationManager.emptyString
|
||||
shadowReleasedColor: "#FF4304"
|
||||
shadowPressedColor: "#B32D00"
|
||||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
enabled : isValidOpenAliasAddress(addressLine.text)
|
||||
onClicked: {
|
||||
var result = walletManager.resolveOpenAlias(addressLine.text)
|
||||
if (result) {
|
||||
var parts = result.split("|")
|
||||
if (parts.length == 2) {
|
||||
var address_ok = walletManager.addressValid(parts[1], appWindow.persistentSettings.testnet)
|
||||
if (parts[0] === "true") {
|
||||
if (address_ok) {
|
||||
addressLine.text = parts[1]
|
||||
addressLine.cursorPosition = 0
|
||||
}
|
||||
else
|
||||
oa_message(qsTr("No valid address found at this OpenAlias address"))
|
||||
} else if (parts[0] === "false") {
|
||||
if (address_ok) {
|
||||
addressLine.text = parts[1]
|
||||
addressLine.cursorPosition = 0
|
||||
oa_message(qsTr("Address found, but the DNSSEC signatures could not be verified, so this address may be spoofed"))
|
||||
StandardButton {
|
||||
id: resolveButton
|
||||
width: 60 * scaleRatio
|
||||
text: qsTr("Resolve") + translationManager.emptyString
|
||||
shadowReleasedColor: "#FF4304"
|
||||
shadowPressedColor: "#B32D00"
|
||||
releasedColor: "#FF6C3C"
|
||||
pressedColor: "#FF4304"
|
||||
enabled : isValidOpenAliasAddress(addressLine.text)
|
||||
onClicked: {
|
||||
var result = walletManager.resolveOpenAlias(addressLine.text)
|
||||
if (result) {
|
||||
var parts = result.split("|")
|
||||
if (parts.length == 2) {
|
||||
var address_ok = walletManager.addressValid(parts[1], appWindow.persistentSettings.testnet)
|
||||
if (parts[0] === "true") {
|
||||
if (address_ok) {
|
||||
addressLine.text = parts[1]
|
||||
addressLine.cursorPosition = 0
|
||||
}
|
||||
else
|
||||
oa_message(qsTr("No valid address found at this OpenAlias address"))
|
||||
} else if (parts[0] === "false") {
|
||||
if (address_ok) {
|
||||
addressLine.text = parts[1]
|
||||
addressLine.cursorPosition = 0
|
||||
oa_message(qsTr("Address found, but the DNSSEC signatures could not be verified, so this address may be spoofed"))
|
||||
} else {
|
||||
oa_message(qsTr("No valid address found at this OpenAlias address, but the DNSSEC signatures could not be verified, so this may be spoofed"))
|
||||
}
|
||||
} else {
|
||||
oa_message(qsTr("Internal error"))
|
||||
}
|
||||
} else {
|
||||
oa_message(qsTr("No valid address found at this OpenAlias address, but the DNSSEC signatures could not be verified, so this may be spoofed"))
|
||||
oa_message(qsTr("Internal error"))
|
||||
}
|
||||
} else {
|
||||
oa_message(qsTr("Internal error"))
|
||||
oa_message(qsTr("No address found"))
|
||||
}
|
||||
} else {
|
||||
oa_message(qsTr("Internal error"))
|
||||
}
|
||||
} else {
|
||||
oa_message(qsTr("No address found"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
id: paymentIdLabel
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: addressLineRow.bottom
|
||||
anchors.leftMargin: 17
|
||||
anchors.rightMargin: 17
|
||||
anchors.topMargin: 17
|
||||
fontSize: 14
|
||||
text: qsTr("Payment ID <font size='2'>( Optional )</font>") + translationManager.emptyString
|
||||
}
|
||||
Label {
|
||||
id: paymentIdLabel
|
||||
text: qsTr("Payment ID <font size='2'>( Optional )</font>") + translationManager.emptyString
|
||||
}
|
||||
|
||||
// payment id input
|
||||
LineEdit {
|
||||
id: paymentIdLine
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: paymentIdLabel.bottom
|
||||
anchors.leftMargin: 17
|
||||
anchors.rightMargin: 17
|
||||
anchors.topMargin: 5
|
||||
placeholderText: qsTr("16 or 64 hexadecimal characters") + translationManager.emptyString
|
||||
// validator: DoubleValidator { top: 0.0 }
|
||||
}
|
||||
// payment id input
|
||||
LineEdit {
|
||||
id: paymentIdLine
|
||||
placeholderText: qsTr("16 or 64 hexadecimal characters") + translationManager.emptyString
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
id: descriptionLabel
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: paymentIdLine.bottom
|
||||
anchors.leftMargin: 17
|
||||
anchors.rightMargin: 17
|
||||
anchors.topMargin: 17
|
||||
fontSize: 14
|
||||
text: qsTr("Description <font size='2'>( Optional )</font>")
|
||||
+ translationManager.emptyString
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Description <font size='2'>( Optional )</font>")
|
||||
+ translationManager.emptyString
|
||||
}
|
||||
|
||||
LineEdit {
|
||||
id: descriptionLine
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: descriptionLabel.bottom
|
||||
anchors.leftMargin: 17
|
||||
anchors.rightMargin: 17
|
||||
anchors.topMargin: 5
|
||||
placeholderText: qsTr("Saved to local wallet history") + translationManager.emptyString
|
||||
}
|
||||
|
||||
function checkInformation(amount, address, payment_id, testnet) {
|
||||
address = address.trim()
|
||||
payment_id = payment_id.trim()
|
||||
|
||||
var amount_ok = amount.length > 0
|
||||
var address_ok = walletManager.addressValid(address, testnet)
|
||||
var payment_id_ok = payment_id.length == 0 || walletManager.paymentIdValid(payment_id)
|
||||
var ipid = walletManager.paymentIdFromAddress(address, testnet)
|
||||
if (ipid.length > 0 && payment_id.length > 0)
|
||||
payment_id_ok = false
|
||||
|
||||
addressLine.error = !address_ok
|
||||
amountLine.error = !amount_ok
|
||||
paymentIdLine.error = !payment_id_ok
|
||||
|
||||
return amount_ok && address_ok && payment_id_ok
|
||||
}
|
||||
|
||||
|
||||
RowLayout {
|
||||
anchors.left: parent.left
|
||||
anchors.top: descriptionLine.bottom
|
||||
anchors.leftMargin: 17
|
||||
anchors.topMargin: 17
|
||||
LineEdit {
|
||||
id: descriptionLine
|
||||
placeholderText: qsTr("Saved to local wallet history") + translationManager.emptyString
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
StandardButton {
|
||||
id: sendButton
|
||||
Layout.bottomMargin: 17 * scaleRatio
|
||||
Layout.topMargin: 17 * scaleRatio
|
||||
text: qsTr("Send") + translationManager.emptyString
|
||||
shadowReleasedColor: "#FF4304"
|
||||
shadowPressedColor: "#B32D00"
|
||||
|
@ -418,6 +347,23 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
function checkInformation(amount, address, payment_id, testnet) {
|
||||
address = address.trim()
|
||||
payment_id = payment_id.trim()
|
||||
|
||||
var amount_ok = amount.length > 0
|
||||
var address_ok = walletManager.addressValid(address, testnet)
|
||||
var payment_id_ok = payment_id.length == 0 || walletManager.paymentIdValid(payment_id)
|
||||
var ipid = walletManager.paymentIdFromAddress(address, testnet)
|
||||
if (ipid.length > 0 && payment_id.length > 0)
|
||||
payment_id_ok = false
|
||||
|
||||
addressLine.error = !address_ok
|
||||
amountLine.error = !amount_ok
|
||||
paymentIdLine.error = !payment_id_ok
|
||||
|
||||
return amount_ok && address_ok && payment_id_ok
|
||||
}
|
||||
|
||||
} // pageRoot
|
||||
|
||||
|
@ -482,10 +428,20 @@ Rectangle {
|
|||
|
||||
|
||||
PrivacyLevel {
|
||||
visible: persistentSettings.transferShowAdvanced
|
||||
visible: persistentSettings.transferShowAdvanced && !isMobile
|
||||
id: privacyLevelItem
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 17 * scaleRatio
|
||||
onFillLevelChanged: updateMixin()
|
||||
}
|
||||
|
||||
PrivacyLevelSmall {
|
||||
visible: persistentSettings.transferShowAdvanced && isMobile
|
||||
id: privacyLevelItemSmall
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 17 * scaleRatio
|
||||
onFillLevelChanged: updateMixin()
|
||||
}
|
||||
|
||||
|
@ -722,6 +678,7 @@ Rectangle {
|
|||
statusText.text = qsTr("Waiting on daemon synchronization to finish")
|
||||
} else {
|
||||
// everything OK, enable transfer page
|
||||
// Light wallet is always ready
|
||||
pageRoot.enabled = true;
|
||||
statusText.text = "";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue