on xenial help sign in
don't reload/reset the model all the time
bc764baLukáš Tinkl
qml/Wizard/Pages/30-wifi.qml+1−10
@@ -140,16 +140,6 @@ LocalComponents.Page {
140 unityMenuModel.activate(menuIndex);
140 unityMenuModel.activate(menuIndex);
141 listview.positionViewAtBeginning();
141 listview.positionViewAtBeginning();
142 }
142 }
143−
144− Component.onCompleted: {
145− loadAttributes();
146− }
147− onUnityMenuModelChanged: {
148− loadAttributes();
149− }
150− onMenuIndexChanged: {
151− loadAttributes();
152− }
153 }
143 }
154 }
144 }
155
145
@@ -205,6 +195,7 @@ LocalComponents.Page {
205 onLoaded: {
195 onLoaded: {
206 item.menuData = Qt.binding(function() { return model; });
196 item.menuData = Qt.binding(function() { return model; });
207 item.menuIndex = Qt.binding(function() { return index; });
197 item.menuIndex = Qt.binding(function() { return index; });
198+ item.loadAttributes();
208 }
199 }
209 }
200 }
210 }
201 }
qml/Wizard/Pages/password-set.qml+51−29
@@ -34,14 +34,18 @@ LocalComponents.Page {
34 readonly property alias password2: password2Field.text
34 readonly property alias password2: password2Field.text
35 readonly property bool passwordsMatching: password == password2 && password.trim().length > 7
35 readonly property bool passwordsMatching: password == password2 && password.trim().length > 7
36
36
37− ColumnLayout {
37+ Flickable {
38 id: column
38 id: column
39+ clip: true
40+ flickableDirection: Flickable.VerticalFlick
39 anchors.fill: content
41 anchors.fill: content
40− anchors.leftMargin: leftMargin
42+ anchors.leftMargin: parent.leftMargin
41− anchors.rightMargin: rightMargin
43+ anchors.rightMargin: parent.rightMargin
42 anchors.topMargin: customMargin
44 anchors.topMargin: customMargin
43− spacing: units.gu(3)
44
45
46+ bottomMargin: Qt.inputMethod.keyboardRectangle.height
47+
48+ // info label
45 Label {
49 Label {
46 id: infoLabel
50 id: infoLabel
47 objectName: "infoLabel"
51 objectName: "infoLabel"
@@ -55,31 +59,53 @@ LocalComponents.Page {
55 text: i18n.tr("Enter at least 8 characters")
59 text: i18n.tr("Enter at least 8 characters")
56 }
60 }
57
61
58− ColumnLayout {
62+ // password
59− id: innerLayout
63+ Label {
60− Label {
64+ id: pass1Label
61− text: i18n.tr("Choose password")
65+ anchors {
62− color: textColor
66+ left: parent.left
67+ right: parent.right
68+ top: infoLabel.bottom
69+ topMargin: units.gu(3)
63 }
70 }
71+ text: i18n.tr("Choose password")
72+ color: textColor
73+ }
64− LocalComponents.WizardTextField {
74+ LocalComponents.WizardTextField {
65− Layout.fillWidth: true
66− id: passwordField
75+ id: passwordField
67− objectName: "passwordField"
76+ anchors {
68− echoMode: TextInput.Password
77+ left: parent.left
69− onAccepted: password2Field.forceActiveFocus()
78+ right: parent.right
79+ top: pass1Label.bottom
80+ topMargin: units.gu(1)
70 }
81 }
82+ objectName: "passwordField"
83+ echoMode: TextInput.Password
84+ onAccepted: password2Field.forceActiveFocus()
85+ }
71
86
72− Label {
73− text: i18n.tr("Confirm password")
87+ // password 2
74− color: textColor
88+ Label {
89+ id: pass2Label
90+ anchors {
91+ left: parent.left
92+ right: parent.right
93+ top: passwordField.bottom
75− anchors.topMargin: units.gu(1)
94+ topMargin: units.gu(3)
76 }
95 }
96+ text: i18n.tr("Confirm password")
97+ color: textColor
98+ }
77− LocalComponents.WizardTextField {
99+ LocalComponents.WizardTextField {
78− Layout.fillWidth: true
100+ anchors {
79− id: password2Field
101+ left: parent.left
80− objectName: "password2Field"
102+ right: parent.right
81− echoMode: TextInput.Password
103+ top: pass2Label.bottom
104+ topMargin: units.gu(1)
82 }
105 }
106+ id: password2Field
107+ objectName: "password2Field"
108+ echoMode: TextInput.Password
83 }
109 }
84
110
85 // password meter
111 // password meter
@@ -88,17 +114,13 @@ LocalComponents.Page {
88 anchors {
114 anchors {
89 left: parent.left
115 left: parent.left
90 right: parent.right
116 right: parent.right
91− top: innerLayout.bottom
117+ top: password2Field.bottom
92 topMargin: units.gu(1)
118 topMargin: units.gu(1)
93 }
119 }
94
120
95 password: passwordField.text
121 password: passwordField.text
96 matching: passwordsMatching
122 matching: passwordsMatching
97 }
123 }
98−
99− Item { // spacer
100− Layout.fillHeight: true
101− }
102 }
124 }
103
125
104 Component {
126 Component {