on xenial help sign in
Fix fuzzily defined root and other reference problems
101c302Dalton Durst
qml/Wizard/Components/InputMethod.qml+9−9
@@ -21,19 +21,19 @@ import Ubuntu.Components 0.1
21// TODO: try to share this code with that from the unity8 shell
21// TODO: try to share this code with that from the unity8 shell
22
22
23Item {
23Item {
24− id: root
24+ id: inputMethodRoot
25
25
26 Connections {
26 Connections {
27 target: SurfaceManager
27 target: SurfaceManager
28 onSurfaceCreated: {
28 onSurfaceCreated: {
29 if (surface.type == MirSurfaceItem.InputMethod) {
29 if (surface.type == MirSurfaceItem.InputMethod) {
30− root.surface = surface;
30+ inputMethodRoot.surface = surface;
31 }
31 }
32 }
32 }
33
33
34 onSurfaceDestroyed: {
34 onSurfaceDestroyed: {
35− if (root.surface == surface) {
35+ if (inputMethodRoot.surface == surface) {
36− root.surface = null;
36+ inputMethodRoot.surface = null;
37 surface.parent = null;
37 surface.parent = null;
38 }
38 }
39 if (!surface.parent) {
39 if (!surface.parent) {
@@ -71,7 +71,7 @@ Item {
71 visible: false
71 visible: false
72 // half-way down because the vkb occupies only the lower half of the surface
72 // half-way down because the vkb occupies only the lower half of the surface
73 // TODO: consider keyboard rotation
73 // TODO: consider keyboard rotation
74− y: root.parent.height / 2.0
74+ y: inputMethodRoot.parent.height / 2.0
75 }
75 }
76 }
76 }
77 ]
77 ]
@@ -89,17 +89,17 @@ Item {
89 ignoreUnknownSignals: true // don't wanna spam the log when surface is null
89 ignoreUnknownSignals: true // don't wanna spam the log when surface is null
90 onStateChanged: {
90 onStateChanged: {
91 if (state == MirSurfaceItem.Minimized) {
91 if (state == MirSurfaceItem.Minimized) {
92− root.hide();
92+ inputMethodRoot.hide();
93 } else if (state == MirSurfaceItem.Maximized) {
93 } else if (state == MirSurfaceItem.Maximized) {
94− root.show();
94+ inputMethodRoot.show();
95 }
95 }
96 }
96 }
97 }
97 }
98
98
99 onSurfaceChanged: {
99 onSurfaceChanged: {
100 if (surface) {
100 if (surface) {
101− surface.parent = root;
101+ surface.parent = inputMethodRoot;
102− surface.anchors.fill = root;
102+ surface.anchors.fill = inputMethodRoot;
103 }
103 }
104 }
104 }
105
105
qml/Wizard/Pages.qml+3−4
@@ -165,12 +165,11 @@ StyledItem {
165 /**
165 /**
166 * Determine if array contains item
166 * Determine if array contains item
167 */
167 */
168− function itemInArrayInOtherArray(item, array) {
168+ function itemInArray(item, array) {
169 return array.indexOf(item) >= 0;
169 return array.indexOf(item) >= 0;
170 }
170 }
171
171
172 function checkSkip() {
172 function checkSkip() {
173− console.warn("Evaluating skip on " + currentPage.objectName);
174 if (!currentPage) { // may have had a parse error
173 if (!currentPage) { // may have had a parse error
175 console.warn("Wizard page skipped due to possible parse error.");
174 console.warn("Wizard page skipped due to possible parse error.");
176 next();
175 next();
@@ -178,11 +177,11 @@ StyledItem {
178 if (currentPage.skip) {
177 if (currentPage.skip) {
179 next();
178 next();
180 console.warn("Wizard page " + currentPage.objectName + " skipped on request");
179 console.warn("Wizard page " + currentPage.objectName + " skipped on request");
181− } else if ( !(itemInArray(root.runningWizardVersion, currentPage.showOnVersions)) &&
180+ } else if ( !(itemInArray(wizard.runningWizardVersion, currentPage.showOnVersions)) &&
182 (currentPage.showOnVersions.length > 0) ) {
181 (currentPage.showOnVersions.length > 0) ) {
183 // The page is not supposed to run on this version of the wizard
182 // The page is not supposed to run on this version of the wizard
184− console.warn("Wizard page " + currentPage.objectName + " skipped, it is not marked to run on this version.");
185 next();
183 next();
184+ console.warn("Wizard page " + currentPage.objectName + " skipped, it is not marked to run on this version.");
186 } else {
185 } else {
187 console.warn("Starting wizard page " + currentPage.objectName);
186 console.warn("Starting wizard page " + currentPage.objectName);
188 currentPage.opacity = 1;
187 currentPage.opacity = 1;
qml/Wizard/Pages/78-app-update.qml+2
@@ -43,6 +43,8 @@ LocalComponents.Page {
43 property bool authenticated: UpdateManager.authenticated
43 property bool authenticated: UpdateManager.authenticated
44 property bool forceCheck: false
44 property bool forceCheck: false
45
45
46+ showOnVersions: [1]
47+
46 property int updatesCount: {
48 property int updatesCount: {
47 var count = 0;
49 var count = 0;
48 if (authenticated) {
50 if (authenticated) {
qml/Wizard/Pages/DownloadHandler.qml+1−1
@@ -20,7 +20,7 @@ import QtQuick 2.4
20import Ubuntu.DownloadManager 1.2
20import Ubuntu.DownloadManager 1.2
21
21
22Item {
22Item {
23− id: root
23+ id: downloadHandler
24 property var updateModel
24 property var updateModel
25 property alias downloads: downloadManager.downloads
25 property alias downloads: downloadManager.downloads
26 property var udm: DownloadManager {
26 property var udm: DownloadManager {
qml/Wizard/Wizard.qml+2−2
@@ -20,7 +20,7 @@ import Wizard 0.1
20import "../Components"
20import "../Components"
21
21
22Showable {
22Showable {
23− id: root
23+ id: wizard
24
24
25 // This is a bool instead of an alias because Loader classes like to emit
25 // This is a bool instead of an alias because Loader classes like to emit
26 // changed signals for 'active' during startup even if they aren't actually
26 // changed signals for 'active' during startup even if they aren't actually
@@ -54,7 +54,7 @@ Showable {
54
54
55 Connections {
55 Connections {
56 target: loader.item
56 target: loader.item
57− onQuit: root.hide()
57+ onQuit: wizard.hide()
58 }
58 }
59 }
59 }
60}
60}