password page: checking if passwords match. merged "configuration" and

"donation" pages into one
This commit is contained in:
Ilya Kitaev 2016-01-26 00:17:55 +03:00
parent 29f3abdeac
commit 78b556575a
7 changed files with 115 additions and 106 deletions

View File

@ -29,7 +29,6 @@ QML_IMPORT_PATH =
include(deployment.pri)
# copy language files (xml and images) to the output directory
copydata.commands = $(COPY_DIR) $$shell_path($$PWD/lang) $$shell_path($$DESTDIR/lang)
QMAKE_EXTRA_TARGETS += copydata
POST_TARGETDEPS += copydata

View File

@ -95,5 +95,6 @@
<file>wizard/WizardConfigure.qml</file>
<file>wizard/WizardDonation.qml</file>
<file>wizard/WizardFinish.qml</file>
<file>wizard/WizardPasswordInput.qml</file>
</qresource>
</RCC>

View File

@ -149,5 +149,33 @@ Item {
"as a percentage of that fee, to your transaction to support Monero development. For instance, a 50% " +
"autodonation take a transaction fee of 0.005 XMR and add a 0.0025 XMR to support Monero development.")
}
Column {
anchors.left: parent.left
anchors.right: parent.right
spacing: 12
CheckBox {
text: qsTr("Allow background mining?")
anchors.left: parent.left
anchors.right: parent.right
background: "#F0EEEE"
fontColor: "#4A4646"
fontSize: 18
checkedIcon: "../images/checkedVioletIcon.png"
uncheckedIcon: "../images/uncheckedIcon.png"
checked: true
}
Text {
anchors.left: parent.left
anchors.right: parent.right
font.family: "Arial"
font.pixelSize: 15
color: "#4A4646"
wrapMode: Text.Wrap
text: qsTr("Mining secures the Monero network, and also pays a small reward for the work done. This option " +
"will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working.")
}
}
}
}

View File

@ -31,11 +31,34 @@ import "../components"
Rectangle {
id: wizard
property alias nextButton : nextButton
signal useMoneroClicked()
border.color: "#DBDBDB"
border.width: 1
color: "#FFFFFF"
function switchPage(next) {
if(next === false) {
if(currentPage > 0) {
pages[currentPage].opacity = 0
pages[--currentPage].opacity = 1
}
} else {
if(currentPage < pages.length - 1) {
pages[currentPage].opacity = 0
pages[++currentPage].opacity = 1
}
}
// disallow "next" button until password matches
if (pages[currentPage] === passwordPage) {
nextButton.visible = passwordPage.passwordValid
}
}
Rectangle {
id: nextButton
anchors.verticalCenter: parent.verticalCenter
@ -62,28 +85,8 @@ Rectangle {
}
property int currentPage: 0
function switchPage(next) {
var pages = new Array()
pages[0] = welcomePage
pages[1] = optionsPage
pages[2] = createWalletPage
pages[3] = passwordPage
pages[4] = configurePage
pages[5] = donationPage
pages[6] = finishPage
property var pages: [welcomePage, optionsPage, createWalletPage, passwordPage, /*configurePage,*/ donationPage, finishPage ]
if(next === false) {
if(currentPage > 0) {
pages[currentPage].opacity = 0
pages[--currentPage].opacity = 1
}
} else {
if(currentPage < pages.length - 1) {
pages[currentPage].opacity = 0
pages[++currentPage].opacity = 1
}
}
}
WizardWelcome {
id: welcomePage
@ -126,15 +129,15 @@ Rectangle {
anchors.rightMargin: 50
}
WizardConfigure {
id: configurePage
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: nextButton.left
anchors.left: prevButton.right
anchors.leftMargin: 50
anchors.rightMargin: 50
}
// WizardConfigure {
// id: configurePage
// anchors.top: parent.top
// anchors.bottom: parent.bottom
// anchors.right: nextButton.left
// anchors.left: prevButton.right
// anchors.leftMargin: 50
// anchors.rightMargin: 50
// }
WizardDonation {
id: donationPage
@ -192,7 +195,7 @@ Rectangle {
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
visible: parent.currentPage === 6
visible: parent.pages[currentPage] === finishPage
onClicked: wizard.useMoneroClicked()
}
}

View File

@ -137,35 +137,5 @@ Item {
text: qsTr("I want to recover my account<br/>from my 24 work seed")
}
}
Column {
anchors.verticalCenter: parent.verticalCenter
spacing: 30
Rectangle {
width: 202; height: 202
radius: 101
color: openAccountArea.containsMouse ? "#DBDBDB" : "#FFFFFF"
Image {
anchors.centerIn: parent
source: "qrc:///images/openAccount.png"
}
MouseArea {
id: openAccountArea
anchors.fill: parent
hoverEnabled: true
}
}
Text {
font.family: "Arial"
font.pixelSize: 16
color: "#4A4949"
horizontalAlignment: Text.AlignHCenter
text: qsTr("I want to open account file")
}
}
}
}

View File

@ -38,6 +38,18 @@ Item {
onOpacityChanged: visible = opacity !== 0
function handlePassword() {
// allow to forward step only if passwords match
// print("pass1: ", passwordItem.password)
// print("pass2: ", retypePasswordItem.password)
// TODO: update password strength
wizard.nextButton.visible = passwordItem.password === retypePasswordItem.password
}
property bool passwordValid : passwordItem.password != ''
&& passwordItem.password === retypePasswordItem.password
Row {
id: dotsRow
anchors.top: parent.top
@ -97,36 +109,18 @@ Item {
}
}
Item {
WizardPasswordInput {
id: passwordItem
anchors.top: headerColumn.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 24
width: 300
height: 62
TextInput {
anchors.fill: parent
horizontalAlignment: TextInput.AlignHCenter
verticalAlignment: TextInput.AlignVCenter
font.family: "Arial"
font.pixelSize: 32
renderType: Text.NativeRendering
color: "#35B05A"
passwordCharacter: "•"
echoMode: TextInput.Password
focus: true
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 1
color: "#DBDBDB"
}
onChanged: handlePassword()
}
PrivacyLevelSmall {
id: privacyLevel
anchors.left: parent.left
@ -137,33 +131,13 @@ Item {
interactive: false
}
Item {
WizardPasswordInput {
id: retypePasswordItem
anchors.top: privacyLevel.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 24
width: 300
height: 62
TextInput {
anchors.fill: parent
horizontalAlignment: TextInput.AlignHCenter
verticalAlignment: TextInput.AlignVCenter
font.family: "Arial"
font.pixelSize: 32
renderType: Text.NativeRendering
color: "#35B05A"
passwordCharacter: "•"
echoMode: TextInput.Password
focus: true
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 1
color: "#DBDBDB"
}
onChanged: handlePassword()
}
}

View File

@ -0,0 +1,34 @@
// WizardPasswordInput.qml
import QtQuick 2.0
Item {
property alias password: password.text
signal changed(string password)
TextInput {
id : password
anchors.fill: parent
horizontalAlignment: TextInput.AlignHCenter
verticalAlignment: TextInput.AlignVCenter
font.family: "Arial"
font.pixelSize: 32
renderType: Text.NativeRendering
color: "#35B05A"
passwordCharacter: "•"
echoMode: TextInput.Password
focus: true
Keys.onReleased: {
changed(text)
}
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 1
color: "#DBDBDB"
}
}