@@ -22,10 +22,13 @@ import ".." as LocalComponents
2222
2323LocalComponents.Page {
2424 objectName: "accountPage"
25+ title: i18n.tr("Set Administrator Details")
2526
26− title: i18n.tr("Create Device Account")
27− customTitle: true
28− buttonBarVisible: false
27+ forwardButtonSourceComponent: forwardButton
28+
29+ Component.onCompleted: {
30+ theme.palette.normal.backgroundText = "#cdcdcd";
31+ }
2932
3033 Flickable
3134 {
@@ -35,40 +38,53 @@ LocalComponents.Page {
3538 anchors.fill: content
3639 anchors.leftMargin: parent.leftMargin
3740 anchors.rightMargin: parent.rightMargin
41+ anchors.topMargin: customMargin
42+
43+// // email
44+// Label {
45+// id: emailLabel
46+// anchors.left: parent.left
47+// anchors.right: parent.right
48+// wrapMode: Text.Wrap
49+// text: i18n.tr("Email")
50+// color: textColor
51+// font.weight: Font.Light
52+// }
3853
39− // email
54+// LocalComponents.WizardTextField {
55+// id: emailInput
56+// anchors.left: parent.left
57+// anchors.right: parent.right
58+// anchors.top: emailLabel.bottom
59+// anchors.topMargin: units.gu(1)
60+// inputMethodHints: Qt.ImhEmailCharactersOnly
61+// validator: RegExpValidator {
62+// regExp: /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
63+// }
64+// KeyNavigation.tab: nameInput
65+// }
66+
67+ // notice
4068 Label {
41− id: emailLabel
69+ id: noticeLabel
4270 anchors.left: parent.left
4371 anchors.right: parent.right
4472 wrapMode: Text.Wrap
45− text: i18n.tr("Email")
73+ text: i18n.tr("Please enter a password to create your user account. You need this password to administer your device.")
4674 color: textColor
75+ fontSize: "small"
4776 font.weight: Font.Light
77+ width: content.width
4878 }
4979
50− LocalComponents.WizardTextField {
51− id: emailInput
52− anchors.left: parent.left
53− anchors.right: parent.right
54− anchors.top: emailLabel.bottom
55− anchors.topMargin: units.gu(1)
56− inputMethodHints: Qt.ImhEmailCharactersOnly
57− validator: RegExpValidator {
58− regExp: /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
59− }
60− KeyNavigation.tab: nameInput
61− }
62−
63− // name
80+ // username
6481 Label {
6582 id: nameLabel
6683 anchors.left: parent.left
6784 anchors.right: parent.right
68− anchors.top: emailInput.bottom
69− anchors.topMargin: units.gu(2)
70− wrapMode: Text.Wrap
71− text: i18n.tr("Your name")
85+ anchors.top: noticeLabel.bottom
86+ anchors.topMargin: units.gu(3)
87+ text: i18n.tr("User name")
7288 color: textColor
7389 font.weight: Font.Light
7490 }
@@ -89,7 +105,6 @@ LocalComponents.Page {
89105 anchors.right: parent.right
90106 anchors.top: nameInput.bottom
91107 anchors.topMargin: units.gu(2)
92− wrapMode: Text.Wrap
93108 text: i18n.tr("Password")
94109 color: textColor
95110 font.weight: Font.Light
@@ -102,6 +117,7 @@ LocalComponents.Page {
102117 anchors.top: passLabel.bottom
103118 anchors.topMargin: units.gu(1)
104119 echoMode: TextInput.Password
120+ placeholderText: i18n.tr("Use a combination of letters and numbers.")
105121 KeyNavigation.tab: pass2Input
106122 }
107123
@@ -135,43 +151,22 @@ LocalComponents.Page {
135151 anchors.top: pass2Label.bottom
136152 anchors.topMargin: units.gu(1)
137153 echoMode: TextInput.Password
138− KeyNavigation.tab: cancelButton
139− }
140−
141− // buttons
142− Button {
143− id: cancelButton
144− anchors {
145− top: pass2Input.bottom
146− left: parent.left
147− right: parent.horizontalCenter
148− rightMargin: units.gu(1)
149− topMargin: units.gu(4)
150− }
151− text: i18n.tr("Cancel")
152− onClicked: pageStack.prev()
153− KeyNavigation.tab: okButton
154+ KeyNavigation.tab: nameInput
154155 }
156+ }
155157
156− Button {
157− id: okButton
158− anchors {
159− top: pass2Input.bottom
160− left: parent.horizontalCenter
161− right: parent.right
162− leftMargin: units.gu(1)
163− topMargin: units.gu(4)
164− }
165− text: i18n.tr("Sign Up")
166− enabled: emailInput.acceptableInput && nameInput.text !== "" &&
158+ Component {
159+ id: forwardButton
160+ LocalComponents.StackButton {
161+ enabled: /*emailInput.acceptableInput && */nameInput.text !== "" &&
167162 pass2Input.text.length > 7 && passInput.text === pass2Input.text
163+ text: i18n.tr("Next")
168164 onClicked: {
169165 root.password = passInput.text;
170166 AccountsService.realName = nameInput.text;
171− AccountsService.email = emailInput.text;
172− pageStack.next() // TODO sign up against U1 in Phase 2
167+ //AccountsService.email = emailInput.text;
168+ pageStack.next();
173169 }
174− KeyNavigation.tab: emailInput
175170 }
176171 }
177172}