aboutsummaryrefslogtreecommitdiff
path: root/wizard
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-01-26 00:17:55 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-01-26 00:17:55 +0300
commit78b556575a8b6bcd2fb595dc56260b2c4203f637 (patch)
treed9c7ba9ec13873c37eced9d1b21410f0f918af2e /wizard
parent29f3abdeac0df6cf3cfb4e871d33c68fae03dff8 (diff)
downloadmonzero-gui-78b556575a8b6bcd2fb595dc56260b2c4203f637.tar.gz
monzero-gui-78b556575a8b6bcd2fb595dc56260b2c4203f637.tar.xz
monzero-gui-78b556575a8b6bcd2fb595dc56260b2c4203f637.zip
password page: checking if passwords match. merged "configuration" and
"donation" pages into one
Diffstat (limited to 'wizard')
-rw-r--r--wizard/WizardDonation.qml28
-rw-r--r--wizard/WizardMain.qml65
-rw-r--r--wizard/WizardOptions.qml30
-rw-r--r--wizard/WizardPassword.qml62
-rw-r--r--wizard/WizardPasswordInput.qml34
5 files changed, 114 insertions, 105 deletions
diff --git a/wizard/WizardDonation.qml b/wizard/WizardDonation.qml
index a52a53f7..d9954639 100644
--- a/wizard/WizardDonation.qml
+++ b/wizard/WizardDonation.qml
@@ -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.")
+ }
+ }
}
}
diff --git a/wizard/WizardMain.qml b/wizard/WizardMain.qml
index 4ad396c6..a20d654c 100644
--- a/wizard/WizardMain.qml
+++ b/wizard/WizardMain.qml
@@ -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()
}
}
diff --git a/wizard/WizardOptions.qml b/wizard/WizardOptions.qml
index 83a8a863..debdee88 100644
--- a/wizard/WizardOptions.qml
+++ b/wizard/WizardOptions.qml
@@ -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")
- }
- }
}
}
diff --git a/wizard/WizardPassword.qml b/wizard/WizardPassword.qml
index 8c54ad65..2926a9e9 100644
--- a/wizard/WizardPassword.qml
+++ b/wizard/WizardPassword.qml
@@ -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()
}
}
diff --git a/wizard/WizardPasswordInput.qml b/wizard/WizardPasswordInput.qml
new file mode 100644
index 00000000..d2bbf44a
--- /dev/null
+++ b/wizard/WizardPasswordInput.qml
@@ -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"
+ }
+}