Unity 8
here-terms.qml
1 /*
2  * Copyright (C) 2014-2016 Canonical, Ltd.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 import QtQuick 2.4
18 import Ubuntu.Components 1.3
19 import Ubuntu.Web 0.2
20 import ".." as LocalComponents
21 
22 LocalComponents.Page {
23  objectName: "hereTermsPage"
24 
25  title: i18n.tr("Terms & Conditions")
26  customBack: true
27  customTitle: true
28 
29  onBackClicked: {
30  if (webview.visible) {
31  showBrowser(false);
32  } else {
33  pageStack.prev();
34  }
35  }
36 
37  function showBrowser(show) {
38  if (show) {
39  label1.visible = false;
40  label2.visible = false;
41  label3.visible = false;
42  label4.visible = false;
43  webview.visible = true;
44  } else {
45  webview.visible = false;
46  label1.visible = true;
47  label2.visible = true;
48  label3.visible = true;
49  label4.visible = true;
50  }
51  }
52 
53  Column {
54  id: column
55  anchors.fill: content
56  anchors.leftMargin: staticMargin
57  anchors.rightMargin: wideMode ? parent.rightMargin : staticMargin
58  spacing: units.gu(3)
59 
60  Label {
61  id: label1
62  anchors.left: parent.left
63  anchors.right: parent.right
64  wrapMode: Text.Wrap
65  color: textColor
66  fontSize: "small"
67  font.weight: Font.Light
68  lineHeight: 1.2
69  text: i18n.tr("Your device uses positioning technologies provided by HERE.")
70  }
71 
72  Label {
73  id: label2
74  anchors.left: parent.left
75  anchors.right: parent.right
76  wrapMode: Text.Wrap
77  color: textColor
78  fontSize: "small"
79  font.weight: Font.Light
80  lineHeight: 1.2
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.")
82  }
83 
84  Label {
85  id: label3
86  anchors.left: parent.left
87  anchors.right: parent.right
88  wrapMode: Text.Wrap
89  color: textColor
90  fontSize: "small"
91  font.weight: Font.Light
92  lineHeight: 1.2
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.")
94  }
95 
96  Label {
97  id: label4
98  anchors.left: parent.left
99  anchors.right: parent.right
100  wrapMode: Text.Wrap
101  color: textColor
102  fontSize: "small"
103  font.weight: Font.Light
104  lineHeight: 1.2
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>");
109  onLinkActivated: {
110  showBrowser(true);
111  webview.url = link;
112  }
113  }
114 
115  WebView {
116  id: webview
117  objectName: "webview"
118  anchors.left: parent.left
119  anchors.right: parent.right
120  anchors.leftMargin: -leftMargin
121  anchors.rightMargin: -rightMargin
122  height: parent.height
123  visible: false
124  }
125  }
126 }