From 38d9034470e254820c74af5b4be97c866b4a95c1 Mon Sep 17 00:00:00 2001 From: Jacob Brydolf Date: Sat, 8 Oct 2016 01:48:42 +0200 Subject: [PATCH] Wizard: added restore-height --- wizard/WizardCreateWallet.qml | 1 + wizard/WizardManageWalletUI.qml | 20 ++++++++++++++++++-- wizard/WizardRecoveryWallet.qml | 5 ++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/wizard/WizardCreateWallet.qml b/wizard/WizardCreateWallet.qml index 8506a8e7..6d632cbe 100644 --- a/wizard/WizardCreateWallet.qml +++ b/wizard/WizardCreateWallet.qml @@ -96,5 +96,6 @@ Item { wordsTextItem.clipboardButtonVisible: true wordsTextItem.tipTextVisible: true wordsTextItem.memoTextReadOnly: true + restoreHeightVisible:false } } diff --git a/wizard/WizardManageWalletUI.qml b/wizard/WizardManageWalletUI.qml index ede68b13..7104dc9f 100644 --- a/wizard/WizardManageWalletUI.qml +++ b/wizard/WizardManageWalletUI.qml @@ -29,6 +29,8 @@ import QtQuick 2.2 import moneroComponents.TranslationManager 1.0 import QtQuick.Dialogs 1.2 +import QtQuick.Layouts 1.1 +import "../components" // Reusable component for managing wallet (account name, path, private key) @@ -39,6 +41,8 @@ Item { property alias wordsTextTitle: frameHeader.text property alias walletPath: fileUrlInput.text property alias wordsTextItem : memoTextItem + property alias restoreHeight : restoreHeightItem.text + property alias restoreHeightVisible: restoreHeightItem.visible // TODO extend properties if needed @@ -112,7 +116,7 @@ Item { width: 300 height: 62 - TextInput { + TextEdit { id: accountName anchors.fill: parent horizontalAlignment: TextInput.AlignHCenter @@ -159,10 +163,22 @@ Item { anchors.topMargin: 16 } + // Restore Height + LineEdit { + id: restoreHeightItem + anchors.top: memoTextItem.bottom + width: 250 + anchors.topMargin: 20 + placeholderText: qsTr("Restore height") + Layout.alignment: Qt.AlignCenter + validator: IntValidator { + bottom:0 + } + } Row { anchors.left: parent.left anchors.right: parent.right - anchors.top: memoTextItem.bottom + anchors.top: (restoreHeightItem.visible)? restoreHeightItem.bottom : memoTextItem.bottom anchors.topMargin: 24 spacing: 16 diff --git a/wizard/WizardRecoveryWallet.qml b/wizard/WizardRecoveryWallet.qml index 00cf2440..7f6d87f4 100644 --- a/wizard/WizardRecoveryWallet.qml +++ b/wizard/WizardRecoveryWallet.qml @@ -54,12 +54,14 @@ Item { settingsObject['account_name'] = uiItem.accountNameText settingsObject['words'] = Utils.lineBreaksToSpaces(uiItem.wordsTextItem.memoText) settingsObject['wallet_path'] = uiItem.walletPath + settingsObject['restoreHeight'] = parseInt(uiItem.restoreHeight) return recoveryWallet(settingsObject) } function recoveryWallet(settingsObject) { var testnet = appWindow.persistentSettings.testnet; - var wallet = walletManager.recoveryWallet(oshelper.temporaryFilename(), settingsObject.words, testnet); + var restoreHeight = settingsObject.restoreHeight; + var wallet = walletManager.recoveryWallet(oshelper.temporaryFilename(), settingsObject.words, testnet, restoreHeight); var success = wallet.status === Wallet.Status_Ok; if (success) { settingsObject['wallet'] = wallet; @@ -80,6 +82,7 @@ Item { wordsTextItem.tipTextVisible: false wordsTextItem.memoTextReadOnly: false wordsTextItem.memoText: "" + restoreHeightVisible: true wordsTextItem.onMemoTextChanged: { checkNextButton(); }