aboutsummaryrefslogtreecommitdiff
path: root/main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'main.qml')
-rw-r--r--main.qml25
1 files changed, 25 insertions, 0 deletions
diff --git a/main.qml b/main.qml
index 3b79d1ec..d6109339 100644
--- a/main.qml
+++ b/main.qml
@@ -32,6 +32,7 @@ import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import Qt.labs.settings 1.0
import Bitmonero.Wallet 1.0
+import Bitmonero.PendingTransaction 1.0
import "components"
import "wizard"
@@ -120,6 +121,8 @@ ApplicationWindow {
function initialize() {
+ middlePanel.paymentClicked.connect(handlePayment);
+
if (typeof wizard.settings['wallet'] !== 'undefined') {
wallet = wizard.settings['wallet'];
} else {
@@ -157,6 +160,27 @@ ApplicationWindow {
return wallets.length > 0;
}
+ function handlePayment(address, paymentId, amount, fee, privacyLevel) {
+ console.log("Process payment here: ", address, paymentId, amount, fee, privacyLevel)
+ // TODO: handle payment id
+ // TODO: handle fee;
+ // TODO: handle mixins
+ var amountxmr = walletManager.amountFromString(amount);
+
+ console.log("integer amount: ", amountxmr);
+ var pendingTransaction = wallet.createTransaction(address, amountxmr);
+ if (pendingTransaction.status !== PendingTransaction.Status_Ok) {
+ console.error("Can't create transaction: ", pendingTransaction.errorString);
+ } else {
+ console.log("Transaction created, amount: " + walletManager.displayAmount(pendingTransaction.amount)
+ + ", fee: " + walletManager.displayAmount(pendingTransaction.fee));
+ if (!pendingTransaction.commit()) {
+ console.log("Error committing transaction: " + pendingTransaction.errorString);
+ }
+ }
+ wallet.disposeTransaction(pendingTransaction);
+ }
+
visible: true
width: rightPanelExpanded ? 1269 : 1269 - 300
height: 800
@@ -423,6 +447,7 @@ ApplicationWindow {
}
property var previousPosition
+
onPressed: {
previousPosition = globalCursor.getPosition()
}