aboutsummaryrefslogtreecommitdiff
path: root/main.qml
diff options
context:
space:
mode:
authormoneromooo.monero <moneromooo.monero@users.noreply.github.com>2016-11-08 20:23:50 +0000
committermoneromooo.monero <moneromooo.monero@users.noreply.github.com>2016-11-12 19:24:13 +0000
commit2143392b84e089319decee65e63c2376e6fdffd4 (patch)
tree55b1f905ea17a6f79cc6ff15ed27522f22b20ee1 /main.qml
parentb8ea2ffc745edaa250f2da5b65b121469d5045df (diff)
downloadmonzero-gui-2143392b84e089319decee65e63c2376e6fdffd4.tar.gz
monzero-gui-2143392b84e089319decee65e63c2376e6fdffd4.tar.xz
monzero-gui-2143392b84e089319decee65e63c2376e6fdffd4.zip
Add a button to sweep unmixable outputs
Diffstat (limited to 'main.qml')
-rw-r--r--main.qml40
1 files changed, 40 insertions, 0 deletions
diff --git a/main.qml b/main.qml
index 1114a56e..cf355aab 100644
--- a/main.qml
+++ b/main.qml
@@ -157,6 +157,7 @@ ApplicationWindow {
middlePanel.checkPaymentClicked.disconnect(handleCheckPayment);
}
middlePanel.paymentClicked.connect(handlePayment);
+ middlePanel.sweepUnmixableClicked.connect(handleSweepUnmixable);
// basicPanel.paymentClicked.connect(handlePayment);
middlePanel.checkPaymentClicked.connect(handleCheckPayment);
@@ -451,6 +452,45 @@ ApplicationWindow {
currentWallet.createTransactionAsync(address, paymentId, amountxmr, mixinCount, priority);
}
+ function handleSweepUnmixable() {
+ console.log("Creating transaction: ")
+
+ transaction = currentWallet.createSweepUnmixableTransaction();
+ if (transaction.status !== PendingTransaction.Status_Ok) {
+ console.error("Can't create transaction: ", transaction.errorString);
+ informationPopup.title = qsTr("Error") + translationManager.emptyString;
+ informationPopup.text = qsTr("Can't create transaction: ") + transaction.errorString
+ informationPopup.icon = StandardIcon.Critical
+ informationPopup.onCloseCallback = null
+ informationPopup.open();
+ // deleting transaction object, we don't want memleaks
+ currentWallet.disposeTransaction(transaction);
+
+ } else if (transaction.txCount == 0) {
+ informationPopup.title = qsTr("No unmixable outputs to sweep") + translationManager.emptyString
+ informationPopup.text = qsTr("No unmixable outputs to sweep") + translationManager.emptyString
+ informationPopup.icon = StandardIcon.Information
+ informationPopup.onCloseCallback = null
+ informationPopup.open()
+ // deleting transaction object, we don't want memleaks
+ currentWallet.disposeTransaction(transaction);
+ } else {
+ console.log("Transaction created, amount: " + walletManager.displayAmount(transaction.amount)
+ + ", fee: " + walletManager.displayAmount(transaction.fee));
+
+ // here we show confirmation popup;
+
+ transactionConfirmationPopup.title = qsTr("Confirmation") + translationManager.emptyString
+ transactionConfirmationPopup.text = qsTr("Please confirm transaction:\n")
+ + qsTr("\n\nAmount: ") + walletManager.displayAmount(transaction.amount)
+ + qsTr("\nFee: ") + walletManager.displayAmount(transaction.fee)
+ + translationManager.emptyString
+ transactionConfirmationPopup.icon = StandardIcon.Question
+ transactionConfirmationPopup.open()
+ // committing transaction
+ }
+ }
+
// called after user confirms transaction
function handleTransactionConfirmed() {
// grab transaction.txid before commit, since it clears it.