27
25
title: i18n.tr("Terms & Conditions")
32
folder: AccountsService.hereLicensePath
33
nameFilters: ["*.html"]
35
showOnlyReadable: true
36
onCountChanged: loadFileContent()
39
function makeFileName(lang, country) {
40
return lang + "_" + country + ".html"
43
function defaultCountryForLanguage(lang) {
44
if (lang === "da") return "DK"
45
if (lang === "en") return "US"
46
if (lang === "ko") return "KR"
47
if (lang === "zh") return "CN"
48
return lang.toUpperCase()
51
function determineFileName() {
52
var codes = i18n.language.split(".")[0].split("_")
53
var defaultCountry = defaultCountryForLanguage(codes[0])
54
if (codes.count === 1)
55
codes = [codes[0], defaultCountry]
56
var perfectMatch = makeFileName(codes[0], codes[1])
57
var nearMatch = makeFileName(codes[0], defaultCountry)
58
var nearMatchExists = false
60
for (var i = 0; i < termsModel.count; i++) {
61
var fileName = termsModel.get(i, "fileName")
62
if (fileName == perfectMatch) {
64
} else if (fileName == nearMatch) {
65
nearMatchExists = true
69
if (nearMatchExists) {
72
return makeFileName("en", "US")
76
function loadFileContent() {
77
var xhr = new XMLHttpRequest
78
xhr.open("GET", AccountsService.hereLicensePath + "/" + determineFileName())
79
xhr.onreadystatechange = function() {
80
if (xhr.readyState == XMLHttpRequest.DONE) {
81
termsLabel.text = xhr.responseText
88
30
if (webview.visible) {
89
termsLabel.visible = true
37
function showBrowser(show) {
39
label1.visible = false;
40
label2.visible = false;
41
label3.visible = false;
42
label4.visible = false;
43
webview.visible = true;
45
webview.visible = false;
46
label1.visible = true;
47
label2.visible = true;
48
label3.visible = true;
49
label4.visible = true;
97
55
anchors.fill: content
101
objectName: "termsLabel"
102
anchors.left: parent.left
103
anchors.right: parent.right
105
linkColor: theme.palette.normal.foregroundText
56
anchors.leftMargin: staticMargin
57
anchors.rightMargin: wideMode ? parent.rightMargin : staticMargin
62
anchors.left: parent.left
63
anchors.right: parent.right
67
font.weight: Font.Light
69
text: i18n.tr("Your device uses positioning technologies provided by HERE.")
74
anchors.left: parent.left
75
anchors.right: parent.right
79
font.weight: Font.Light
81
text: i18n.tr("To provide you with positioning services and to improve their quality, HERE collects information about nearby cell towers and Wi-Fi hotspots around your current location whenever your position is being found.")
86
anchors.left: parent.left
87
anchors.right: parent.right
91
font.weight: Font.Light
93
text: i18n.tr("The information collected is used to analyze the service and to improve the use of service, but not to identify you personally.")
98
anchors.left: parent.left
99
anchors.right: parent.right
103
font.weight: Font.Light
105
linkColor: UbuntuColors.orange
106
text: i18n.tr("By continuing, you agree to the HERE platform %1 and %2.")
107
.arg("<a href=\"http://here.com/terms/service-terms\">" + i18n.tr("Service Terms") + "</a>")
108
.arg("<a href=\"http://here.com/privacy/privacy-policy\">" + i18n.tr("Privacy Policy") + "</a>");
106
109
onLinkActivated: {
108
termsLabel.visible = false