on xenial help sign in
implement a draft U1 account signin page
commit0b2867875fa85f7c9c885ef63aad286aec084972 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 10 Jul 2015, 18:25 (11 years ago) parent56484a0
2 files changed+94−1
qml/Wizard/Pages/55-uaccount.qml+3−1 qml/Wizard/Pages/uaccount-signin.qml+91
qml/Wizard/Pages/55-uaccount.qml+3−1
@@ -55,8 +55,10 @@ LocalComponents.Page {
5555 right: parent.right
5656 }
5757 text: i18n.tr("Sign In")
58+ onClicked: {
59+ pageStack.load(Qt.resolvedUrl("uaccount-signin.qml"))
60+ }
5861 }
59−
6062 }
6163
6264 Component {
qml/Wizard/Pages/uaccount-signin.qmlnew file+91
@@ -0,0 +1,91 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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.
7+ *
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.
12+ *
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/>.
15+ */
16+
17+import QtQuick 2.3
18+import Ubuntu.Components 1.2
19+import ".." as LocalComponents
20+
21+LocalComponents.Page {
22+ objectName: "ubuntuAccountSignInPage"
23+
24+ title: i18n.tr("Sign In")
25+ customTitle: true
26+ backButtonText: i18n.tr("Cancel")
27+ forwardButtonSourceComponent: forwardButton
28+
29+ Component.onCompleted: {
30+ emailInput.forceActiveFocus()
31+ }
32+
33+ Item {
34+ id: column
35+ anchors.fill: content
36+
37+ Label {
38+ id: emailLabel
39+ anchors.left: parent.left
40+ anchors.right: parent.right
41+ wrapMode: Text.Wrap
42+ text: i18n.tr("Email:")
43+ color: "#525252"
44+ font.weight: Font.Light
45+ }
46+
47+ TextField {
48+ id: emailInput
49+ anchors.left: parent.left
50+ anchors.right: parent.right
51+ anchors.top: emailLabel.bottom
52+ anchors.topMargin: units.gu(1)
53+ inputMethodHints: Qt.ImhEmailCharactersOnly
54+ validator: RegExpValidator {
55+ regExp: /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
56+ }
57+ KeyNavigation.tab: passInput
58+ }
59+
60+ Label {
61+ id: passLabel
62+ anchors.left: parent.left
63+ anchors.right: parent.right
64+ anchors.top: emailInput.bottom
65+ anchors.topMargin: units.gu(3)
66+ wrapMode: Text.Wrap
67+ text: i18n.tr("Password:")
68+ color: "#525252"
69+ font.weight: Font.Light
70+ }
71+
72+ TextField {
73+ id: passInput
74+ anchors.left: parent.left
75+ anchors.right: parent.right
76+ anchors.top: passLabel.bottom
77+ anchors.topMargin: units.gu(1)
78+ echoMode: TextInput.Password
79+ KeyNavigation.tab: emailInput
80+ }
81+ }
82+
83+ Component {
84+ id: forwardButton
85+ LocalComponents.StackButton {
86+ enabled: emailInput.acceptableInput && passInput.text.length !== ""
87+ text: i18n.tr("Sign In")
88+ onClicked: pageStack.next() // TODO sign in against U1
89+ }
90+ }
91+}