on xenial help sign in
prepare for Account page rework (removal of password)
05a36beLukáš Tinkl
qml/Wizard/Page.qml+4−6
@@ -91,14 +91,13 @@ Item {
91 // page title
91 // page title
92 Label {
92 Label {
93 id: titleLabel
93 id: titleLabel
94− property real animatedMargin: 0
95 property real animatedTopMargin: 0
94 property real animatedTopMargin: 0
96 anchors {
95 anchors {
97 left: parent.left
96 left: parent.left
98 right: parent.right
97 right: parent.right
99 bottom: parent.bottom
98 bottom: parent.bottom
100 bottomMargin: bottomMargin
99 bottomMargin: bottomMargin
101− leftMargin: staticMargin + titleLabel.animatedMargin
100+ leftMargin: staticMargin
102 rightMargin: rightMargin
101 rightMargin: rightMargin
103 topMargin: titleLabel.animatedTopMargin
102 topMargin: titleLabel.animatedTopMargin
104 }
103 }
@@ -106,8 +105,9 @@ Item {
106 color: customTitle ? textColor : backgroundColor
105 color: customTitle ? textColor : backgroundColor
107 fontSize: customTitle ? "large" : "x-large"
106 fontSize: customTitle ? "large" : "x-large"
108 font.weight: Font.Light
107 font.weight: Font.Light
109− wrapMode: TextEdit.WordWrap
108+ wrapMode: Text.WordWrap
110 maximumLineCount: 2
109 maximumLineCount: 2
110+ elide: Text.ElideRight
111 }
111 }
112
112
113 // indicators
113 // indicators
@@ -269,17 +269,15 @@ Item {
269 ScriptAction { // direction of the effect
269 ScriptAction { // direction of the effect
270 script: {
270 script: {
271 if (contentAnimation.direction === Qt.LeftToRight) {
271 if (contentAnimation.direction === Qt.LeftToRight) {
272− titleLabel.animatedMargin = -content.width;
273 content.animatedMargin = -content.width;
272 content.animatedMargin = -content.width;
274 } else {
273 } else {
275− titleLabel.animatedMargin = content.width;
276 content.animatedMargin = content.width;
274 content.animatedMargin = content.width;
277 }
275 }
278 }
276 }
279 }
277 }
280 ParallelAnimation {
278 ParallelAnimation {
281 NumberAnimation { // the slide-in animation
279 NumberAnimation { // the slide-in animation
282− targets: [titleLabel, content]
280+ targets: content
283 property: 'animatedMargin'
281 property: 'animatedMargin'
284 to: 0
282 to: 0
285 duration: contentAnimation.animationDurationBase + contentAnimation.additionalDuration
283 duration: contentAnimation.animationDurationBase + contentAnimation.additionalDuration
qml/Wizard/Pages/60-account.qml+82−84
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2015 Canonical, Ltd.
2+ * Copyright (C) 2015-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -16,13 +16,12 @@
16
16
17import QtQuick 2.4
17import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19−import Ubuntu.Web 0.2
20import AccountsService 0.1
19import AccountsService 0.1
21import ".." as LocalComponents
20import ".." as LocalComponents
22
21
23LocalComponents.Page {
22LocalComponents.Page {
24 objectName: "accountPage"
23 objectName: "accountPage"
25− title: i18n.tr("Create Account")
24+ title: i18n.tr("User Details")
26
25
27 forwardButtonSourceComponent: forwardButton
26 forwardButtonSourceComponent: forwardButton
28
27
@@ -33,18 +32,17 @@ LocalComponents.Page {
33 QtObject {
32 QtObject {
34 id: d
33 id: d
35
34
36− readonly property bool validInput: nameInput.text !== "" &&
35+ readonly property bool validInput: true //nameInput.text !== ""
37− pass2Input.text.length > 7 && passInput.text === pass2Input.text
36+ // && pass2Input.text.length > 7 && passInput.text === pass2Input.text
38
37
39 function advance() {
38 function advance() {
40− root.password = passInput.text;
39+ //root.password = passInput.text;
41 AccountsService.realName = nameInput.text;
40 AccountsService.realName = nameInput.text;
42 pageStack.next();
41 pageStack.next();
43 }
42 }
44 }
43 }
45
44
46− Flickable
45+ Flickable {
47− {
48 id: column
46 id: column
49 clip: true
47 clip: true
50 flickableDirection: Flickable.VerticalFlick
48 flickableDirection: Flickable.VerticalFlick
@@ -63,7 +61,7 @@ LocalComponents.Page {
63 anchors.left: parent.left
61 anchors.left: parent.left
64 anchors.right: parent.right
62 anchors.right: parent.right
65 wrapMode: Text.Wrap
63 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.")
67 color: textColor
65 color: textColor
68 fontSize: "small"
66 fontSize: "small"
69 font.weight: Font.Light
67 font.weight: Font.Light
@@ -90,84 +88,84 @@ LocalComponents.Page {
90 anchors.right: parent.right
88 anchors.right: parent.right
91 anchors.top: nameLabel.bottom
89 anchors.top: nameLabel.bottom
92 anchors.topMargin: units.gu(1)
90 anchors.topMargin: units.gu(1)
93− onActiveFocusChanged: {
91+// onActiveFocusChanged: {
94− if (activeFocus) {
92+// if (activeFocus) {
95− column.contentY = nameLabel.y
93+// column.contentY = nameLabel.y
96− }
94+// }
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− }
95+// }
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")
123 inputMethodHints: Qt.ImhNoPredictiveText
96 inputMethodHints: Qt.ImhNoPredictiveText
124− onActiveFocusChanged: {
125− if (activeFocus) {
126− column.contentY = passLabel.y
127− }
128− }
129− onAccepted: pass2Input.forceActiveFocus()
97+ //onAccepted: passInput.forceActiveFocus()
130 }
98 }
131
99
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+
132− // password meter
130+// // password meter
133− LocalComponents.PasswordMeter {
131+// LocalComponents.PasswordMeter {
134− id: passMeter
132+// id: passMeter
135− anchors.left: parent.left
133+// anchors.left: parent.left
136− anchors.right: parent.right
134+// anchors.right: parent.right
137− anchors.top: passInput.bottom
135+// anchors.top: passInput.bottom
138− anchors.topMargin: units.gu(1)
136+// anchors.topMargin: units.gu(1)
139− password: passInput.text
137+// password: passInput.text
140− }
138+// }
141−
139+
142− // repeat password
140+// // repeat password
143− Label {
141+// Label {
144− id: pass2Label
142+// id: pass2Label
145− anchors.left: parent.left
143+// anchors.left: parent.left
146− anchors.right: parent.right
144+// anchors.right: parent.right
147− anchors.top: passMeter.bottom
145+// anchors.top: passMeter.bottom
148− anchors.topMargin: passInput.text !== "" ? units.gu(4) : units.gu(2)
146+// anchors.topMargin: passInput.text !== "" ? units.gu(4) : units.gu(2)
149− wrapMode: Text.Wrap
147+// wrapMode: Text.Wrap
150− text: i18n.tr("Repeat password")
148+// text: i18n.tr("Repeat password")
151− color: textColor
149+// color: textColor
152− font.weight: Font.Light
150+// font.weight: Font.Light
153− }
151+// }
154−
152+
155− LocalComponents.WizardTextField {
153+// LocalComponents.WizardTextField {
156− id: pass2Input
154+// id: pass2Input
157− objectName: "pass2Input"
155+// objectName: "pass2Input"
158− anchors.left: parent.left
156+// anchors.left: parent.left
159− anchors.right: parent.right
157+// anchors.right: parent.right
160− anchors.top: pass2Label.bottom
158+// anchors.top: pass2Label.bottom
161− anchors.topMargin: units.gu(1)
159+// anchors.topMargin: units.gu(1)
162− echoMode: TextInput.Password
160+// echoMode: TextInput.Password
163− inputMethodHints: Qt.ImhNoPredictiveText
161+// inputMethodHints: Qt.ImhNoPredictiveText
164− onActiveFocusChanged: {
162+// onActiveFocusChanged: {
165− if (activeFocus) {
163+// if (activeFocus) {
166− column.contentY = pass2Label.y
164+// column.contentY = pass2Label.y
167− }
165+// }
168− }
166+// }
169− onAccepted: if (d.validInput) d.advance();
167+// onAccepted: if (d.validInput) d.advance();
170− }
168+// }
171 }
169 }
172
170
173 Component {
171 Component {
qml/Wizard/Pages/70-passwd-type.qml+14−14
@@ -45,20 +45,20 @@ LocalComponents.Page {
45 skip: securityPrivacy.securityType !== UbuntuSecurityPrivacyPanel.Swipe
45 skip: securityPrivacy.securityType !== UbuntuSecurityPrivacyPanel.Swipe
46
46
47 function indexToMethod(index) {
47 function indexToMethod(index) {
48− if (index === 0 || index === 1)
48+ if (index === 0/* || index === 1*/)
49 return UbuntuSecurityPrivacyPanel.Passphrase;
49 return UbuntuSecurityPrivacyPanel.Passphrase;
50− else if (index === 2)
50+ else if (index === 1/*2*/)
51 return UbuntuSecurityPrivacyPanel.Passcode;
51 return UbuntuSecurityPrivacyPanel.Passcode;
52 else
52 else
53 return UbuntuSecurityPrivacyPanel.Swipe;
53 return UbuntuSecurityPrivacyPanel.Swipe;
54 }
54 }
55
55
56− Component.onCompleted: {
56+// Component.onCompleted: {
57− if (root.password !== "") // the user has set a password as part of the previous page
57+// if (root.password !== "") // the user has set a password as part of the previous page
58− selector.currentIndex = 0;
58+// selector.currentIndex = 0;
59− else
59+// else
60− selector.currentIndex = 1;
60+// selector.currentIndex = 1;
61− }
61+// }
62
62
63 Item {
63 Item {
64 id: column
64 id: column
@@ -76,7 +76,7 @@ LocalComponents.Page {
76 height: childrenRect.height
76 height: childrenRect.height
77
77
78 // this is the order we want to display it; cf indexToMethod()
78 // this is the order we want to display it; cf indexToMethod()
79− model: [UbuntuSecurityPrivacyPanel.Passphrase, UbuntuSecurityPrivacyPanel.Passphrase,
79+ model: [/*UbuntuSecurityPrivacyPanel.Passphrase, */UbuntuSecurityPrivacyPanel.Passphrase,
80 UbuntuSecurityPrivacyPanel.Passcode, UbuntuSecurityPrivacyPanel.Swipe]
80 UbuntuSecurityPrivacyPanel.Passcode, UbuntuSecurityPrivacyPanel.Swipe]
81
81
82 delegate: ListItem {
82 delegate: ListItem {
@@ -95,13 +95,13 @@ LocalComponents.Page {
95 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
95 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
96 text: {
96 text: {
97 switch (index) {
97 switch (index) {
98+// case 0:
99+// return i18n.ctr("Label: Type of security method", "Ubuntu administrator password");
98 case 0:
100 case 0:
99− return i18n.ctr("Label: Type of security method", "Ubuntu administrator password");
100− case 1:
101 return i18n.ctr("Label: Type of security method", "Create new password");
101 return i18n.ctr("Label: Type of security method", "Create new password");
102− case 2:
102+ case 1:
103 return i18n.ctr("Label: Type of security method", "Create passcode (numbers only)");
103 return i18n.ctr("Label: Type of security method", "Create passcode (numbers only)");
104− case 3:
104+ case 2:
105 return i18n.ctr("Label: Type of security method", "No lock code");
105 return i18n.ctr("Label: Type of security method", "No lock code");
106 }
106 }
107 }
107 }
@@ -147,7 +147,7 @@ LocalComponents.Page {
147 root.passwordMethod = method;
147 root.passwordMethod = method;
148
148
149 if (method === UbuntuSecurityPrivacyPanel.Passphrase) { // any password
149 if (method === UbuntuSecurityPrivacyPanel.Passphrase) { // any password
150− if (selector.currentIndex == 1)
150+ if (selector.currentIndex == 0/*1*/)
151 pageStack.load(Qt.resolvedUrl("password-set.qml")); // let the user choose a new password
151 pageStack.load(Qt.resolvedUrl("password-set.qml")); // let the user choose a new password
152 else
152 else
153 pageStack.next(); // got the password already, go next page
153 pageStack.next(); // got the password already, go next page