2018-01-07 05:20:45 +00:00
|
|
|
// Copyright (c) 2014-2018, The Monero Project
|
2016-10-04 10:15:29 +00:00
|
|
|
//
|
2016-06-26 15:04:45 +00:00
|
|
|
// All rights reserved.
|
2016-10-04 10:15:29 +00:00
|
|
|
//
|
2016-06-26 15:04:45 +00:00
|
|
|
// Redistribution and use in source and binary forms, with or without modification, are
|
|
|
|
// permitted provided that the following conditions are met:
|
2016-10-04 10:15:29 +00:00
|
|
|
//
|
2016-06-26 15:04:45 +00:00
|
|
|
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
|
|
// conditions and the following disclaimer.
|
2016-10-04 10:15:29 +00:00
|
|
|
//
|
2016-06-26 15:04:45 +00:00
|
|
|
// 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.
|
2016-10-04 10:15:29 +00:00
|
|
|
//
|
2016-06-26 15:04:45 +00:00
|
|
|
// 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.
|
2016-10-04 10:15:29 +00:00
|
|
|
//
|
2016-06-26 15:04:45 +00:00
|
|
|
// 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.
|
|
|
|
|
2019-04-11 01:17:29 +00:00
|
|
|
import QtQuick 2.9
|
2018-04-02 09:40:42 +00:00
|
|
|
import QtQuick.Controls 2.0
|
2016-06-26 15:04:45 +00:00
|
|
|
import QtQuick.Controls.Styles 1.4
|
|
|
|
import QtQuick.Layouts 1.1
|
2016-11-27 10:57:13 +00:00
|
|
|
import QtQuick.Dialogs 1.2
|
2019-06-17 15:14:13 +00:00
|
|
|
import FontAwesome 1.0
|
2016-06-26 15:04:45 +00:00
|
|
|
|
2018-12-08 15:55:29 +00:00
|
|
|
import "../components" as MoneroComponents
|
2019-04-11 01:17:29 +00:00
|
|
|
import "../components/effects/" as MoneroEffects
|
|
|
|
|
2016-10-02 18:40:40 +00:00
|
|
|
import moneroComponents.Clipboard 1.0
|
2016-11-27 10:57:13 +00:00
|
|
|
import moneroComponents.Wallet 1.0
|
|
|
|
import moneroComponents.WalletManager 1.0
|
|
|
|
import moneroComponents.TransactionHistory 1.0
|
|
|
|
import moneroComponents.TransactionHistoryModel 1.0
|
2017-07-04 03:34:09 +00:00
|
|
|
import moneroComponents.Subaddress 1.0
|
|
|
|
import moneroComponents.SubaddressModel 1.0
|
2018-04-27 21:24:41 +00:00
|
|
|
import "../js/TxUtils.js" as TxUtils
|
2016-06-26 15:04:45 +00:00
|
|
|
|
|
|
|
Rectangle {
|
2017-07-04 03:34:09 +00:00
|
|
|
id: pageReceive
|
2017-12-08 23:01:10 +00:00
|
|
|
color: "transparent"
|
2017-07-04 03:34:09 +00:00
|
|
|
property var model
|
2018-04-28 00:54:12 +00:00
|
|
|
property alias receiveHeight: mainLayout.height
|
2021-07-31 08:42:13 +00:00
|
|
|
property var state: "Address"
|
2016-11-27 10:57:13 +00:00
|
|
|
|
2018-04-27 22:37:09 +00:00
|
|
|
function renameSubaddressLabel(_index){
|
|
|
|
inputDialog.labelText = qsTr("Set the label of the selected address:") + translationManager.emptyString;
|
|
|
|
inputDialog.onAcceptedCallback = function() {
|
|
|
|
appWindow.currentWallet.subaddress.setLabel(appWindow.currentWallet.currentSubaddressAccount, _index, inputDialog.inputText);
|
|
|
|
}
|
|
|
|
inputDialog.onRejectedCallback = null;
|
2019-12-08 23:44:39 +00:00
|
|
|
inputDialog.open(appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, _index))
|
2018-04-27 22:37:09 +00:00
|
|
|
}
|
|
|
|
|
2021-07-31 08:42:13 +00:00
|
|
|
function generateQRCodeString() {
|
|
|
|
if (pageReceive.state == "PaymentRequest") {
|
2021-09-05 03:48:50 +00:00
|
|
|
return walletManager.make_uri(appWindow.current_address,
|
|
|
|
walletManager.amountFromString(amountToReceiveXMR.text),
|
|
|
|
txDescriptionInput.text, receiverNameInput.text);
|
2021-07-31 08:42:13 +00:00
|
|
|
} else {
|
2021-09-05 03:48:50 +00:00
|
|
|
return walletManager.make_uri(appWindow.current_address);
|
2021-07-31 08:42:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-26 15:04:45 +00:00
|
|
|
Clipboard { id: clipboard }
|
|
|
|
|
|
|
|
/* main layout */
|
|
|
|
ColumnLayout {
|
|
|
|
id: mainLayout
|
2019-09-05 22:11:12 +00:00
|
|
|
anchors.margins: 20
|
2019-04-25 19:09:23 +00:00
|
|
|
anchors.topMargin: 40
|
2017-04-03 16:51:55 +00:00
|
|
|
|
2016-06-26 15:04:45 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
2021-06-21 15:13:52 +00:00
|
|
|
spacing: 15
|
2016-06-26 15:04:45 +00:00
|
|
|
|
2017-04-03 16:51:55 +00:00
|
|
|
ColumnLayout {
|
2021-06-21 15:13:52 +00:00
|
|
|
id: selectedAddressDetailsColumn
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2018-03-19 01:42:46 +00:00
|
|
|
spacing: 0
|
2021-06-21 15:13:52 +00:00
|
|
|
property int qrSize: 220
|
2016-06-26 15:04:45 +00:00
|
|
|
|
2021-07-31 08:42:13 +00:00
|
|
|
MoneroComponents.Navbar {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.bottomMargin: 10
|
|
|
|
|
|
|
|
MoneroComponents.NavbarItem {
|
|
|
|
active: state == "Address"
|
|
|
|
text: qsTr("Address") + translationManager.emptyString
|
|
|
|
onSelected: state = "Address"
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.NavbarItem {
|
|
|
|
active: state == "PaymentRequest"
|
|
|
|
text: qsTr("Payment request") + translationManager.emptyString
|
|
|
|
onSelected: {
|
|
|
|
state = "PaymentRequest";
|
|
|
|
qrCodeTextMouseArea.hoverEnabled = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-21 15:13:52 +00:00
|
|
|
Rectangle {
|
|
|
|
id: qrContainer
|
|
|
|
color: MoneroComponents.Style.blackTheme ? "white" : "transparent"
|
2018-03-19 01:42:46 +00:00
|
|
|
Layout.fillWidth: true
|
2021-06-21 15:13:52 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.maximumWidth: parent.qrSize
|
|
|
|
Layout.preferredHeight: width
|
|
|
|
radius: 4
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: qrCode
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 1
|
|
|
|
smooth: false
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-07-31 08:42:13 +00:00
|
|
|
source: "image://qrcode/" + generateQRCodeString();
|
2021-06-21 15:13:52 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
2021-07-31 08:42:13 +00:00
|
|
|
onEntered: qrCodeTooltip.tooltipPopup.open()
|
|
|
|
onExited: qrCodeTooltip.tooltipPopup.close()
|
2021-06-21 15:13:52 +00:00
|
|
|
onClicked: {
|
|
|
|
if (mouse.button == Qt.LeftButton){
|
2021-07-31 08:42:13 +00:00
|
|
|
walletManager.saveQrCodeToClipboard(generateQRCodeString());
|
|
|
|
appWindow.showStatusMessage(qsTr("QR code copied to clipboard") + translationManager.emptyString, 3);
|
2021-06-21 15:13:52 +00:00
|
|
|
} else if (mouse.button == Qt.RightButton){
|
|
|
|
qrMenu.x = this.mouseX;
|
|
|
|
qrMenu.y = this.mouseY;
|
|
|
|
qrMenu.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Menu {
|
|
|
|
id: qrMenu
|
|
|
|
title: "QrCode"
|
2021-09-02 18:49:54 +00:00
|
|
|
currentIndex: menuItem1.hovered ? 0 : menuItem2.hovered ? 1 : -1
|
2021-06-21 15:13:52 +00:00
|
|
|
|
2021-07-31 08:42:13 +00:00
|
|
|
MenuItem {
|
2021-09-02 18:49:54 +00:00
|
|
|
id: menuItem1
|
2021-07-31 08:42:13 +00:00
|
|
|
text: qsTr("Copy to clipboard") + translationManager.emptyString;
|
|
|
|
onTriggered: walletManager.saveQrCodeToClipboard(generateQRCodeString())
|
|
|
|
}
|
|
|
|
|
2021-06-21 15:13:52 +00:00
|
|
|
MenuItem {
|
2021-09-02 18:49:54 +00:00
|
|
|
id: menuItem2
|
2021-06-21 15:13:52 +00:00
|
|
|
text: qsTr("Save as Image") + translationManager.emptyString;
|
|
|
|
onTriggered: qrFileDialog.open()
|
|
|
|
}
|
|
|
|
}
|
2021-07-31 08:42:13 +00:00
|
|
|
|
|
|
|
MoneroComponents.Tooltip {
|
|
|
|
id: qrCodeTooltip
|
|
|
|
text: qsTr("Left click: copy QR code to clipboard") + "<br>" + qsTr("Right click: save QR code as image file") + translationManager.emptyString
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.TextPlain {
|
|
|
|
id: qrCodeText
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.topMargin: 6
|
|
|
|
Layout.maximumWidth: 285
|
|
|
|
Layout.minimumHeight: 75
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
visible: paymentRequestGridLayout.visible
|
|
|
|
font.pixelSize: 12
|
|
|
|
color: qrCodeTextMouseArea.containsMouse ? MoneroComponents.Style.orange : MoneroComponents.Style.defaultFontColor
|
|
|
|
text: generateQRCodeString();
|
|
|
|
wrapMode: Text.WrapAnywhere
|
|
|
|
tooltip: qsTr("Copy payment request to clipboard") + translationManager.emptyString
|
|
|
|
themeTransition: false
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: qrCodeTextMouseArea
|
|
|
|
hoverEnabled: false //true when Payment request navbar button is clicked (fix bug displaying tooltip when navbar button is clicked)
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onEntered: parent.tooltipPopup.open()
|
|
|
|
onExited: parent.tooltipPopup.close()
|
|
|
|
onClicked: {
|
|
|
|
clipboard.setText(qrCodeText.text);
|
|
|
|
appWindow.showStatusMessage(qsTr("Payment request copied to clipboard") + translationManager.emptyString, 3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
id: paymentRequestGridLayout
|
|
|
|
columns: 3
|
|
|
|
rows: 4
|
|
|
|
visible: pageReceive.state == "PaymentRequest"
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.topMargin: 6
|
|
|
|
Layout.preferredWidth: 285
|
|
|
|
Layout.maximumWidth: 285
|
|
|
|
|
|
|
|
MoneroComponents.Label {
|
|
|
|
id: amountTitleFiat
|
|
|
|
Layout.bottomMargin: 3
|
|
|
|
Layout.preferredWidth: 90
|
|
|
|
visible: persistentSettings.fiatPriceEnabled
|
|
|
|
fontSize: 14
|
|
|
|
text: qsTr("Amount") + translationManager.emptyString
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Input {
|
|
|
|
id: amountToReceiveFiat
|
|
|
|
Layout.preferredWidth: 165
|
|
|
|
Layout.maximumWidth: 165
|
|
|
|
visible: persistentSettings.fiatPriceEnabled
|
|
|
|
topPadding: 5
|
|
|
|
leftPadding: 5
|
|
|
|
font.family: MoneroComponents.Style.fontMonoRegular.name
|
|
|
|
font.pixelSize: 14
|
|
|
|
font.bold: false
|
|
|
|
horizontalAlignment: TextInput.AlignLeft
|
|
|
|
verticalAlignment: TextInput.AlignVCenter
|
|
|
|
selectByMouse: true
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
placeholderText: "0.00"
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: MoneroComponents.Style.blackTheme ? "transparent" : "white"
|
|
|
|
radius: 3
|
|
|
|
border.color: parent.activeFocus ? MoneroComponents.Style.inputBorderColorActive : MoneroComponents.Style.inputBorderColorInActive
|
|
|
|
border.width: 1
|
|
|
|
}
|
|
|
|
onTextEdited: {
|
|
|
|
text = text.trim().replace(",", ".");
|
|
|
|
const match = text.match(/^0+(\d.*)/);
|
|
|
|
if (match) {
|
|
|
|
const cursorPosition = cursorPosition;
|
|
|
|
text = match[1];
|
|
|
|
cursorPosition = Math.max(cursorPosition, 1) - 1;
|
|
|
|
} else if(text.indexOf('.') === 0){
|
|
|
|
text = '0' + text;
|
|
|
|
if (text.length > 2) {
|
|
|
|
cursorPosition = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (amountToReceiveFiat.text == "") {
|
|
|
|
amountToReceiveXMR.text = "";
|
|
|
|
} else {
|
|
|
|
amountToReceiveXMR.text = fiatApiConvertToXMR(amountToReceiveFiat.text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
validator: RegExpValidator {
|
|
|
|
regExp: /^\s*(\d{1,8})?([\.,]\d{1,2})?\s*$/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Label {
|
|
|
|
Layout.bottomMargin: 3
|
|
|
|
visible: persistentSettings.fiatPriceEnabled
|
|
|
|
fontSize: 14
|
|
|
|
text: appWindow.fiatApiCurrencySymbol();
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Label {
|
|
|
|
id: amountTitleXMR
|
|
|
|
Layout.bottomMargin: 3
|
|
|
|
Layout.preferredWidth: 90
|
|
|
|
fontSize: 14
|
|
|
|
text: persistentSettings.fiatPriceEnabled ? "" : qsTr("Amount") + translationManager.emptyString
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Input {
|
|
|
|
id: amountToReceiveXMR
|
|
|
|
Layout.preferredWidth: 165
|
|
|
|
Layout.maximumWidth: 165
|
|
|
|
topPadding: 5
|
|
|
|
leftPadding: 5
|
|
|
|
font.family: MoneroComponents.Style.fontMonoRegular.name
|
|
|
|
font.pixelSize: 14
|
|
|
|
font.bold: false
|
|
|
|
horizontalAlignment: TextInput.AlignLeft
|
|
|
|
verticalAlignment: TextInput.AlignVCenter
|
|
|
|
selectByMouse: true
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
placeholderText: "0.000000000000"
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: MoneroComponents.Style.blackTheme ? "transparent" : "white"
|
|
|
|
radius: 3
|
|
|
|
border.color: parent.activeFocus ? MoneroComponents.Style.inputBorderColorActive : MoneroComponents.Style.inputBorderColorInActive
|
|
|
|
border.width: 1
|
|
|
|
}
|
|
|
|
onTextEdited: {
|
|
|
|
text = text.trim().replace(",", ".");
|
|
|
|
const match = text.match(/^0+(\d.*)/);
|
|
|
|
if (match) {
|
|
|
|
const cursorPosition = cursorPosition;
|
|
|
|
text = match[1];
|
|
|
|
cursorPosition = Math.max(cursorPosition, 1) - 1;
|
|
|
|
} else if(text.indexOf('.') === 0){
|
|
|
|
text = '0' + text;
|
|
|
|
if (text.length > 2) {
|
|
|
|
cursorPosition = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (amountToReceiveXMR.text == "") {
|
|
|
|
amountToReceiveFiat.text = "";
|
|
|
|
} else {
|
|
|
|
amountToReceiveFiat.text = fiatApiConvertToFiat(amountToReceiveXMR.text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
validator: RegExpValidator {
|
|
|
|
regExp: /^\s*(\d{1,8})?([\.,]\d{1,12})?\s*$/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Label {
|
|
|
|
Layout.bottomMargin: 3
|
|
|
|
fontSize: 14
|
|
|
|
text: "XMR"
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Label {
|
|
|
|
id: txDescription
|
|
|
|
Layout.bottomMargin: 3
|
|
|
|
Layout.preferredWidth: 90
|
|
|
|
fontSize: 14
|
|
|
|
text: qsTr("Description") + translationManager.emptyString
|
|
|
|
tooltip: qsTr("What is being payed for (a product, service, donation) (optional)") + translationManager.emptyString
|
|
|
|
tooltipIconVisible: true
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Input {
|
|
|
|
id: txDescriptionInput
|
|
|
|
Layout.preferredWidth: 165
|
|
|
|
Layout.maximumWidth: 165
|
2021-10-21 00:28:21 +00:00
|
|
|
maximumLength: 800
|
2021-07-31 08:42:13 +00:00
|
|
|
topPadding: 7
|
|
|
|
leftPadding: 7
|
|
|
|
font.pixelSize: 14
|
|
|
|
font.bold: false
|
|
|
|
horizontalAlignment: TextInput.AlignLeft
|
|
|
|
verticalAlignment: TextInput.AlignVCenter
|
|
|
|
selectByMouse: true
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
placeholderText: qsTr("Visible to the sender") + translationManager.emptyString
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: MoneroComponents.Style.blackTheme ? "transparent" : "white"
|
|
|
|
radius: 3
|
|
|
|
border.color: parent.activeFocus ? MoneroComponents.Style.inputBorderColorActive : MoneroComponents.Style.inputBorderColorInActive
|
|
|
|
border.width: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Label {
|
|
|
|
Layout.bottomMargin: 3
|
|
|
|
fontSize: 14
|
|
|
|
text: ""
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Label {
|
|
|
|
id: receiverNameLabel
|
|
|
|
Layout.bottomMargin: 3
|
|
|
|
Layout.preferredWidth: 90
|
|
|
|
fontSize: 14
|
|
|
|
text: qsTr("Your name") + translationManager.emptyString
|
|
|
|
tooltip: qsTr("Your name, company or website (optional)") + translationManager.emptyString
|
|
|
|
tooltipIconVisible: true
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Input {
|
|
|
|
id: receiverNameInput
|
|
|
|
Layout.preferredWidth: 165
|
|
|
|
Layout.maximumWidth: 165
|
|
|
|
topPadding: 7
|
|
|
|
leftPadding: 7
|
|
|
|
font.pixelSize: 14
|
|
|
|
font.bold: false
|
|
|
|
horizontalAlignment: TextInput.AlignLeft
|
|
|
|
verticalAlignment: TextInput.AlignVCenter
|
|
|
|
selectByMouse: true
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
placeholderText: qsTr("Visible to the sender") + translationManager.emptyString
|
2021-10-21 00:28:21 +00:00
|
|
|
maximumLength: 100
|
2021-07-31 08:42:13 +00:00
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: MoneroComponents.Style.blackTheme ? "transparent" : "white"
|
|
|
|
radius: 3
|
|
|
|
border.color: parent.activeFocus ? MoneroComponents.Style.inputBorderColorActive : MoneroComponents.Style.inputBorderColorInActive
|
|
|
|
border.width: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.Label {
|
|
|
|
Layout.bottomMargin: 3
|
|
|
|
fontSize: 14
|
|
|
|
text: ""
|
|
|
|
}
|
2021-06-21 15:13:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.TextPlain {
|
|
|
|
id: selectedaddressIndex
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredWidth: 220
|
|
|
|
Layout.maximumWidth: 220
|
|
|
|
Layout.topMargin: 15
|
2021-07-31 08:42:13 +00:00
|
|
|
visible: pageReceive.state == "Address"
|
2021-06-21 15:13:52 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
text: qsTr("Address #") + subaddressListView.currentIndex + translationManager.emptyString
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
|
|
|
font.pixelSize: 17
|
2018-04-27 21:24:41 +00:00
|
|
|
textFormat: Text.RichText
|
2021-06-21 15:13:52 +00:00
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
themeTransition: false
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.TextPlain {
|
|
|
|
id: selectedAddressDrescription
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredWidth: 220
|
|
|
|
Layout.maximumWidth: 220
|
|
|
|
Layout.topMargin: 10
|
2021-07-31 08:42:13 +00:00
|
|
|
visible: pageReceive.state == "Address"
|
2021-06-21 15:13:52 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
text: "(" + qsTr("no label") + ")" + translationManager.emptyString
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
|
|
|
font.pixelSize: 17
|
|
|
|
textFormat: Text.RichText
|
|
|
|
color: selectedAddressDrescriptionMouseArea.containsMouse ? MoneroComponents.Style.orange : MoneroComponents.Style.dimmedFontColor
|
|
|
|
themeTransition: false
|
|
|
|
tooltip: subaddressListView.currentIndex > 0 ? qsTr("Edit address label") : "" + translationManager.emptyString
|
|
|
|
MouseArea {
|
|
|
|
id: selectedAddressDrescriptionMouseArea
|
|
|
|
visible: subaddressListView.currentIndex > 0
|
|
|
|
hoverEnabled: true
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onEntered: parent.tooltip ? parent.tooltipPopup.open() : ""
|
|
|
|
onExited: parent.tooltip ? parent.tooltipPopup.close() : ""
|
|
|
|
onClicked: {
|
|
|
|
renameSubaddressLabel(appWindow.current_subaddress_table_index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.TextPlain {
|
|
|
|
id: selectedAddress
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.maximumWidth: 300
|
|
|
|
Layout.topMargin: 11
|
2021-07-31 08:42:13 +00:00
|
|
|
visible: pageReceive.state == "Address"
|
2021-06-21 15:13:52 +00:00
|
|
|
text: appWindow.current_address ? appWindow.current_address : ""
|
|
|
|
horizontalAlignment: TextInput.AlignHCenter
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
textFormat: Text.RichText
|
|
|
|
color: selectedAddressMouseArea.containsMouse ? MoneroComponents.Style.orange : MoneroComponents.Style.defaultFontColor
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
|
|
|
themeTransition: false
|
|
|
|
tooltip: qsTr("Copy address to clipboard") + translationManager.emptyString
|
|
|
|
MouseArea {
|
|
|
|
id: selectedAddressMouseArea
|
|
|
|
hoverEnabled: true
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onEntered: parent.tooltip ? parent.tooltipPopup.open() : ""
|
|
|
|
onExited: parent.tooltip ? parent.tooltipPopup.close() : ""
|
|
|
|
onClicked: {
|
|
|
|
clipboard.setText(appWindow.current_address);
|
|
|
|
appWindow.showStatusMessage(qsTr("Address copied to clipboard") + translationManager.emptyString, 3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.StandardButton {
|
|
|
|
Layout.preferredWidth: 220
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.topMargin: 18
|
|
|
|
small: true
|
|
|
|
text: qsTr("Show on device") + translationManager.emptyString
|
|
|
|
fontSize: 14
|
|
|
|
visible: appWindow.currentWallet ? appWindow.currentWallet.isHwBacked() : false
|
|
|
|
onClicked: {
|
|
|
|
appWindow.currentWallet.deviceShowAddressAsync(
|
|
|
|
appWindow.currentWallet.currentSubaddressAccount,
|
|
|
|
appWindow.current_subaddress_table_index,
|
|
|
|
'');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: addressRow
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
MoneroComponents.LabelSubheader {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
fontSize: 24
|
|
|
|
textFormat: Text.RichText
|
|
|
|
text: qsTr("Addresses") + translationManager.emptyString
|
|
|
|
}
|
|
|
|
|
|
|
|
MoneroComponents.StandardButton {
|
|
|
|
id: createAddressButton
|
|
|
|
small: true
|
|
|
|
text: qsTr("Create new address") + translationManager.emptyString
|
|
|
|
fontSize: 13
|
|
|
|
onClicked: {
|
|
|
|
inputDialog.labelText = qsTr("Set the label of the new address:") + translationManager.emptyString
|
|
|
|
inputDialog.onAcceptedCallback = function() {
|
|
|
|
appWindow.currentWallet.subaddress.addRow(appWindow.currentWallet.currentSubaddressAccount, inputDialog.inputText)
|
|
|
|
current_subaddress_table_index = appWindow.currentWallet.numSubaddresses(appWindow.currentWallet.currentSubaddressAccount) - 1
|
|
|
|
subaddressListView.currentIndex = current_subaddress_table_index
|
|
|
|
}
|
|
|
|
inputDialog.onRejectedCallback = null;
|
|
|
|
inputDialog.open()
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.top: createAddressButton.bottom
|
|
|
|
anchors.topMargin: 8
|
|
|
|
anchors.left: createAddressButton.left
|
|
|
|
anchors.right: createAddressButton.right
|
|
|
|
height: 2
|
|
|
|
color: MoneroComponents.Style.appWindowBorderColor
|
|
|
|
|
|
|
|
MoneroEffects.ColorTransition {
|
|
|
|
targetObj: parent
|
|
|
|
blackColor: MoneroComponents.Style._b_appWindowBorderColor
|
|
|
|
whiteColor: MoneroComponents.Style._w_appWindowBorderColor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-04-27 21:24:41 +00:00
|
|
|
}
|
2018-03-19 01:42:46 +00:00
|
|
|
|
2018-04-27 21:24:41 +00:00
|
|
|
ColumnLayout {
|
2018-04-27 22:37:09 +00:00
|
|
|
id: subaddressListRow
|
2019-04-25 19:09:23 +00:00
|
|
|
property int subaddressListItemHeight: 50
|
|
|
|
Layout.topMargin: 6
|
2018-04-27 21:24:41 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.minimumWidth: 240
|
2018-04-27 22:37:09 +00:00
|
|
|
Layout.preferredHeight: subaddressListItemHeight * subaddressListView.count
|
|
|
|
visible: subaddressListView.count >= 1
|
2018-03-19 01:42:46 +00:00
|
|
|
|
2018-04-27 21:24:41 +00:00
|
|
|
ListView {
|
|
|
|
id: subaddressListView
|
|
|
|
Layout.fillWidth: true
|
2019-07-21 19:51:47 +00:00
|
|
|
Layout.fillHeight: true
|
2018-04-27 21:24:41 +00:00
|
|
|
clip: true
|
|
|
|
boundsBehavior: ListView.StopAtBounds
|
2019-04-16 09:09:46 +00:00
|
|
|
interactive: false
|
|
|
|
|
2018-04-27 21:24:41 +00:00
|
|
|
delegate: Rectangle {
|
|
|
|
id: tableItem2
|
2018-04-27 22:37:09 +00:00
|
|
|
height: subaddressListRow.subaddressListItemHeight
|
2020-06-12 01:09:18 +00:00
|
|
|
width: parent ? parent.width : undefined
|
2018-04-27 21:24:41 +00:00
|
|
|
Layout.fillWidth: true
|
2020-10-17 10:19:46 +00:00
|
|
|
color: itemMouseArea.containsMouse || index === appWindow.current_subaddress_table_index ? MoneroComponents.Style.titleBarButtonHoverColor : "transparent"
|
2018-04-27 21:24:41 +00:00
|
|
|
|
2021-07-23 05:47:48 +00:00
|
|
|
Rectangle {
|
|
|
|
visible: index === appWindow.current_subaddress_table_index
|
|
|
|
Layout.fillHeight: true
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
color: "darkgrey"
|
|
|
|
width: 2
|
|
|
|
}
|
|
|
|
|
2018-04-27 21:24:41 +00:00
|
|
|
Rectangle{
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
height: 1
|
2019-04-11 01:17:29 +00:00
|
|
|
color: MoneroComponents.Style.appWindowBorderColor
|
2018-04-27 21:24:41 +00:00
|
|
|
visible: index !== 0
|
2019-04-11 01:17:29 +00:00
|
|
|
|
|
|
|
MoneroEffects.ColorTransition {
|
|
|
|
targetObj: parent
|
|
|
|
blackColor: MoneroComponents.Style._b_appWindowBorderColor
|
|
|
|
whiteColor: MoneroComponents.Style._w_appWindowBorderColor
|
|
|
|
}
|
2018-04-27 21:24:41 +00:00
|
|
|
}
|
2018-03-19 01:42:46 +00:00
|
|
|
|
2018-04-27 21:24:41 +00:00
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
2018-12-19 23:06:23 +00:00
|
|
|
anchors.topMargin: 5
|
2020-11-07 22:05:33 +00:00
|
|
|
anchors.rightMargin: 90
|
2018-04-27 21:24:41 +00:00
|
|
|
color: "transparent"
|
2018-03-19 01:42:46 +00:00
|
|
|
|
2018-12-08 15:55:29 +00:00
|
|
|
MoneroComponents.Label {
|
2018-04-27 21:24:41 +00:00
|
|
|
id: idLabel
|
2019-04-11 01:17:29 +00:00
|
|
|
color: index === appWindow.current_subaddress_table_index ? MoneroComponents.Style.defaultFontColor : "#757575"
|
2018-04-27 21:24:41 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: parent.left
|
2019-04-25 19:09:23 +00:00
|
|
|
anchors.leftMargin: 6
|
2019-04-16 09:09:46 +00:00
|
|
|
fontSize: 16
|
2018-04-27 21:24:41 +00:00
|
|
|
text: "#" + index
|
2019-04-11 01:17:29 +00:00
|
|
|
themeTransition: false
|
2018-04-27 21:24:41 +00:00
|
|
|
}
|
2018-03-19 01:42:46 +00:00
|
|
|
|
2018-12-08 15:55:29 +00:00
|
|
|
MoneroComponents.Label {
|
2018-04-27 21:24:41 +00:00
|
|
|
id: nameLabel
|
2020-10-17 10:19:46 +00:00
|
|
|
color: index === appWindow.current_subaddress_table_index ? MoneroComponents.Style.defaultFontColor : MoneroComponents.Style.dimmedFontColor
|
2018-04-27 21:24:41 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: idLabel.right
|
2019-04-25 19:09:23 +00:00
|
|
|
anchors.leftMargin: 6
|
2019-04-16 09:09:46 +00:00
|
|
|
fontSize: 16
|
2018-04-27 21:24:41 +00:00
|
|
|
text: label
|
2019-01-22 14:51:37 +00:00
|
|
|
elide: Text.ElideRight
|
|
|
|
textWidth: addressLabel.x - nameLabel.x - 1
|
2019-04-11 01:17:29 +00:00
|
|
|
themeTransition: false
|
2018-04-27 21:24:41 +00:00
|
|
|
}
|
2018-03-19 01:42:46 +00:00
|
|
|
|
2018-12-08 15:55:29 +00:00
|
|
|
MoneroComponents.Label {
|
2019-01-22 14:51:37 +00:00
|
|
|
id: addressLabel
|
2019-04-11 01:17:29 +00:00
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
2018-04-27 21:24:41 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2019-01-22 14:51:37 +00:00
|
|
|
anchors.left: parent.right
|
2019-04-16 09:09:46 +00:00
|
|
|
anchors.leftMargin: -addressLabel.width - 5
|
|
|
|
fontSize: 16
|
|
|
|
fontFamily: MoneroComponents.Style.fontMonoRegular.name;
|
|
|
|
text: TxUtils.addressTruncatePretty(address, mainLayout.width < 520 ? 1 : (mainLayout.width < 650 ? 2 : 3))
|
2019-04-11 01:17:29 +00:00
|
|
|
themeTransition: false
|
2018-04-27 21:24:41 +00:00
|
|
|
}
|
2018-03-19 01:42:46 +00:00
|
|
|
|
2019-01-22 14:51:37 +00:00
|
|
|
MouseArea {
|
2020-10-17 10:19:46 +00:00
|
|
|
id: itemMouseArea
|
2018-04-27 21:24:41 +00:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
2019-04-11 01:17:29 +00:00
|
|
|
onClicked: subaddressListView.currentIndex = index;
|
2018-04-27 21:24:41 +00:00
|
|
|
}
|
|
|
|
}
|
2018-04-27 22:37:09 +00:00
|
|
|
|
2019-04-16 09:09:46 +00:00
|
|
|
RowLayout {
|
2018-04-27 22:37:09 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2019-01-22 14:51:37 +00:00
|
|
|
anchors.right: parent.right
|
2019-04-16 09:09:46 +00:00
|
|
|
anchors.rightMargin: 6
|
2019-04-11 01:17:29 +00:00
|
|
|
height: 21
|
2019-04-16 09:09:46 +00:00
|
|
|
spacing: 10
|
2018-04-27 22:37:09 +00:00
|
|
|
|
2020-11-07 22:05:33 +00:00
|
|
|
MoneroComponents.IconButton {
|
|
|
|
fontAwesomeFallbackIcon: FontAwesome.searchPlus
|
|
|
|
fontAwesomeFallbackSize: 22
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
fontAwesomeFallbackOpacity: 0.5
|
|
|
|
Layout.preferredWidth: 23
|
|
|
|
Layout.preferredHeight: 21
|
2021-06-02 14:43:11 +00:00
|
|
|
tooltip: qsTr("See transactions") + translationManager.emptyString
|
2020-11-07 22:05:33 +00:00
|
|
|
|
|
|
|
onClicked: doSearchInHistory(address)
|
|
|
|
}
|
|
|
|
|
2019-04-16 09:09:46 +00:00
|
|
|
MoneroComponents.IconButton {
|
|
|
|
id: renameButton
|
|
|
|
image: "qrc:///images/edit.svg"
|
2021-04-21 01:57:39 +00:00
|
|
|
fontAwesomeFallbackIcon: FontAwesome.edit
|
|
|
|
fontAwesomeFallbackSize: 22
|
2019-04-16 09:09:46 +00:00
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
2021-05-21 01:32:43 +00:00
|
|
|
opacity: isOpenGL ? 0.5 : 1
|
|
|
|
fontAwesomeFallbackOpacity: 0.5
|
2019-04-16 09:09:46 +00:00
|
|
|
Layout.preferredWidth: 23
|
|
|
|
Layout.preferredHeight: 21
|
|
|
|
visible: index !== 0
|
2021-05-19 16:36:44 +00:00
|
|
|
tooltip: qsTr("Edit address label") + translationManager.emptyString
|
2019-04-16 09:09:46 +00:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
renameSubaddressLabel(index);
|
|
|
|
}
|
2018-04-27 22:37:09 +00:00
|
|
|
}
|
|
|
|
|
2019-04-16 09:09:46 +00:00
|
|
|
MoneroComponents.IconButton {
|
|
|
|
id: copyButton
|
|
|
|
image: "qrc:///images/copy.svg"
|
2021-04-21 01:57:39 +00:00
|
|
|
fontAwesomeFallbackIcon: FontAwesome.clipboard
|
|
|
|
fontAwesomeFallbackSize: 22
|
2019-04-16 09:09:46 +00:00
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
2021-05-21 01:32:43 +00:00
|
|
|
opacity: isOpenGL ? 0.5 : 1
|
|
|
|
fontAwesomeFallbackOpacity: 0.5
|
2019-04-16 09:09:46 +00:00
|
|
|
Layout.preferredWidth: 16
|
|
|
|
Layout.preferredHeight: 21
|
2021-05-19 16:36:44 +00:00
|
|
|
tooltip: qsTr("Copy address to clipboard") + translationManager.emptyString
|
2019-04-16 09:09:46 +00:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
console.log("Address copied to clipboard");
|
|
|
|
clipboard.setText(address);
|
|
|
|
appWindow.showStatusMessage(qsTr("Address copied to clipboard"),3);
|
|
|
|
}
|
2018-04-27 22:37:09 +00:00
|
|
|
}
|
|
|
|
}
|
2018-04-27 21:24:41 +00:00
|
|
|
}
|
2017-07-04 03:34:09 +00:00
|
|
|
onCurrentItemChanged: {
|
2018-04-27 21:24:41 +00:00
|
|
|
// reset global vars
|
2018-12-08 15:55:29 +00:00
|
|
|
appWindow.current_subaddress_table_index = subaddressListView.currentIndex;
|
|
|
|
appWindow.current_address = appWindow.currentWallet.address(
|
2018-04-27 21:24:41 +00:00
|
|
|
appWindow.currentWallet.currentSubaddressAccount,
|
|
|
|
subaddressListView.currentIndex
|
|
|
|
);
|
2021-06-21 15:13:52 +00:00
|
|
|
if (subaddressListView.currentIndex == 0) {
|
|
|
|
selectedAddressDrescription.text = qsTr("Primary address") + translationManager.emptyString;
|
|
|
|
} else {
|
|
|
|
var selectedAddressLabel = appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, appWindow.current_subaddress_table_index);
|
|
|
|
if (selectedAddressLabel == "") {
|
|
|
|
selectedAddressDrescription.text = "(" + qsTr("no label") + ")" + translationManager.emptyString
|
|
|
|
} else {
|
|
|
|
selectedAddressDrescription.text = selectedAddressLabel
|
|
|
|
}
|
|
|
|
}
|
2017-07-04 03:34:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-10-03 23:14:09 +00:00
|
|
|
|
2019-01-22 14:51:37 +00:00
|
|
|
Rectangle {
|
2019-04-11 01:17:29 +00:00
|
|
|
color: MoneroComponents.Style.appWindowBorderColor
|
2018-04-27 22:37:09 +00:00
|
|
|
Layout.fillWidth: true
|
2019-01-22 14:51:37 +00:00
|
|
|
height: 1
|
2019-04-11 01:17:29 +00:00
|
|
|
|
|
|
|
MoneroEffects.ColorTransition {
|
|
|
|
targetObj: parent
|
|
|
|
blackColor: MoneroComponents.Style._b_appWindowBorderColor
|
|
|
|
whiteColor: MoneroComponents.Style._w_appWindowBorderColor
|
|
|
|
}
|
2019-01-22 14:51:37 +00:00
|
|
|
}
|
2016-11-27 10:57:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MessageDialog {
|
2018-04-27 22:37:09 +00:00
|
|
|
id: receivePageDialog
|
2016-11-27 10:57:13 +00:00
|
|
|
standardButtons: StandardButton.Ok
|
|
|
|
}
|
|
|
|
|
2017-01-23 04:15:49 +00:00
|
|
|
FileDialog {
|
|
|
|
id: qrFileDialog
|
2019-04-16 14:35:30 +00:00
|
|
|
title: qsTr("Please choose a name") + translationManager.emptyString
|
2017-01-23 04:15:49 +00:00
|
|
|
folder: shortcuts.pictures
|
|
|
|
selectExisting: false
|
2018-04-25 19:43:01 +00:00
|
|
|
nameFilters: ["Image (*.png)"]
|
2017-01-23 04:15:49 +00:00
|
|
|
onAccepted: {
|
2021-07-31 08:42:13 +00:00
|
|
|
if(!walletManager.saveQrCode(generateQRCodeString(), walletManager.urlToLocalPath(fileUrl))) {
|
2017-01-23 04:15:49 +00:00
|
|
|
console.log("Failed to save QrCode to file " + walletManager.urlToLocalPath(fileUrl) )
|
2018-04-27 22:37:09 +00:00
|
|
|
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()
|
2021-07-31 08:42:13 +00:00
|
|
|
} else {
|
|
|
|
appWindow.showStatusMessage(qsTr("QR code saved to ") + walletManager.urlToLocalPath(fileUrl) + translationManager.emptyString, 3);
|
2017-01-23 04:15:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-06-26 15:04:45 +00:00
|
|
|
}
|
|
|
|
|
2016-10-04 10:15:29 +00:00
|
|
|
function onPageCompleted() {
|
2016-06-26 15:04:45 +00:00
|
|
|
console.log("Receive page loaded");
|
2021-07-31 08:42:13 +00:00
|
|
|
pageReceive.clearFields();
|
2018-04-27 21:24:41 +00:00
|
|
|
subaddressListView.model = appWindow.currentWallet.subaddressModel;
|
2016-10-04 10:15:29 +00:00
|
|
|
|
2017-03-18 22:01:00 +00:00
|
|
|
if (appWindow.currentWallet) {
|
2018-12-08 15:55:29 +00:00
|
|
|
appWindow.current_address = appWindow.currentWallet.address(appWindow.currentWallet.currentSubaddressAccount, 0)
|
2017-07-04 03:34:09 +00:00
|
|
|
appWindow.currentWallet.subaddress.refresh(appWindow.currentWallet.currentSubaddressAccount)
|
2021-06-21 15:13:52 +00:00
|
|
|
if (subaddressListView.currentIndex == -1) {
|
|
|
|
subaddressListView.currentIndex = 0;
|
|
|
|
}
|
2016-10-04 10:15:29 +00:00
|
|
|
}
|
2016-06-26 15:04:45 +00:00
|
|
|
}
|
|
|
|
|
2018-12-18 19:06:29 +00:00
|
|
|
function clearFields() {
|
2021-07-31 08:42:13 +00:00
|
|
|
amountToReceiveFiat.text = "";
|
|
|
|
amountToReceiveXMR.text = "";
|
|
|
|
txDescriptionInput.text = "";
|
|
|
|
receiverNameInput.text = "";
|
2018-12-18 19:06:29 +00:00
|
|
|
}
|
|
|
|
|
2016-11-27 10:57:13 +00:00
|
|
|
function onPageClosed() {
|
|
|
|
}
|
2016-06-26 15:04:45 +00:00
|
|
|
}
|