on xenial help sign in
line up with the visuals, provide a custom title-less page
b8f6fb1Lukáš Tinkl
qml/Wizard/CheckableSetting.qml+1
@@ -79,6 +79,7 @@ ListItem.Empty {
79 wrapMode: Text.Wrap
79 wrapMode: Text.Wrap
80 linkColor: Theme.palette.normal.foregroundText
80 linkColor: Theme.palette.normal.foregroundText
81 color: "black"
81 color: "black"
82+ font.weight: Font.Light
82 onLinkActivated: listItem.linkActivated(link)
83 onLinkActivated: listItem.linkActivated(link)
83 }
84 }
84 }
85 }
qml/Wizard/Page.qml+8−3
@@ -27,6 +27,7 @@ Item {
27 readonly property real bottomMargin: units.gu(3)
27 readonly property real bottomMargin: units.gu(3)
28 readonly property real leftMargin: units.gu(3)
28 readonly property real leftMargin: units.gu(3)
29 readonly property real rightMargin: units.gu(3)
29 readonly property real rightMargin: units.gu(3)
30+ readonly property real customMargin: units.gu(4) // margin for the custom (w/o title bar) pages
30
31
31 // If you want to skip a page, mark skipValid false while you figure out
32 // If you want to skip a page, mark skipValid false while you figure out
32 // whether to skip, then set it to true once you've determined the value
33 // whether to skip, then set it to true once you've determined the value
@@ -34,8 +35,12 @@ Item {
34 property bool skipValid: true
35 property bool skipValid: true
35 property bool skip: false
36 property bool skip: false
36
37
38+ property bool mobileOnly: true
39+ property bool desktopOnly: false
40+
37 property bool hasBackButton: true
41 property bool hasBackButton: true
38 property bool customBack: false
42 property bool customBack: false
43+ property bool customTitle: false
39 property alias forwardButtonSourceComponent: forwardButton.sourceComponent
44 property alias forwardButtonSourceComponent: forwardButton.sourceComponent
40 property alias content: contentHolder
45 property alias content: contentHolder
41
46
@@ -54,8 +59,8 @@ Item {
54 left: parent.left
59 left: parent.left
55 right: parent.right
60 right: parent.right
56 }
61 }
57− height: topMargin + bottomMargin
62+ height: customTitle ? customMargin + titleLabel.height + customMargin : topMargin + bottomMargin
58− color: "#650954"
63+ color: customTitle ? "#fdfdfd" : "#650954"
59
64
60 Label {
65 Label {
61 id: titleLabel
66 id: titleLabel
@@ -69,7 +74,7 @@ Item {
69 }
74 }
70 wrapMode: Text.Wrap
75 wrapMode: Text.Wrap
71 text: title
76 text: title
72− color: "white"
77+ color: customTitle ? "black" : "white"
73 fontSize: "x-large"
78 fontSize: "x-large"
74 }
79 }
75 }
80 }
qml/Wizard/Pages.qml+1
@@ -91,6 +91,7 @@ Item {
91 }
91 }
92
92
93 function load(path) {
93 function load(path) {
94+ print("Loading: " + path)
94 if (currentPage) {
95 if (currentPage) {
95 currentPage.enabled = false
96 currentPage.enabled = false
96 }
97 }
qml/Wizard/Pages/20-sim.qml+1−1
@@ -25,6 +25,7 @@ LocalComponents.Page {
25
25
26 title: i18n.tr("No SIM card installed")
26 title: i18n.tr("No SIM card installed")
27 forwardButtonSourceComponent: forwardButton
27 forwardButtonSourceComponent: forwardButton
28+ customTitle: true
28
29
29 skipValid: !manager.available ||
30 skipValid: !manager.available ||
30 (manager.ready && (manager.modems.length < 1 || simManager0.ready)
31 (manager.ready && (manager.modems.length < 1 || simManager0.ready)
@@ -80,7 +81,6 @@ LocalComponents.Page {
80 Column {
81 Column {
81 anchors.fill: content
82 anchors.fill: content
82 spacing: units.gu(4)
83 spacing: units.gu(4)
83− anchors.topMargin: units.gu(4)
84
84
85 Label {
85 Label {
86 anchors.left: parent.left
86 anchors.left: parent.left
qml/Wizard/Pages/50-location.qml+6−3
@@ -66,7 +66,7 @@ LocalComponents.Page {
66 id: hereCheck
66 id: hereCheck
67 objectName: "hereCheck"
67 objectName: "hereCheck"
68 showDivider: false
68 showDivider: false
69− text: i18n.tr("Use GPS, Wi-FI hotspots nad mobile network anonymously to detect location (recommended)")
69+ text: i18n.tr("Use GPS, Wi-Fi hotspots and mobile network anonymously to detect location (recommended)")
70 checked: true
70 checked: true
71 onTriggered: {
71 onTriggered: {
72 gpsCheck.checked = false;
72 gpsCheck.checked = false;
@@ -82,9 +82,10 @@ LocalComponents.Page {
82 anchors.leftMargin: hereCheck.labelOffset
82 anchors.leftMargin: hereCheck.labelOffset
83 anchors.right: parent.right
83 anchors.right: parent.right
84 wrapMode: Text.Wrap
84 wrapMode: Text.Wrap
85− linkColor: UbuntuColors.darkGrey
85+ linkColor: "#dd4814"
86 color: "black"
86 color: "black"
87 fontSize: "small"
87 fontSize: "small"
88+ font.weight: Font.Light
88 // TRANSLATORS: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
89 // TRANSLATORS: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
89 text: i18n.tr("By selecting this option you agree to the Nokia HERE <a href='#'>terms and conditions</a>.")
90 text: i18n.tr("By selecting this option you agree to the Nokia HERE <a href='#'>terms and conditions</a>.")
90 onLinkActivated: pageStack.load(Qt.resolvedUrl("here-terms.qml"))
91 onLinkActivated: pageStack.load(Qt.resolvedUrl("here-terms.qml"))
@@ -119,8 +120,10 @@ LocalComponents.Page {
119 anchors.left: parent.left
120 anchors.left: parent.left
120 anchors.right: parent.right
121 anchors.right: parent.right
121 wrapMode: Text.Wrap
122 wrapMode: Text.Wrap
122− text: i18n.tr("You can change it later in <b>System Settings</b>.")
123+ text: i18n.tr("You can change it later in <em>System Settings</em>.")
123 color: "black"
124 color: "black"
125+ fontSize: "small"
126+ font.weight: Font.Light
124 }
127 }
125 }
128 }
126
129
qml/Wizard/Pages/60-passwd-type.qml+1
@@ -37,6 +37,7 @@ LocalComponents.Page {
37
37
38 title: i18n.tr("Lock security")
38 title: i18n.tr("Lock security")
39 forwardButtonSourceComponent: forwardButton
39 forwardButtonSourceComponent: forwardButton
40+ skip: false
40
41
41 function indexToMethod(index) {
42 function indexToMethod(index) {
42 if (index === 0)
43 if (index === 0)
qml/Wizard/Pages/here-terms.qml+83−65
@@ -15,9 +15,7 @@
15 */
15 */
16
16
17import QtQuick 2.3
17import QtQuick 2.3
18−import AccountsService 0.1
19−import Qt.labs.folderlistmodel 2.1
20−import Ubuntu.Components 1.1
18+import Ubuntu.Components 1.2
21import Ubuntu.Web 0.2
19import Ubuntu.Web 0.2
22import ".." as LocalComponents
20import ".." as LocalComponents
23
21
@@ -26,88 +24,106 @@ LocalComponents.Page {
26
24
27 title: i18n.tr("Terms & Conditions")
25 title: i18n.tr("Terms & Conditions")
28 customBack: true
26 customBack: true
27+ customTitle: true
29
28
30− FolderListModel {
29+ onBackClicked: {
31− id: termsModel
30+ if (webview.visible) {
32− folder: AccountsService.hereLicensePath
31+ showBrowser(false)
33− nameFilters: ["*.html"]
32+ } else {
34− showDirs: false
33+ pageStack.prev()
35− showOnlyReadable: true
34+ }
36− onCountChanged: loadFileContent()
37− }
38−
39− function makeFileName(lang, country) {
40− return lang + "_" + country + ".html"
41 }
35 }
42
36
43− function defaultCountryForLanguage(lang) {
37+ function showBrowser(show) {
44− if (lang === "cs") return "CZ"
38+ if (show) {
45− if (lang === "da") return "DK"
39+ label1.visible = false
46− if (lang === "en") return "US"
40+ label2.visible = false
47− if (lang === "ko") return "KR"
41+ label3.visible = false
48− if (lang === "zh") return "CN"
42+ label4.visible = false
49− return lang.toUpperCase()
43+ label5.visible = false
44+ webview.visible = true
45+ } else {
46+ webview.visible = false
47+ label1.visible = true
48+ label2.visible = true
49+ label3.visible = true
50+ label4.visible = true
51+ label5.visible = true
52+ }
50 }
53 }
51
54
52− function determineFileName() {
55+ Column {
53− var codes = i18n.language.split(".")[0].split("_")
56+ id: column
54− var defaultCountry = defaultCountryForLanguage(codes[0])
57+ anchors.fill: content
55− if (codes.count === 1)
58+ spacing: units.gu(3)
56− codes = [codes[0], defaultCountry]
57− var perfectMatch = makeFileName(codes[0], codes[1])
58− var nearMatch = makeFileName(codes[0], defaultCountry)
59− var nearMatchExists = false
60
59
61− for (var i = 0; i < termsModel.count; i++) {
60+ Label {
62− var fileName = termsModel.get(i, "fileName")
61+ id: label1
63− if (fileName == perfectMatch) {
62+ anchors.left: parent.left
64− return perfectMatch
63+ anchors.right: parent.right
65− } else if (fileName == nearMatch) {
64+ wrapMode: Text.Wrap
66− nearMatchExists = true
65+ color: "black"
67− }
66+ fontSize: "small"
67+ font.weight: Font.Light
68+ text: i18n.tr("Your device uses positioning technologies provided by HERE.")
68 }
69 }
69
70
70− if (nearMatchExists) {
71+ Label {
71− return nearMatch
72+ id: label2
72− } else {
73+ anchors.left: parent.left
73− return makeFileName("en", "US")
74+ anchors.right: parent.right
75+ wrapMode: Text.Wrap
76+ color: "black"
77+ fontSize: "small"
78+ font.weight: Font.Light
79+ text: i18n.tr("To provide you with positioning services and to improve their quality, HERE collects " +
80+ "information about nearby cell towers and Wi-Fi hotspots around your current location " +
81+ "whenever your position is being found.")
74 }
82 }
75− }
76
83
77− function loadFileContent() {
84+ Label {
78− var xhr = new XMLHttpRequest
85+ id: label3
79− xhr.open("GET", AccountsService.hereLicensePath + "/" + determineFileName())
86+ anchors.left: parent.left
80− xhr.onreadystatechange = function() {
87+ anchors.right: parent.right
81− if (xhr.readyState == XMLHttpRequest.DONE) {
88+ wrapMode: Text.Wrap
82− termsLabel.text = xhr.responseText
89+ color: "black"
83− }
90+ fontSize: "small"
91+ font.weight: Font.Light
92+ text: i18n.tr("The information collected is used to analyze the service and to " +
93+ "improve the use of service, but not to identify you personally.")
84 }
94 }
85− xhr.send()
86− }
87
95
88− onBackClicked: {
96+ Label {
89− if (webview.visible) {
97+ id: label4
90− termsLabel.visible = true
98+ anchors.left: parent.left
91− } else {
99+ anchors.right: parent.right
92− pageStack.prev()
100+ wrapMode: Text.Wrap
101+ color: "black"
102+ fontSize: "small"
103+ font.weight: Font.Light
104+ linkColor: "#dd4814"
105+ text: i18n.tr("By continuing, you agree to the HERE Platform Service Terms:") +
106+ " <a href=\"http://here.com/terms/service-terms\">http://here.com/terms/service-terms</a>"
107+ onLinkActivated: {
108+ showBrowser(true)
109+ webview.url = link
110+ }
93 }
111 }
94− }
95−
96− Column {
97− id: column
98− anchors.fill: content
99
112
100 Label {
113 Label {
101− id: termsLabel
114+ id: label5
102− objectName: "termsLabel"
103 anchors.left: parent.left
115 anchors.left: parent.left
104 anchors.right: parent.right
116 anchors.right: parent.right
105 wrapMode: Text.Wrap
117 wrapMode: Text.Wrap
106 color: "black"
118 color: "black"
119+ fontSize: "small"
120+ font.weight: Font.Light
107− linkColor: UbuntuColors.darkGrey
121+ linkColor: "#dd4814"
122+ text: i18n.tr("and Privacy Policy:") +
123+ " <a href=\"http://here.com/privacy/privacy-policy\">http://here.com/privacy/privacy-policy</a>"
108 onLinkActivated: {
124 onLinkActivated: {
125+ showBrowser(true)
109 webview.url = link
126 webview.url = link
110− termsLabel.visible = false
111 }
127 }
112 }
128 }
113
129
@@ -116,8 +132,10 @@ LocalComponents.Page {
116 objectName: "webview"
132 objectName: "webview"
117 anchors.left: parent.left
133 anchors.left: parent.left
118 anchors.right: parent.right
134 anchors.right: parent.right
135+ anchors.leftMargin: 0
136+ anchors.rightMargin: 0
119 height: parent.height
137 height: parent.height
120− visible: !termsLabel.visible
138+ visible: false
121 }
139 }
122 }
140 }
123}
141}