aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-09-05 12:54:13 -0400
committerluigi1111 <luigi1111w@gmail.com>2021-09-05 12:54:13 -0400
commit35aee155d79be7c2336e7d02e2419af12e01c6e1 (patch)
tree744ec73c3ec058ecc2f50896e30e13c0f8252fb9 /pages
parentd93af5a4696143c521dceced3fe2cfc3e04674cb (diff)
parent36940f07c9de9a2acbe64771f64646002c739a1c (diff)
downloadmonzero-gui-35aee155d79be7c2336e7d02e2419af12e01c6e1.tar.gz
monzero-gui-35aee155d79be7c2336e7d02e2419af12e01c6e1.tar.xz
monzero-gui-35aee155d79be7c2336e7d02e2419af12e01c6e1.zip
Merge pull request #3435
36940f0 Transfer: add support for outputs import / export (selsta) e36b166 Wallet: import / export output function (tobtoht)
Diffstat (limited to 'pages')
-rw-r--r--pages/Transfer.qml61
1 files changed, 61 insertions, 0 deletions
diff --git a/pages/Transfer.qml b/pages/Transfer.qml
index 86749aba..af0a12c7 100644
--- a/pages/Transfer.qml
+++ b/pages/Transfer.qml
@@ -900,6 +900,32 @@ Rectangle {
AdvancedOptionsItem {
visible: persistentSettings.transferShowAdvanced && appWindow.walletMode >= 2
+ title: qsTr("Outputs") + translationManager.emptyString
+ button1.text: qsTr("Export") + translationManager.emptyString
+ button1.enabled: appWindow.viewOnly
+ button1.onClicked: {
+ console.log("Transfer: export outputs clicked")
+ exportOutputsDialog.open();
+ }
+ button2.text: qsTr("Import") + translationManager.emptyString
+ button2.enabled: !appWindow.viewOnly
+ button2.onClicked: {
+ console.log("Transfer: import outputs clicked")
+ importOutputsDialog.open();
+ }
+ tooltip: {
+ var header = qsTr("Required for cold wallets to sign their corresponding key images") + translationManager.emptyString;
+ return "<style type='text/css'>.header{ font-size: 13px; } p{line-height:20px; margin-top:0px; margin-bottom:0px; " +
+ ";} p.orange{color:#ff9323;}</style>" +
+ "<div class='header'>" + header + "</div>" +
+ "<p>" + qsTr("1. Using view-only wallet, export the outputs into a file") + "</p>" +
+ "<p>" + qsTr("2. Using cold wallet, import the outputs file") + "</p>" +
+ translationManager.emptyString
+ }
+ }
+
+ AdvancedOptionsItem {
+ visible: persistentSettings.transferShowAdvanced && appWindow.walletMode >= 2
title: qsTr("Key images") + translationManager.emptyString
button1.text: qsTr("Export") + translationManager.emptyString
button1.enabled: !appWindow.viewOnly
@@ -1072,6 +1098,41 @@ Rectangle {
}
+ FileDialog {
+ id: exportOutputsDialog
+ selectMultiple: false
+ selectExisting: false
+ onAccepted: {
+ console.log(walletManager.urlToLocalPath(exportOutputsDialog.fileUrl))
+ if (currentWallet.exportOutputs(walletManager.urlToLocalPath(exportOutputsDialog.fileUrl), true)) {
+ appWindow.showStatusMessage(qsTr("Outputs successfully exported to file") + translationManager.emptyString, 3);
+ } else {
+ appWindow.showStatusMessage(currentWallet.errorString, 5);
+ }
+ }
+ onRejected: {
+ console.log("Canceled");
+ }
+ }
+
+ FileDialog {
+ id: importOutputsDialog
+ selectMultiple: false
+ selectExisting: true
+ title: qsTr("Please choose a file") + translationManager.emptyString
+ onAccepted: {
+ console.log(walletManager.urlToLocalPath(importOutputsDialog.fileUrl))
+ if (currentWallet.importOutputs(walletManager.urlToLocalPath(importOutputsDialog.fileUrl))) {
+ appWindow.showStatusMessage(qsTr("Outputs successfully imported to wallet") + translationManager.emptyString, 3);
+ } else {
+ appWindow.showStatusMessage(currentWallet.errorString, 5);
+ }
+ }
+ onRejected: {
+ console.log("Canceled");
+ }
+ }
+
//ExportKeyImagesDialog
FileDialog {
id: exportKeyImagesDialog