1//=============================================================================
2//  MuseScore
3//  Music Composition & Notation
4//
5//  Copyright (C) 2019-2020 MuseScore BVBA and others
6//
7//  This program is free software; you can redistribute it and/or modify
8//  it under the terms of the GNU General Public License version 2.
9//
10//  This program is distributed in the hope that it will be useful,
11//  but WITHOUT ANY WARRANTY; without even the implied warranty of
12//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13//  GNU General Public License for more details.
14//
15//  You should have received a copy of the GNU General Public License
16//  along with this program; if not, write to the Free Software
17//  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18//=============================================================================
19
20import QtQuick 2.0
21import MuseScore.Telemetry 3.3
22
23FocusScope {
24    id: root
25
26    signal closeRequested
27
28    height: childrenRect.height
29
30    Keys.onEscapePressed: {
31        root.closeRequested()
32    }
33
34    Rectangle {
35        anchors.fill: parent
36
37        color: globalStyle.window
38    }
39
40    TelemetryPermissionModel {
41        id: permissionModel
42    }
43
44    Column {
45        id: contentWrapper
46
47        width: root.width
48
49        spacing: 36
50
51        Item {
52            id: topSpacer
53
54            height: 1
55            width: parent.width
56        }
57
58        TextLabel {
59            id: titleLabel
60
61            anchors {
62                left: parent.left
63                right: parent.right
64            }
65
66            horizontalAlignment: Text.AlignHCenter
67            wrapMode: Text.WordWrap
68
69            color: "#00447a"
70            font.pixelSize: 28
71
72            text: qsTr("Help us improve MuseScore")
73        }
74
75        Column {
76            id: messageContentWrapper
77
78            anchors {
79                left: parent.left
80                leftMargin: 32
81                right: parent.right
82                rightMargin: 32
83            }
84
85            spacing: 24
86
87            TextLabel {
88                id: intent
89
90                lineHeight: 1.5
91
92                text: qsTr("We'd like to collect anonymous telemetry data to help us prioritize improvements. " +
93                           "This includes how often you use certain features, statistics " +
94                           "on preferred file formats, crashes, number of instruments per score, etc.")
95            }
96
97            TextLabel {
98                id: ignoredDataTypesLabel
99
100                anchors {
101                    left: parent.left
102                    leftMargin: 10
103                    right: parent.right
104                    rightMargin: 10
105                }
106
107                lineHeight: 1.5
108
109                text: "<b>" + qsTr("We <u>do not</u> collect any personal data or sensitive information, such as " +
110                           "location, source code, file names, or music") + "</b>"
111            }
112
113            TextLabel {
114                id: questionLabel
115
116                text: qsTr("Do you allow MuseScore to send us anonymous reports?")
117            }
118        }
119
120        Column {
121            id: buttonWrapper
122
123            width: parent.width
124
125            spacing: 24
126
127            Column {
128
129                width: parent.width
130
131                spacing: 10
132
133                DialogButton {
134                    id: positiveButton
135
136                    anchors {
137                        horizontalCenter: parent.horizontalCenter
138                    }
139
140                    text: qsTr("Yes, send anonymous reports")
141
142                    onClicked: {
143                        permissionModel.accept()
144                        root.closeRequested()
145                    }
146                }
147
148                TextLabel {
149                    anchors {
150                        horizontalCenter: parent.horizontalCenter
151                    }
152
153                    text: qsTr("(You can change this behaviour any time in 'Preferences… > General > Telemetry')")
154                }
155            }
156
157            Column {
158
159                width: parent.width
160
161                spacing: 10
162
163                DialogButton {
164                    id: negativeButton
165
166                    anchors {
167                        horizontalCenter: parent.horizontalCenter
168                    }
169
170                    text: qsTr("Don't send")
171
172                    onClicked: {
173                        permissionModel.reject()
174                        root.closeRequested()
175                    }
176                }
177
178                TextLabel {
179                    anchors {
180                        horizontalCenter: parent.horizontalCenter
181                    }
182
183                    text: qsTr("For more information, please take a look at our %1Privacy Policy%2").arg("<a href=\"https://musescore.com/legal/privacy\">").arg("</a>")
184
185                    onLinkActivated: {
186                        permissionModel.openLink(link)
187                    }
188                }
189            }
190        }
191
192        Item {
193            id: bottomSpacer
194
195            height: 1
196            width: parent.width
197        }
198    }
199}
200