Differential D28487 Diff 79120 applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/Config.qml
Changeset View
Changeset View
Standalone View
Standalone View
applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/Config.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2019 Marco Martin <mart@kde.org> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU Library General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU Library General Public | ||||
15 | * License along with this program; if not, write to the | ||||
16 | * Free Software Foundation, Inc., | ||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
18 | */ | ||||
19 | | ||||
20 | import QtQuick 2.9 | ||||
21 | import QtQuick.Layouts 1.1 | ||||
22 | import QtQuick.Controls 2.2 as Controls | ||||
23 | | ||||
24 | import org.kde.kirigami 2.8 as Kirigami | ||||
25 | | ||||
26 | import org.kde.ksysguard.sensors 1.0 as Sensors | ||||
27 | | ||||
28 | Kirigami.FormLayout { | ||||
29 | id: root | ||||
30 | | ||||
31 | property alias cfg_showLegend: showSensorsLegendCheckbox.checked | ||||
32 | property alias cfg_fromAngle: fromAngleSpin.value | ||||
33 | property alias cfg_toAngle: toAngleSpin.value | ||||
34 | property alias cfg_smoothEnds: smoothEndsCheckbox.checked | ||||
35 | property alias cfg_rangeAuto: rangeAutoCheckbox.checked | ||||
36 | property alias cfg_rangeFrom: rangeFromSpin.value | ||||
37 | property alias cfg_rangeTo: rangeToSpin.value | ||||
38 | | ||||
39 | Controls.CheckBox { | ||||
40 | id: showSensorsLegendCheckbox | ||||
41 | text: i18n("Show Sensors Legend") | ||||
42 | } | ||||
43 | Controls.SpinBox { | ||||
44 | id: fromAngleSpin | ||||
45 | Kirigami.FormData.label: i18n("Start from Angle") | ||||
46 | from: -180 | ||||
47 | to: 180 | ||||
48 | editable: true | ||||
49 | textFromValue: function(value, locale) { | ||||
50 | return i18nc("angle degrees", "%1°", value + 180); | ||||
51 | } | ||||
52 | valueFromText: function(text, locale) { | ||||
53 | return Number.fromLocaleString(locale, text.replace(i18nc("angle degrees", "°"), "")) - 180; | ||||
54 | } | ||||
55 | } | ||||
56 | Controls.SpinBox { | ||||
57 | id: toAngleSpin | ||||
58 | Kirigami.FormData.label: i18n("Total Pie Angle") | ||||
59 | from: 0 | ||||
60 | to: 360 | ||||
61 | editable: true | ||||
62 | textFromValue: function(value, locale) { | ||||
63 | return i18nc("angle", "%1°", value); | ||||
64 | } | ||||
65 | valueFromText: function(text, locale) { | ||||
66 | return Number.fromLocaleString(locale, text.replace(i18nc("angle degrees", "°"), "")); | ||||
67 | } | ||||
68 | } | ||||
69 | Controls.CheckBox { | ||||
70 | id: smoothEndsCheckbox | ||||
71 | text: i18n("Rounded Lines") | ||||
72 | } | ||||
73 | | ||||
74 | Controls.CheckBox { | ||||
75 | id: rangeAutoCheckbox | ||||
76 | text: i18n("Automatic Data Range") | ||||
77 | } | ||||
78 | Controls.SpinBox { | ||||
79 | id: rangeFromSpin | ||||
80 | editable: true | ||||
81 | Kirigami.FormData.label: i18n("From:") | ||||
82 | enabled: !rangeAutoCheckbox.checked | ||||
83 | } | ||||
84 | Controls.SpinBox { | ||||
85 | id: rangeToSpin | ||||
86 | to: 99999 | ||||
87 | editable: true | ||||
88 | Kirigami.FormData.label: i18n("To:") | ||||
89 | enabled: !rangeAutoCheckbox.checked | ||||
90 | } | ||||
91 | } | ||||
92 | |