@@ -31,30 +31,18 @@ LocalComponents.Page {
32 QtObject {
32 QtObject {
34−
34+ readonly property string validName: nameInput.text.trim()
36− var tmp = nameInput.text + " " + surnameInput.text;
37− var realName = tmp.trim();
38− if (realName !== "") {
39− AccountsService.realName = realName;
45− Flickable {
37+ Column {
46 id: column
38 id: column
47− clip: true
39+ spacing: units.gu(1)
48− flickableDirection: Flickable.VerticalFlick
50 fill: content
41 fill: content
51 leftMargin: parent.leftMargin
42 leftMargin: parent.leftMargin
52 rightMargin: parent.rightMargin
43 rightMargin: parent.rightMargin
53 topMargin: customMargin
44 topMargin: customMargin
55− bottomMargin: Qt.inputMethod.visible && !Qt.inputMethod.animating ? Qt.inputMethod.keyboardRectangle.height : 0
57− Behavior on contentY { UbuntuNumberAnimation {} }
@@ -71,51 +59,20 @@ LocalComponents.Page {
71 objectName: "nameInput"
59 objectName: "nameInput"
72 anchors.left: parent.left
60 anchors.left: parent.left
73 anchors.right: parent.right
61 anchors.right: parent.right
74− anchors.top: nameLabel.bottom
75− anchors.topMargin: units.gu(1)
76 inputMethodHints: Qt.ImhNoPredictiveText
62 inputMethodHints: Qt.ImhNoPredictiveText
77− onAccepted: surnameInput.forceActiveFocus()
78− onActiveFocusChanged: {
80− column.contentY = nameLabel.y
88− anchors.left: parent.left
89− anchors.right: parent.right
90− anchors.top: nameInput.bottom
91− anchors.topMargin: units.gu(3)
92− text: i18n.tr("Your Surname")
94− font.weight: Font.Light
97− LocalComponents.WizardTextField {
99− objectName: "surnameInput"
100− anchors.left: parent.left
101− anchors.right: parent.right
102− anchors.top: surnameLabel.bottom
103− anchors.topMargin: units.gu(1)
104− inputMethodHints: Qt.ImhNoPredictiveText
105− onAccepted: d.advance()
106− onActiveFocusChanged: {
108− column.contentY = surnameLabel.y
114 Component {
66 Component {
115 id: forwardButton
67 id: forwardButton
116 LocalComponents.StackButton {
68 LocalComponents.StackButton {
117− text: i18n.tr("Next")
69+ text: d.validName ? i18n.tr("Next") : i18n.tr("Skip")
118− onClicked: d.advance();
70+ onClicked: {
72+ AccountsService.realName = d.validName;