on xenial help sign in
prepare for Account page rework (removal of password)

plus some minor fixes based on feedback

commit05a36be8c8be7e578dd216c51cec0886f9815484 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateThu 11 Feb 2016, 18:34 (11 years ago) parent3ae411f
3 files changed+100−104
qml/Wizard/Page.qml+4−6 qml/Wizard/Pages/60-account.qml+82−84 qml/Wizard/Pages/70-passwd-type.qml+14−14
qml/Wizard/Page.qml+4−6
@@ -91,14 +91,13 @@ Item {
9191 // page title
9292 Label {
9393 id: titleLabel
94− property real animatedMargin: 0
9594 property real animatedTopMargin: 0
9695 anchors {
9796 left: parent.left
9897 right: parent.right
9998 bottom: parent.bottom
10099 bottomMargin: bottomMargin
101− leftMargin: staticMargin + titleLabel.animatedMargin
100+ leftMargin: staticMargin
102101 rightMargin: rightMargin
103102 topMargin: titleLabel.animatedTopMargin
104103 }
@@ -106,8 +105,9 @@ Item {
106105 color: customTitle ? textColor : backgroundColor
107106 fontSize: customTitle ? "large" : "x-large"
108107 font.weight: Font.Light
109− wrapMode: TextEdit.WordWrap
108+ wrapMode: Text.WordWrap
110109 maximumLineCount: 2
110+ elide: Text.ElideRight
111111 }
112112
113113 // indicators
@@ -269,17 +269,15 @@ Item {
269269 ScriptAction { // direction of the effect
270270 script: {
271271 if (contentAnimation.direction === Qt.LeftToRight) {
272− titleLabel.animatedMargin = -content.width;
273272 content.animatedMargin = -content.width;
274273 } else {
275− titleLabel.animatedMargin = content.width;
276274 content.animatedMargin = content.width;
277275 }
278276 }
279277 }
280278 ParallelAnimation {
281279 NumberAnimation { // the slide-in animation
282− targets: [titleLabel, content]
280+ targets: content
283281 property: 'animatedMargin'
284282 to: 0
285283 duration: contentAnimation.animationDurationBase + contentAnimation.additionalDuration
qml/Wizard/Pages/60-account.qml+82−84
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2015 Canonical, Ltd.
2+ * Copyright (C) 2015-2016 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -16,13 +16,12 @@
1616
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
19−import Ubuntu.Web 0.2
2019import AccountsService 0.1
2120import ".." as LocalComponents
2221
2322LocalComponents.Page {
2423 objectName: "accountPage"
25− title: i18n.tr("Create Account")
24+ title: i18n.tr("User Details")
2625
2726 forwardButtonSourceComponent: forwardButton
2827
@@ -33,18 +32,17 @@ LocalComponents.Page {
3332 QtObject {
3433 id: d
3534
36− readonly property bool validInput: nameInput.text !== "" &&
37− pass2Input.text.length > 7 && passInput.text === pass2Input.text
35+ readonly property bool validInput: true //nameInput.text !== ""
36+ // && pass2Input.text.length > 7 && passInput.text === pass2Input.text
3837
3938 function advance() {
40− root.password = passInput.text;
39+ //root.password = passInput.text;
4140 AccountsService.realName = nameInput.text;
4241 pageStack.next();
4342 }
4443 }
4544
46− Flickable
47− {
45+ Flickable {
4846 id: column
4947 clip: true
5048 flickableDirection: Flickable.VerticalFlick
@@ -63,7 +61,7 @@ LocalComponents.Page {
6361 anchors.left: parent.left
6462 anchors.right: parent.right
6563 wrapMode: Text.Wrap
66− text: i18n.tr("Please enter your name and password to create your administrator account. You need this password to manage your device.")
64+ text: i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit.")
6765 color: textColor
6866 fontSize: "small"
6967 font.weight: Font.Light
@@ -90,84 +88,84 @@ LocalComponents.Page {
9088 anchors.right: parent.right
9189 anchors.top: nameLabel.bottom
9290 anchors.topMargin: units.gu(1)
93− onActiveFocusChanged: {
94− if (activeFocus) {
95− column.contentY = nameLabel.y
96− }
97− }
98− inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
99− onAccepted: passInput.forceActiveFocus()
100− }
101−
102− // password
103− Label {
104− id: passLabel
105− anchors.left: parent.left
106− anchors.right: parent.right
107− anchors.top: nameInput.bottom
108− anchors.topMargin: units.gu(2)
109− text: i18n.tr("Password")
110− color: textColor
111− font.weight: Font.Light
112− }
113−
114− LocalComponents.WizardTextField {
115− id: passInput
116− objectName: "passInput"
117− anchors.left: parent.left
118− anchors.right: parent.right
119− anchors.top: passLabel.bottom
120− anchors.topMargin: units.gu(1)
121− echoMode: TextInput.Password
122− placeholderText: i18n.tr("Use letters and numbers")
91+// onActiveFocusChanged: {
92+// if (activeFocus) {
93+// column.contentY = nameLabel.y
94+// }
95+// }
12396 inputMethodHints: Qt.ImhNoPredictiveText
124− onActiveFocusChanged: {
125− if (activeFocus) {
126− column.contentY = passLabel.y
127− }
128− }
129− onAccepted: pass2Input.forceActiveFocus()
97+ //onAccepted: passInput.forceActiveFocus()
13098 }
13199
132− // password meter
133− LocalComponents.PasswordMeter {
134− id: passMeter
135− anchors.left: parent.left
136− anchors.right: parent.right
137− anchors.top: passInput.bottom
138− anchors.topMargin: units.gu(1)
139− password: passInput.text
140− }
141−
142− // repeat password
143− Label {
144− id: pass2Label
145− anchors.left: parent.left
146− anchors.right: parent.right
147− anchors.top: passMeter.bottom
148− anchors.topMargin: passInput.text !== "" ? units.gu(4) : units.gu(2)
149− wrapMode: Text.Wrap
150− text: i18n.tr("Repeat password")
151− color: textColor
152− font.weight: Font.Light
153− }
154−
155− LocalComponents.WizardTextField {
156− id: pass2Input
157− objectName: "pass2Input"
158− anchors.left: parent.left
159− anchors.right: parent.right
160− anchors.top: pass2Label.bottom
161− anchors.topMargin: units.gu(1)
162− echoMode: TextInput.Password
163− inputMethodHints: Qt.ImhNoPredictiveText
164− onActiveFocusChanged: {
165− if (activeFocus) {
166− column.contentY = pass2Label.y
167− }
168− }
169− onAccepted: if (d.validInput) d.advance();
170− }
100+// // password
101+// Label {
102+// id: passLabel
103+// anchors.left: parent.left
104+// anchors.right: parent.right
105+// anchors.top: nameInput.bottom
106+// anchors.topMargin: units.gu(2)
107+// text: i18n.tr("Password")
108+// color: textColor
109+// font.weight: Font.Light
110+// }
111+
112+// LocalComponents.WizardTextField {
113+// id: passInput
114+// objectName: "passInput"
115+// anchors.left: parent.left
116+// anchors.right: parent.right
117+// anchors.top: passLabel.bottom
118+// anchors.topMargin: units.gu(1)
119+// echoMode: TextInput.Password
120+// placeholderText: i18n.tr("Use letters and numbers")
121+// inputMethodHints: Qt.ImhNoPredictiveText
122+// onActiveFocusChanged: {
123+// if (activeFocus) {
124+// column.contentY = passLabel.y
125+// }
126+// }
127+// onAccepted: pass2Input.forceActiveFocus()
128+// }
129+
130+// // password meter
131+// LocalComponents.PasswordMeter {
132+// id: passMeter
133+// anchors.left: parent.left
134+// anchors.right: parent.right
135+// anchors.top: passInput.bottom
136+// anchors.topMargin: units.gu(1)
137+// password: passInput.text
138+// }
139+
140+// // repeat password
141+// Label {
142+// id: pass2Label
143+// anchors.left: parent.left
144+// anchors.right: parent.right
145+// anchors.top: passMeter.bottom
146+// anchors.topMargin: passInput.text !== "" ? units.gu(4) : units.gu(2)
147+// wrapMode: Text.Wrap
148+// text: i18n.tr("Repeat password")
149+// color: textColor
150+// font.weight: Font.Light
151+// }
152+
153+// LocalComponents.WizardTextField {
154+// id: pass2Input
155+// objectName: "pass2Input"
156+// anchors.left: parent.left
157+// anchors.right: parent.right
158+// anchors.top: pass2Label.bottom
159+// anchors.topMargin: units.gu(1)
160+// echoMode: TextInput.Password
161+// inputMethodHints: Qt.ImhNoPredictiveText
162+// onActiveFocusChanged: {
163+// if (activeFocus) {
164+// column.contentY = pass2Label.y
165+// }
166+// }
167+// onAccepted: if (d.validInput) d.advance();
168+// }
171169 }
172170
173171 Component {
qml/Wizard/Pages/70-passwd-type.qml+14−14
@@ -45,20 +45,20 @@ LocalComponents.Page {
4545 skip: securityPrivacy.securityType !== UbuntuSecurityPrivacyPanel.Swipe
4646
4747 function indexToMethod(index) {
48− if (index === 0 || index === 1)
48+ if (index === 0/* || index === 1*/)
4949 return UbuntuSecurityPrivacyPanel.Passphrase;
50− else if (index === 2)
50+ else if (index === 1/*2*/)
5151 return UbuntuSecurityPrivacyPanel.Passcode;
5252 else
5353 return UbuntuSecurityPrivacyPanel.Swipe;
5454 }
5555
56− Component.onCompleted: {
57− if (root.password !== "") // the user has set a password as part of the previous page
58− selector.currentIndex = 0;
59− else
60− selector.currentIndex = 1;
61− }
56+// Component.onCompleted: {
57+// if (root.password !== "") // the user has set a password as part of the previous page
58+// selector.currentIndex = 0;
59+// else
60+// selector.currentIndex = 1;
61+// }
6262
6363 Item {
6464 id: column
@@ -76,7 +76,7 @@ LocalComponents.Page {
7676 height: childrenRect.height
7777
7878 // this is the order we want to display it; cf indexToMethod()
79− model: [UbuntuSecurityPrivacyPanel.Passphrase, UbuntuSecurityPrivacyPanel.Passphrase,
79+ model: [/*UbuntuSecurityPrivacyPanel.Passphrase, */UbuntuSecurityPrivacyPanel.Passphrase,
8080 UbuntuSecurityPrivacyPanel.Passcode, UbuntuSecurityPrivacyPanel.Swipe]
8181
8282 delegate: ListItem {
@@ -95,13 +95,13 @@ LocalComponents.Page {
9595 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
9696 text: {
9797 switch (index) {
98+// case 0:
99+// return i18n.ctr("Label: Type of security method", "Ubuntu administrator password");
98100 case 0:
99− return i18n.ctr("Label: Type of security method", "Ubuntu administrator password");
100− case 1:
101101 return i18n.ctr("Label: Type of security method", "Create new password");
102− case 2:
102+ case 1:
103103 return i18n.ctr("Label: Type of security method", "Create passcode (numbers only)");
104− case 3:
104+ case 2:
105105 return i18n.ctr("Label: Type of security method", "No lock code");
106106 }
107107 }
@@ -147,7 +147,7 @@ LocalComponents.Page {
147147 root.passwordMethod = method;
148148
149149 if (method === UbuntuSecurityPrivacyPanel.Passphrase) { // any password
150− if (selector.currentIndex == 1)
150+ if (selector.currentIndex == 0/*1*/)
151151 pageStack.load(Qt.resolvedUrl("password-set.qml")); // let the user choose a new password
152152 else
153153 pageStack.next(); // got the password already, go next page