Differential D28487 Diff 79120 applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/CompactRepresentation.qml
Changeset View
Changeset View
Standalone View
Standalone View
applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/CompactRepresentation.qml
- This file was moved from applets/systemmonitor/cpu/contents/ui/cpuConfig.qml.
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright 2015 Marco Martin <mart@kde.org> | 2 | * Copyright 2019 Marco Martin <mart@kde.org> | ||
3 | * | 3 | * Copyright 2019 David Edmundson <davidedmundson@kde.org> | ||
4 | * Copyright 2019 Arjen Hiemstra <ahiemstra@heimr.nl> | ||||
5 | * Copyright 2019 Kai Uwe Broulik <kde@broulik.de> | ||||
4 | * | 6 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU Library General Public License as | 8 | * it under the terms of the GNU Library General Public License as | ||
7 | * published by the Free Software Foundation; either version 2 or | 9 | * published by the Free Software Foundation; either version 2, or | ||
8 | * (at your option) any later version. | 10 | * (at your option) any later version. | ||
9 | * | 11 | * | ||
10 | * This program is distributed in the hope that it will be useful, | 12 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details | 15 | * GNU General Public License for more details | ||
14 | * | 16 | * | ||
15 | * You should have received a copy of the GNU Library General Public | 17 | * You should have received a copy of the GNU Library General Public | ||
16 | * License along with this program; if not, write to the | 18 | * License along with this program; if not, write to the | ||
17 | * Free Software Foundation, Inc., | 19 | * Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 21 | */ | ||
20 | 22 | | |||
21 | import QtQuick 2.0 | 23 | import QtQuick 2.9 | ||
24 | import QtQuick.Controls 2.2 as Controls | ||||
22 | import QtQuick.Layouts 1.1 | 25 | import QtQuick.Layouts 1.1 | ||
23 | import org.kde.plasma.plasmoid 2.0 | | |||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | | |||
25 | import org.kde.plasma.components 2.0 as PlasmaComponents | | |||
26 | import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons | | |||
27 | 26 | | |||
28 | ConfigGeneral { | 27 | import org.kde.kirigami 2.8 as Kirigami | ||
29 | id: root | | |||
30 | 28 | | |||
31 | onSourceAdded: { | 29 | import org.kde.ksysguard.sensors 1.0 as Sensors | ||
32 | var match = source.match(/^cpu\/(\w+)\/TotalLoad/); | 30 | import org.kde.quickcharts 1.0 as Charts | ||
33 | if (match) { | 31 | import org.kde.quickcharts.controls 1.0 as ChartControls | ||
34 | root.addSource(source, match[1]); | | |||
35 | } | | |||
36 | } | | |||
37 | 32 | | |||
38 | function sourceDefaultEnable(source) { | 33 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
39 | return source.match(/^cpu(\/|%2F)system(\/|%2F)TotalLoad/); | 34 | | ||
35 | ColumnLayout { | ||||
36 | LineChart { | ||||
37 | Layout.fillWidth: true | ||||
38 | Layout.fillHeight: true | ||||
39 | Layout.alignment: Qt.AlignCenter | ||||
40 | } | 40 | } | ||
41 | Controls.Label { | ||||
42 | id: label | ||||
43 | visible: plasmoid.formFactor == PlasmaCore.Types.Planar | ||||
44 | Layout.alignment: Qt.AlignHCenter | Qt.AlignTop | ||||
45 | text: plasmoid.configuration.title | ||||
41 | } | 46 | } | ||
47 | } | ||||
48 | |