@@ -0,0 +1,163 @@
2+ * Copyright (C) 2015 Canonical, Ltd.
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
18+import Ubuntu.Components 1.2
19+import ".." as LocalComponents
21+LocalComponents.Page {
22+ objectName: "ubuntuAccountSignUpPage"
24+ title: i18n.tr("Create Account")
26+ backButtonText: i18n.tr("Cancel")
27+ forwardButtonSourceComponent: forwardButton
29+ Component.onCompleted: {
30+ emailInput.forceActiveFocus()
35+ anchors.fill: content
40+ anchors.left: parent.left
41+ anchors.right: parent.right
43+ text: i18n.tr("Email:")
45+ font.weight: Font.Light
50+ anchors.left: parent.left
51+ anchors.right: parent.right
52+ anchors.top: emailLabel.bottom
53+ anchors.topMargin: units.gu(1)
54+ inputMethodHints: Qt.ImhEmailCharactersOnly
55+ validator: RegExpValidator {
56+ regExp: /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
58+ KeyNavigation.tab: nameInput
64+ anchors.left: parent.left
65+ anchors.right: parent.right
66+ anchors.top: emailInput.bottom
67+ anchors.topMargin: units.gu(3)
69+ text: i18n.tr("Your name:")
71+ font.weight: Font.Light
76+ anchors.left: parent.left
77+ anchors.right: parent.right
78+ anchors.top: nameLabel.bottom
79+ anchors.topMargin: units.gu(1)
80+ KeyNavigation.tab: passInput
86+ anchors.left: parent.left
87+ anchors.right: parent.right
88+ anchors.top: nameInput.bottom
89+ anchors.topMargin: units.gu(3)
91+ text: i18n.tr("Password:")
93+ font.weight: Font.Light
98+ anchors.left: parent.left
99+ anchors.right: parent.right
100+ anchors.top: passLabel.bottom
101+ anchors.topMargin: units.gu(1)
102+ echoMode: TextInput.Password
103+ KeyNavigation.tab: pass2Input
109+ anchors.left: parent.left
110+ anchors.right: parent.right
111+ anchors.top: passInput.bottom
112+ anchors.topMargin: units.gu(3)
114+ text: i18n.tr("Repeat password:")
116+ font.weight: Font.Light
121+ anchors.left: parent.left
122+ anchors.right: parent.right
123+ anchors.top: pass2Label.bottom
124+ anchors.topMargin: units.gu(1)
125+ echoMode: TextInput.Password
126+ KeyNavigation.tab: optoutCheck
129+ LocalComponents.CheckableSetting {
131+ objectName: "optoutCheck"
133+ anchors.left: parent.left
134+ anchors.right: parent.right
135+ anchors.top: pass2Input.bottom
136+ anchors.topMargin: units.gu(3)
137+ text: i18n.tr("Opt out of cloud account (not recommended)")
138+ KeyNavigation.tab: termsCheck
141+ LocalComponents.CheckableSetting {
143+ objectName: "termsCheck"
145+ anchors.left: parent.left
146+ anchors.right: parent.right
147+ anchors.top: optoutCheck.bottom
148+ anchors.topMargin: units.gu(1)
149+ text: i18n.tr("I have read and accept the Ubuntu account <a href='#'>terms of service</a>")
150+ //onLinkActivated: pageStack.load(Qt.resolvedUrl("here-terms.qml")) // TODO show terms
151+ KeyNavigation.tab: emailInput
157+ LocalComponents.StackButton {
158+ enabled: emailInput.acceptableInput && passInput.text !== "" && pass2Input.text !== "" && passInput.text === pass2Input.text
159+ text: i18n.tr("Sign Up")
160+ onClicked: pageStack.next() // TODO sign up against U1