2018-01-07 06:20:45 +01:00
|
|
|
// Copyright (c) 2014-2018, The Monero Project
|
2016-10-04 12:15:29 +02:00
|
|
|
//
|
2016-06-26 17:04:45 +02:00
|
|
|
// All rights reserved.
|
2016-10-04 12:15:29 +02:00
|
|
|
//
|
2016-06-26 17:04:45 +02: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 12:15:29 +02:00
|
|
|
//
|
2016-06-26 17:04:45 +02:00
|
|
|
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
|
|
// conditions and the following disclaimer.
|
2016-10-04 12:15:29 +02:00
|
|
|
//
|
2016-06-26 17:04:45 +02: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 12:15:29 +02:00
|
|
|
//
|
2016-06-26 17:04:45 +02: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 12:15:29 +02:00
|
|
|
//
|
2016-06-26 17:04:45 +02: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 03:17:29 +02:00
|
|
|
import QtQuick 2.9
|
2018-04-02 11:40:42 +02:00
|
|
|
import QtQuick.Controls 2.0
|
2016-06-26 17:04:45 +02:00
|
|
|
import QtQuick.Controls.Styles 1.4
|
|
|
|
import QtQuick.Layouts 1.1
|
2016-11-27 11:57:13 +01:00
|
|
|
import QtQuick.Dialogs 1.2
|
2019-06-17 17:14:13 +02:00
|
|
|
import FontAwesome 1.0
|
2016-06-26 17:04:45 +02:00
|
|
|
|
2018-12-08 16:55:29 +01:00
|
|
|
import "../components" as MoneroComponents
|
2019-04-11 03:17:29 +02:00
|
|
|
import "../components/effects/" as MoneroEffects
|
|
|
|
|
2016-10-02 20:40:40 +02:00
|
|
|
import moneroComponents.Clipboard 1.0
|
2016-11-27 11:57:13 +01:00
|
|
|
import moneroComponents.Wallet 1.0
|
|
|
|
import moneroComponents.WalletManager 1.0
|
|
|
|
import moneroComponents.TransactionHistory 1.0
|
|
|
|
import moneroComponents.TransactionHistoryModel 1.0
|
2017-07-04 05:34:09 +02:00
|
|
|
import moneroComponents.Subaddress 1.0
|
|
|
|
import moneroComponents.SubaddressModel 1.0
|
2018-04-27 23:24:41 +02:00
|
|
|
import "../js/TxUtils.js" as TxUtils
|
2016-06-26 17:04:45 +02:00
|
|
|
|
|
|
|
Rectangle {
|
2017-07-04 05:34:09 +02:00
|
|
|
id: pageReceive
|
2017-12-09 00:01:10 +01:00
|
|
|
color: "transparent"
|
2017-07-04 05:34:09 +02:00
|
|
|
property var model
|
2018-04-28 02:54:12 +02:00
|
|
|
property alias receiveHeight: mainLayout.height
|
2016-11-27 11:57:13 +01:00
|
|
|
|
2018-04-28 00:37:09 +02: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-09 00:44:39 +01:00
|
|
|
inputDialog.open(appWindow.currentWallet.getSubaddressLabel(appWindow.currentWallet.currentSubaddressAccount, _index))
|
2018-04-28 00:37:09 +02:00
|
|
|
}
|
|
|
|
|
2016-06-26 17:04:45 +02:00
|
|
|
Clipboard { id: clipboard }
|
|
|
|
|
|
|
|
/* main layout */
|
|
|
|
ColumnLayout {
|
|
|
|
id: mainLayout
|
2019-09-06 00:11:12 +02:00
|
|
|
anchors.margins: 20
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.topMargin: 40
|
2017-04-03 18:51:55 +02:00
|
|
|
|
2016-06-26 17:04:45 +02:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
2019-04-25 21:09:23 +02:00
|
|
|
spacing: 20
|
2016-06-26 17:04:45 +02:00
|
|
|
|
2017-04-03 18:51:55 +02:00
|
|
|
ColumnLayout {
|
2016-06-26 17:04:45 +02:00
|
|
|
id: addressRow
|
2018-03-19 02:42:46 +01:00
|
|
|
spacing: 0
|
2016-06-26 17:04:45 +02:00
|
|
|
|
2018-12-08 16:55:29 +01:00
|
|
|
MoneroComponents.LabelSubheader {
|
2018-03-19 02:42:46 +01:00
|
|
|
Layout.fillWidth: true
|
2019-04-16 11:09:46 +02:00
|
|
|
fontSize: 24
|
2018-04-27 23:24:41 +02:00
|
|
|
textFormat: Text.RichText
|
2019-04-16 16:35:30 +02:00
|
|
|
text: qsTr("Addresses") + translationManager.emptyString
|
2018-04-27 23:24:41 +02:00
|
|
|
}
|
2018-03-19 02:42:46 +01:00
|
|
|
|
2018-04-27 23:24:41 +02:00
|
|
|
ColumnLayout {
|
2018-04-28 00:37:09 +02:00
|
|
|
id: subaddressListRow
|
2019-04-25 21:09:23 +02:00
|
|
|
property int subaddressListItemHeight: 50
|
|
|
|
Layout.topMargin: 6
|
2018-04-27 23:24:41 +02:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.minimumWidth: 240
|
2018-04-28 00:37:09 +02:00
|
|
|
Layout.preferredHeight: subaddressListItemHeight * subaddressListView.count
|
|
|
|
visible: subaddressListView.count >= 1
|
2018-03-19 02:42:46 +01:00
|
|
|
|
2018-04-27 23:24:41 +02:00
|
|
|
ListView {
|
|
|
|
id: subaddressListView
|
|
|
|
Layout.fillWidth: true
|
2019-07-21 21:51:47 +02:00
|
|
|
Layout.fillHeight: true
|
2018-04-27 23:24:41 +02:00
|
|
|
clip: true
|
|
|
|
boundsBehavior: ListView.StopAtBounds
|
2019-04-16 11:09:46 +02:00
|
|
|
interactive: false
|
|
|
|
|
2018-04-27 23:24:41 +02:00
|
|
|
delegate: Rectangle {
|
|
|
|
id: tableItem2
|
2018-04-28 00:37:09 +02:00
|
|
|
height: subaddressListRow.subaddressListItemHeight
|
2018-04-27 23:24:41 +02:00
|
|
|
width: parent.width
|
|
|
|
Layout.fillWidth: true
|
|
|
|
color: "transparent"
|
|
|
|
|
|
|
|
Rectangle{
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
height: 1
|
2019-04-11 03:17:29 +02:00
|
|
|
color: MoneroComponents.Style.appWindowBorderColor
|
2018-04-27 23:24:41 +02:00
|
|
|
visible: index !== 0
|
2019-04-11 03:17:29 +02:00
|
|
|
|
|
|
|
MoneroEffects.ColorTransition {
|
|
|
|
targetObj: parent
|
|
|
|
blackColor: MoneroComponents.Style._b_appWindowBorderColor
|
|
|
|
whiteColor: MoneroComponents.Style._w_appWindowBorderColor
|
|
|
|
}
|
2018-04-27 23:24:41 +02:00
|
|
|
}
|
2018-03-19 02:42:46 +01:00
|
|
|
|
2018-04-27 23:24:41 +02:00
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
2018-12-20 00:06:23 +01:00
|
|
|
anchors.topMargin: 5
|
2018-04-27 23:24:41 +02:00
|
|
|
anchors.rightMargin: 80
|
|
|
|
color: "transparent"
|
2018-03-19 02:42:46 +01:00
|
|
|
|
2018-12-08 16:55:29 +01:00
|
|
|
MoneroComponents.Label {
|
2018-04-27 23:24:41 +02:00
|
|
|
id: idLabel
|
2019-04-11 03:17:29 +02:00
|
|
|
color: index === appWindow.current_subaddress_table_index ? MoneroComponents.Style.defaultFontColor : "#757575"
|
2018-04-27 23:24:41 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: parent.left
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.leftMargin: 6
|
2019-04-16 11:09:46 +02:00
|
|
|
fontSize: 16
|
2018-04-27 23:24:41 +02:00
|
|
|
text: "#" + index
|
2019-04-11 03:17:29 +02:00
|
|
|
themeTransition: false
|
2018-04-27 23:24:41 +02:00
|
|
|
}
|
2018-03-19 02:42:46 +01:00
|
|
|
|
2018-12-08 16:55:29 +01:00
|
|
|
MoneroComponents.Label {
|
2018-04-27 23:24:41 +02:00
|
|
|
id: nameLabel
|
2019-04-11 03:17:29 +02:00
|
|
|
color: MoneroComponents.Style.dimmedFontColor
|
2018-04-27 23:24:41 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: idLabel.right
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.leftMargin: 6
|
2019-04-16 11:09:46 +02:00
|
|
|
fontSize: 16
|
2018-04-27 23:24:41 +02:00
|
|
|
text: label
|
2019-01-22 15:51:37 +01:00
|
|
|
elide: Text.ElideRight
|
|
|
|
textWidth: addressLabel.x - nameLabel.x - 1
|
2019-04-11 03:17:29 +02:00
|
|
|
themeTransition: false
|
2018-04-27 23:24:41 +02:00
|
|
|
}
|
2018-03-19 02:42:46 +01:00
|
|
|
|
2018-12-08 16:55:29 +01:00
|
|
|
MoneroComponents.Label {
|
2019-01-22 15:51:37 +01:00
|
|
|
id: addressLabel
|
2019-04-11 03:17:29 +02:00
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
2018-04-27 23:24:41 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2019-01-22 15:51:37 +01:00
|
|
|
anchors.left: parent.right
|
2019-04-16 11:09:46 +02: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 03:17:29 +02:00
|
|
|
themeTransition: false
|
2018-04-27 23:24:41 +02:00
|
|
|
}
|
2018-03-19 02:42:46 +01:00
|
|
|
|
2019-01-22 15:51:37 +01:00
|
|
|
MouseArea {
|
2018-04-27 23:24:41 +02:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
2019-04-11 03:17:29 +02:00
|
|
|
onEntered: tableItem2.color = MoneroComponents.Style.titleBarButtonHoverColor
|
|
|
|
onExited: tableItem2.color = "transparent"
|
|
|
|
onClicked: subaddressListView.currentIndex = index;
|
2018-04-27 23:24:41 +02:00
|
|
|
}
|
|
|
|
}
|
2018-04-28 00:37:09 +02:00
|
|
|
|
2019-04-16 11:09:46 +02:00
|
|
|
RowLayout {
|
2018-04-28 00:37:09 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2019-01-22 15:51:37 +01:00
|
|
|
anchors.right: parent.right
|
2019-04-16 11:09:46 +02:00
|
|
|
anchors.rightMargin: 6
|
2019-04-11 03:17:29 +02:00
|
|
|
height: 21
|
2019-04-16 11:09:46 +02:00
|
|
|
spacing: 10
|
2018-04-28 00:37:09 +02:00
|
|
|
|
2019-04-16 11:09:46 +02:00
|
|
|
MoneroComponents.IconButton {
|
|
|
|
id: renameButton
|
|
|
|
image: "qrc:///images/edit.svg"
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
opacity: 0.5
|
|
|
|
Layout.preferredWidth: 23
|
|
|
|
Layout.preferredHeight: 21
|
|
|
|
visible: index !== 0
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
renameSubaddressLabel(index);
|
|
|
|
}
|
2018-04-28 00:37:09 +02:00
|
|
|
}
|
|
|
|
|
2019-04-16 11:09:46 +02:00
|
|
|
MoneroComponents.IconButton {
|
|
|
|
id: copyButton
|
|
|
|
image: "qrc:///images/copy.svg"
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
opacity: 0.5
|
|
|
|
Layout.preferredWidth: 16
|
|
|
|
Layout.preferredHeight: 21
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
console.log("Address copied to clipboard");
|
|
|
|
clipboard.setText(address);
|
|
|
|
appWindow.showStatusMessage(qsTr("Address copied to clipboard"),3);
|
|
|
|
}
|
2018-04-28 00:37:09 +02:00
|
|
|
}
|
|
|
|
}
|
2018-04-27 23:24:41 +02:00
|
|
|
}
|
2017-07-04 05:34:09 +02:00
|
|
|
onCurrentItemChanged: {
|
2018-04-27 23:24:41 +02:00
|
|
|
// reset global vars
|
2018-12-08 16:55:29 +01:00
|
|
|
appWindow.current_subaddress_table_index = subaddressListView.currentIndex;
|
|
|
|
appWindow.current_address = appWindow.currentWallet.address(
|
2018-04-27 23:24:41 +02:00
|
|
|
appWindow.currentWallet.currentSubaddressAccount,
|
|
|
|
subaddressListView.currentIndex
|
|
|
|
);
|
2017-07-04 05:34:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-10-04 01:14:09 +02:00
|
|
|
|
2019-01-22 15:51:37 +01:00
|
|
|
Rectangle {
|
2019-04-11 03:17:29 +02:00
|
|
|
color: MoneroComponents.Style.appWindowBorderColor
|
2018-04-28 00:37:09 +02:00
|
|
|
Layout.fillWidth: true
|
2019-01-22 15:51:37 +01:00
|
|
|
height: 1
|
2019-04-11 03:17:29 +02:00
|
|
|
|
|
|
|
MoneroEffects.ColorTransition {
|
|
|
|
targetObj: parent
|
|
|
|
blackColor: MoneroComponents.Style._b_appWindowBorderColor
|
|
|
|
whiteColor: MoneroComponents.Style._w_appWindowBorderColor
|
|
|
|
}
|
2019-01-22 15:51:37 +01:00
|
|
|
}
|
2018-04-28 00:37:09 +02:00
|
|
|
|
2019-02-27 22:35:27 +01:00
|
|
|
MoneroComponents.CheckBox {
|
|
|
|
id: addNewAddressCheckbox
|
2019-01-22 15:51:37 +01:00
|
|
|
border: false
|
2019-11-25 06:52:13 +01:00
|
|
|
uncheckedIcon: FontAwesome.plusCircle
|
|
|
|
toggleOnClick: false
|
|
|
|
fontAwesomeIcons: true
|
2019-04-16 11:09:46 +02:00
|
|
|
fontSize: 16
|
2019-01-22 15:51:37 +01:00
|
|
|
iconOnTheLeft: true
|
|
|
|
Layout.fillWidth: true
|
2019-04-25 21:09:23 +02:00
|
|
|
Layout.topMargin: 10
|
2019-02-27 22:35:27 +01:00
|
|
|
text: qsTr("Create new address") + translationManager.emptyString;
|
|
|
|
onClicked: {
|
2019-01-22 15:51:37 +01:00
|
|
|
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
|
2019-07-21 21:17:18 +02:00
|
|
|
subaddressListView.currentIndex = current_subaddress_table_index
|
2018-03-19 02:42:46 +01:00
|
|
|
}
|
2019-01-22 15:51:37 +01:00
|
|
|
inputDialog.onRejectedCallback = null;
|
|
|
|
inputDialog.open()
|
2016-06-26 17:04:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-10 15:57:28 +01:00
|
|
|
ColumnLayout {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2019-04-25 21:09:23 +02:00
|
|
|
spacing: 11
|
|
|
|
property int qrSize: 220
|
2016-11-20 13:36:14 +01:00
|
|
|
|
2019-01-10 15:57:28 +01:00
|
|
|
Rectangle {
|
|
|
|
id: qrContainer
|
2019-04-11 03:17:29 +02:00
|
|
|
color: MoneroComponents.Style.blackTheme ? "white" : "transparent"
|
2016-11-20 13:36:14 +01:00
|
|
|
Layout.fillWidth: true
|
2019-01-10 15:57:28 +01:00
|
|
|
Layout.maximumWidth: parent.qrSize
|
|
|
|
Layout.preferredHeight: width
|
2019-04-25 21:09:23 +02:00
|
|
|
radius: 4
|
2018-10-27 14:42:25 +02:00
|
|
|
|
2019-01-10 15:57:28 +01:00
|
|
|
Image {
|
|
|
|
id: qrCode
|
|
|
|
anchors.fill: parent
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.margins: 1
|
2018-04-27 19:49:45 +02:00
|
|
|
|
2019-01-10 15:57:28 +01:00
|
|
|
smooth: false
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
source: "image://qrcode/" + TxUtils.makeQRCodeString(appWindow.current_address)
|
2018-04-25 21:43:01 +02:00
|
|
|
|
2019-01-10 15:57:28 +01:00
|
|
|
MouseArea {
|
2018-04-27 19:49:45 +02:00
|
|
|
anchors.fill: parent
|
2019-01-10 15:57:28 +01:00
|
|
|
acceptedButtons: Qt.RightButton
|
|
|
|
onPressAndHold: qrFileDialog.open()
|
2018-04-25 21:43:01 +02:00
|
|
|
}
|
2019-01-10 15:57:28 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-12 00:36:30 +01:00
|
|
|
MoneroComponents.StandardButton {
|
|
|
|
Layout.preferredWidth: 220
|
|
|
|
small: true
|
|
|
|
text: FontAwesome.save + " %1".arg(qsTr("Save as image")) + translationManager.emptyString
|
|
|
|
label.font.family: FontAwesome.fontFamily
|
|
|
|
fontSize: 13
|
|
|
|
onClicked: qrFileDialog.open()
|
|
|
|
}
|
2018-04-25 21:43:01 +02:00
|
|
|
|
2020-01-12 00:36:30 +01:00
|
|
|
MoneroComponents.StandardButton {
|
|
|
|
Layout.preferredWidth: 220
|
|
|
|
small: true
|
|
|
|
text: FontAwesome.clipboard + " %1".arg(qsTr("Copy to clipboard")) + translationManager.emptyString
|
|
|
|
label.font.family: FontAwesome.fontFamily
|
|
|
|
fontSize: 13
|
|
|
|
onClicked: {
|
|
|
|
clipboard.setText(TxUtils.makeQRCodeString(appWindow.current_address));
|
|
|
|
appWindow.showStatusMessage(qsTr("Copied to clipboard") + translationManager.emptyString, 3);
|
2018-04-25 21:43:01 +02:00
|
|
|
}
|
2020-01-12 00:36:30 +01:00
|
|
|
}
|
2019-06-17 17:14:13 +02:00
|
|
|
|
2020-01-12 00:36:30 +01:00
|
|
|
MoneroComponents.StandardButton {
|
|
|
|
Layout.preferredWidth: 220
|
|
|
|
small: true
|
|
|
|
text: FontAwesome.eye + " %1".arg(qsTr("Show on device")) + translationManager.emptyString
|
|
|
|
label.font.family: FontAwesome.fontFamily
|
|
|
|
fontSize: 13
|
|
|
|
visible: appWindow.currentWallet ? appWindow.currentWallet.isHwBacked() : false
|
|
|
|
onClicked: {
|
|
|
|
appWindow.currentWallet.deviceShowAddressAsync(
|
|
|
|
appWindow.currentWallet.currentSubaddressAccount,
|
|
|
|
appWindow.current_subaddress_table_index,
|
|
|
|
'');
|
2019-06-17 17:14:13 +02:00
|
|
|
}
|
2016-11-27 11:57:13 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MessageDialog {
|
2018-04-28 00:37:09 +02:00
|
|
|
id: receivePageDialog
|
2016-11-27 11:57:13 +01:00
|
|
|
standardButtons: StandardButton.Ok
|
|
|
|
}
|
|
|
|
|
2017-01-23 05:15:49 +01:00
|
|
|
FileDialog {
|
|
|
|
id: qrFileDialog
|
2019-04-16 16:35:30 +02:00
|
|
|
title: qsTr("Please choose a name") + translationManager.emptyString
|
2017-01-23 05:15:49 +01:00
|
|
|
folder: shortcuts.pictures
|
|
|
|
selectExisting: false
|
2018-04-25 21:43:01 +02:00
|
|
|
nameFilters: ["Image (*.png)"]
|
2017-01-23 05:15:49 +01:00
|
|
|
onAccepted: {
|
2018-12-08 16:55:29 +01:00
|
|
|
if(!walletManager.saveQrCode(TxUtils.makeQRCodeString(appWindow.current_address), walletManager.urlToLocalPath(fileUrl))) {
|
2017-01-23 05:15:49 +01:00
|
|
|
console.log("Failed to save QrCode to file " + walletManager.urlToLocalPath(fileUrl) )
|
2018-04-28 00:37:09 +02: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()
|
2017-01-23 05:15:49 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-06-26 17:04:45 +02:00
|
|
|
}
|
|
|
|
|
2016-10-04 12:15:29 +02:00
|
|
|
function onPageCompleted() {
|
2016-06-26 17:04:45 +02:00
|
|
|
console.log("Receive page loaded");
|
2018-04-27 23:24:41 +02:00
|
|
|
subaddressListView.model = appWindow.currentWallet.subaddressModel;
|
2016-10-04 12:15:29 +02:00
|
|
|
|
2017-03-18 23:01:00 +01:00
|
|
|
if (appWindow.currentWallet) {
|
2018-12-08 16:55:29 +01:00
|
|
|
appWindow.current_address = appWindow.currentWallet.address(appWindow.currentWallet.currentSubaddressAccount, 0)
|
2017-07-04 05:34:09 +02:00
|
|
|
appWindow.currentWallet.subaddress.refresh(appWindow.currentWallet.currentSubaddressAccount)
|
2016-10-04 12:15:29 +02:00
|
|
|
}
|
2016-06-26 17:04:45 +02:00
|
|
|
}
|
|
|
|
|
2018-12-18 20:06:29 +01:00
|
|
|
function clearFields() {
|
2019-01-14 01:02:44 +01:00
|
|
|
// @TODO: add fields
|
2018-12-18 20:06:29 +01:00
|
|
|
}
|
|
|
|
|
2016-11-27 11:57:13 +01:00
|
|
|
function onPageClosed() {
|
|
|
|
}
|
2016-06-26 17:04:45 +02:00
|
|
|
}
|