main.qml 4.46 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Copyright (C) 2019 David Edmundson <davidedmundson@kde.org>
 * Copyright (C) 2019 Aleix Pol Gonzalez <aleixpol@kde.org>
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this library; see the file COPYING.LIB.  If not, write to
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301, USA.
*/

import QtQuick 2.1
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as QQC2
import org.kde.kirigami 2.6 as Kirigami
import org.kde.userfeedback 1.0 as UserFeedback
import org.kde.kcm 1.2

SimpleKCM {
    id: root

    ConfigModule.buttons: ConfigModule.Defaults | ConfigModule.Apply
    leftPadding: width * 0.1
    rightPadding: leftPadding

Nate Graham's avatar
Nate Graham committed
35
36
    ColumnLayout {

37
        QQC2.CheckBox {
Nate Graham's avatar
Nate Graham committed
38
39
40
            Layout.topMargin: Kirigami.Units.gridUnit
            Layout.bottomMargin: Kirigami.Units.gridUnit
            Layout.alignment: Qt.AlignHCenter
41
42
            checked: kcm.feedbackEnabled
            onToggled: kcm.feedbackEnabled = checked
Yuri Chornoivan's avatar
Yuri Chornoivan committed
43
            text: i18n("Allow KDE software to collect anonymous usage information")
44
45
46
47
48
49
50
        }

        QQC2.Label {
            Kirigami.FormData.label: i18n("Plasma:")
            Layout.alignment: Qt.AlignHCenter
            Layout.fillWidth: true
            wrapMode: Text.WordWrap
Nate Graham's avatar
Nate Graham committed
51
            text: xi18nc("@info", "You can help us improve this software by sharing information about how you use it. This allows us to focus on things that matter to you.<nl/><nl/>Contributing usage information is optional and entirely anonymous. It will not associate the data with any kind of unique identifier, and will never track the documents you open, the websites you visit, or any other kind of personal information.<nl/><nl/>You can read more about our policy in the following link:")
52
53
54
        }

        Kirigami.UrlButton {
Nate Graham's avatar
Nate Graham committed
55
            Layout.alignment: Qt.AlignHCenter
56
57
58
            url: "https://kde.org/privacypolicy-apps.php"
        }

Nate Graham's avatar
Nate Graham committed
59
        Kirigami.Separator {
60
            Layout.fillWidth: true
Nate Graham's avatar
Nate Graham committed
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
            Layout.topMargin: Kirigami.Units.gridUnit
            Layout.bottomMargin: Kirigami.Units.gridUnit
        }

        Kirigami.FormLayout {

            QQC2.ComboBox {
                id: statisticsModeCombo
                Kirigami.FormData.label: i18n("Plasma:")
                enabled: kcm.feedbackEnabled
                Layout.fillWidth: true
                textRole: "text"
                model: ListModel { id: modeOptions }

                Component.onCompleted: {
                    modeOptions.append({text: i18n("Send basic system information"), value: UserFeedback.Provider.BasicSystemInformation})
                    modeOptions.append({text: i18n("Send basic usage information"), value: UserFeedback.Provider.BasicUsageStatistics})
                    modeOptions.append({text: i18n("Send detailed system information"), value: UserFeedback.Provider.DetailedSystemInformation})
                    modeOptions.append({text: i18n("Send detailed usage information"), value: UserFeedback.Provider.DetailedUsageStatistics})

                    for(var i = 0, c=modeOptions.count; i<c; ++i) {
                        if (modeOptions.get(i).value === kcm.plasmaFeedbackLevel) {
                            currentIndex = i;
                            break;
                        }
86
                    }
Nate Graham's avatar
Nate Graham committed
87
88
                    if (currentIndex < 0)
                        currentIndex = 2
89
90
                }

Nate Graham's avatar
Nate Graham committed
91
92
93
                onActivated: {
                    kcm.plasmaFeedbackLevel = modeOptions.get(index).value;
                }
94
95
            }

Nate Graham's avatar
Nate Graham committed
96
97
98
            UserFeedback.FeedbackConfigUiController {
                id: feedbackController
            }
99

Nate Graham's avatar
Nate Graham committed
100
101
102
103
104
105
            QQC2.Label {
                Layout.alignment: Qt.AlignHCenter
                Layout.maximumWidth: root.width * 0.5
                wrapMode: Text.WordWrap
                text: feedbackController.telemetryDescription(modeOptions.get(statisticsModeCombo.currentIndex).value)
            }
106
107
108
109
        }
    }
}