Skip to content

Commit

Permalink
restore height visibility enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
mmbyday committed May 15, 2019
1 parent c286c7e commit 7576e69
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 2 deletions.
4 changes: 4 additions & 0 deletions js/Utils.js
Expand Up @@ -108,6 +108,10 @@ function epoch(){
return Math.floor((new Date).getTime()/1000); return Math.floor((new Date).getTime()/1000);
} }


function roundDownToNearestThousand(_num){
return Math.floor(_num/1000.0)*1000
}

function isAlpha(letter){ return letter.match(/^[A-Za-z0-9]+$/) !== null; } function isAlpha(letter){ return letter.match(/^[A-Za-z0-9]+$/) !== null; }


function isLowerCaseChar(letter){ return letter === letter.toLowerCase(); } function isLowerCaseChar(letter){ return letter === letter.toLowerCase(); }
Expand Down
30 changes: 29 additions & 1 deletion pages/Keys.qml
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2018, The Monero Project // Copyright (c) 2014-2019, The Monero Project
// //
// All rights reserved. // All rights reserved.
// //
Expand Down Expand Up @@ -96,6 +96,34 @@ Rectangle {
} }
} }


ColumnLayout {
Layout.fillWidth: true

MoneroComponents.Label {
Layout.fillWidth: true
fontSize: 22
Layout.topMargin: 10
text: qsTr("Wallet restore height") + translationManager.emptyString
}

Rectangle {
Layout.fillWidth: true
height: 2
color: MoneroComponents.Style.dividerColor
opacity: MoneroComponents.Style.dividerOpacity
Layout.bottomMargin: 10
}

MoneroComponents.LineEdit {
Layout.fillWidth: true
readOnly: true
copyButton: true
labelText: qsTr("Block #") + translationManager.emptyString
fontSize: 16
text: currentWallet.walletCreationHeight
}
}

ColumnLayout { ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true


Expand Down
2 changes: 1 addition & 1 deletion pages/settings/SettingsInfo.qml
Expand Up @@ -164,7 +164,7 @@ Rectangle {
id: restoreHeight id: restoreHeight
font.pixelSize: 14 font.pixelSize: 14
textFormat: Text.RichText textFormat: Text.RichText
text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet creation height: ") + translationManager.emptyString text: (typeof currentWallet == "undefined") ? "" : qsTr("Wallet restore height: ") + translationManager.emptyString
} }


MoneroComponents.TextBlock { MoneroComponents.TextBlock {
Expand Down
59 changes: 59 additions & 0 deletions wizard/WizardCreateWallet1.qml
Expand Up @@ -32,6 +32,7 @@ import QtQuick.Layouts 1.2
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0


import "../js/Wizard.js" as Wizard import "../js/Wizard.js" as Wizard
import "../js/Utils.js" as Utils
import "../components" as MoneroComponents import "../components" as MoneroComponents


Rectangle { Rectangle {
Expand Down Expand Up @@ -128,6 +129,63 @@ Rectangle {
} }
} }


ColumnLayout {
spacing: 0

Layout.topMargin: 10
Layout.fillWidth: true

MoneroComponents.LineEditMulti {
id: restoreHeight

spacing: 0
inputPaddingLeft: 16
inputPaddingRight: 16
inputPaddingTop: 20
inputPaddingBottom: 20
inputRadius: 0
fontSize: 18
fontBold: true
wrapMode: Text.WordWrap
labelText: qsTr("Wallet restore height") + translationManager.emptyString
labelFontSize: 14
copyButton: false
readOnly: true
text: Utils.roundDownToNearestThousand(wizardController.m_wallet.walletCreationHeight)
}

MoneroComponents.WarningBox {
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 1
color: MoneroComponents.Style.inputBorderColorInActive
}

Rectangle {
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
height: 1
color: MoneroComponents.Style.inputBorderColorInActive
}

Rectangle {
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 1
color: MoneroComponents.Style.inputBorderColorInActive
}

radius: 0
border.color: MoneroComponents.Style.inputBorderColorInActive
border.width: 0
text: qsTr("Should you restore your wallet in the future, specifying this block number will recover your wallet quicker.") + translationManager.emptyString
}
}

WizardNav { WizardNav {
progressSteps: 4 progressSteps: 4
progress: 1 progress: 1
Expand All @@ -139,6 +197,7 @@ Rectangle {
onNextClicked: { onNextClicked: {
wizardController.walletOptionsName = walletInput.walletName.text; wizardController.walletOptionsName = walletInput.walletName.text;
wizardController.walletOptionsLocation = walletInput.walletLocation.text; wizardController.walletOptionsLocation = walletInput.walletLocation.text;
wizardController.walletOptionsRestoreHeight = restoreHeight.text
wizardStateView.state = "wizardCreateWallet2"; wizardStateView.state = "wizardCreateWallet2";
} }
} }
Expand Down

0 comments on commit 7576e69

Please sign in to comment.