diff --git a/applets/CMakeLists.txt b/applets/CMakeLists.txt index 9cd481a8d..665ae3494 100644 --- a/applets/CMakeLists.txt +++ b/applets/CMakeLists.txt @@ -1,25 +1,24 @@ plasma_install_package(activitybar org.kde.plasma.activitybar) add_subdirectory(icon) plasma_install_package(analog-clock org.kde.plasma.analogclock) plasma_install_package(mediacontroller org.kde.plasma.mediacontroller) plasma_install_package(lock_logout org.kde.plasma.lock_logout) add_subdirectory(appmenu) add_subdirectory(systemmonitor) -add_subdirectory(sysguard) add_subdirectory(batterymonitor) add_subdirectory(calendar) add_subdirectory(devicenotifier) add_subdirectory(digital-clock) add_subdirectory(kicker) add_subdirectory(panelspacer) plasma_install_package(clipboard org.kde.plasma.clipboard) if(NOT WIN32) # #notifications # #should compile also on windows? (even if doesn't really make sense) add_subdirectory(notifications) add_subdirectory(systemtray) endif() diff --git a/applets/sysguard/CMakeLists.txt b/applets/sysguard/CMakeLists.txt deleted file mode 100644 index 3a9c85d1c..000000000 --- a/applets/sysguard/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ - -add_subdirectory(sensorchart) - -#sensorchart presets -plasma_install_package(coreusage org.kde.ksysguard.sensorchart.cpucore) -plasma_install_package(cpuusage org.kde.ksysguard.sensorchart.cpuusage) -plasma_install_package(memoryusage org.kde.ksysguard.sensorchart.memoryusage) -plasma_install_package(diskusage org.kde.ksysguard.sensorchart.diskusage) -plasma_install_package(networkspeed org.kde.ksysguard.sensorchart.networkspeed) diff --git a/applets/sysguard/cpuusage/metadata.desktop b/applets/sysguard/cpuusage/metadata.desktop deleted file mode 100644 index e56a8c0eb..000000000 --- a/applets/sysguard/cpuusage/metadata.desktop +++ /dev/null @@ -1,33 +0,0 @@ -[Desktop Entry] -Name=Total CPU Use -Name[de]=Gesamte Prozessorauslastung -Comment=System monitor Widget that shows the total CPU usage -Type=Service -Icon=cpu -X-KDE-ServiceTypes=Plasma/Applet - -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/main.qml -X-Plasma-Provides=org.kde.plasma.systemmonitor -X-Plasma-RootPath=org.kde.ksysguard.sensorchart - -X-KDE-PluginInfo-Author=Kai Uwe Broulik -X-KDE-PluginInfo-Email=kde@privat.broulik.de -X-KDE-PluginInfo-Name=org.kde.ksysguard.sensorchart.cpuusage -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=kde.org -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-Category=System Information - -[Config] -chartFace=org.kde.ksysguard.piechart -sensorIds=cpu/system/TotalLoad -totalSensor=cpu/system/TotalLoad -textOnlySensorIds=cpu/system/processors,cpu/system/cores - -[FaceConfig] -rangeAuto=false -rangeFrom=0 -rangeTo=100 diff --git a/applets/sysguard/diskactivity/metadata.desktop b/applets/sysguard/diskactivity/metadata.desktop deleted file mode 100644 index 698fb2903..000000000 --- a/applets/sysguard/diskactivity/metadata.desktop +++ /dev/null @@ -1,31 +0,0 @@ -[Desktop Entry] -Name=Hard Disk Activity -Comment=An applet that monitors hard disk throughput and input/output -Type=Service -Icon=drive-harddisk -X-KDE-ServiceTypes=Plasma/Applet - -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/main.qml -X-Plasma-Provides=org.kde.plasma.systemmonitor -X-Plasma-RootPath=org.kde.ksysguard.sensorchart -X-Plasma-StandAloneApp=true - -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=mart@kde.org -X-KDE-PluginInfo-Name=org.kde.ksysguard.sensorchart.diskactivity -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=kde.org -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-Category=System Information -X-KDE-FormFactors=tablet,mediacenter,desktop - -[Config] -chartFace=org.kde.ksysguard.linechart -sensorIds=disk/all/write,disk/all/read - -[FaceConfig] -rangeAuto=true -lineChartStacked=true diff --git a/applets/sysguard/diskusage/metadata.desktop b/applets/sysguard/diskusage/metadata.desktop deleted file mode 100644 index 02e2a2c0d..000000000 --- a/applets/sysguard/diskusage/metadata.desktop +++ /dev/null @@ -1,32 +0,0 @@ -[Desktop Entry] -Name=Disk Usage -Comment=System monitor Widget that shows the usage of the root partition -Type=Service -Icon=cpu -X-KDE-ServiceTypes=Plasma/Applet - -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/main.qml -X-Plasma-Provides=org.kde.plasma.systemmonitor -X-Plasma-RootPath=org.kde.ksysguard.sensorchart - -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=mart@kde.org -X-KDE-PluginInfo-Name=org.kde.ksysguard.sensorchart.diskusage -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=kde.org -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-Category=System Information - -[Config] -chartFace=org.kde.ksysguard.piechart -sensorIds=partitions/all/usedspace -totalSensor=partitions/all/filllevel -textOnlySensorIds=partitions/all/total - -[FaceConfig] -rangeAuto=true -rangeFrom=0 -rangeTo=100 diff --git a/applets/sysguard/memoryusage/metadata.desktop b/applets/sysguard/memoryusage/metadata.desktop deleted file mode 100644 index 941b07c90..000000000 --- a/applets/sysguard/memoryusage/metadata.desktop +++ /dev/null @@ -1,33 +0,0 @@ -[Desktop Entry] -Name=Memory Usage -Name[de]=Speicherverwendung -Comment=System monitor Widget that shows physical memory usage -Type=Service -Icon=ksysguardd -X-KDE-ServiceTypes=Plasma/Applet - -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/main.qml -X-Plasma-Provides=org.kde.plasma.systemmonitor -X-Plasma-RootPath=org.kde.ksysguard.sensorchart - -X-KDE-PluginInfo-Author=Kai Uwe Broulik -X-KDE-PluginInfo-Email=kde@privat.broulik.de -X-KDE-PluginInfo-Name=org.kde.ksysguard.sensorchart.memoryusage -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=kde.org -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-Category=System Information - -[Config] -chartFace=org.kde.ksysguard.piechart -sensorIds=mem/physical/allocated -totalSensor=mem/physical/allocatedlevel -textOnlySensorIds=mem/physical/total - -[FaceConfig] -rangeAuto=true -rangeFrom=0 -rangeTo=100 diff --git a/applets/sysguard/networkspeed/metadata.desktop b/applets/sysguard/networkspeed/metadata.desktop deleted file mode 100644 index 5f54101a5..000000000 --- a/applets/sysguard/networkspeed/metadata.desktop +++ /dev/null @@ -1,30 +0,0 @@ -[Desktop Entry] -Name=Network speed -Comment=System monitor Widget that shows the download and upload data rate -Type=Service -Icon=network-workgroup -X-KDE-ServiceTypes=Plasma/Applet - -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/main.qml -X-Plasma-Provides=org.kde.plasma.systemmonitor -X-Plasma-RootPath=org.kde.ksysguard.sensorchart - -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=mart@kde.org -X-KDE-PluginInfo-Name=org.kde.ksysguard.sensorchart.networkspeed -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=kde.org -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-Category=System Information - -[Config] -chartFace=org.kde.ksysguard.linechart -sensorIds=network/all/receivedDataRate,network/all/sentDataRate -totalSensor= -textOnlySensorIds= - -[FaceConfig] -lineChartSmooth=true diff --git a/applets/systemmonitor/CMakeLists.txt b/applets/systemmonitor/CMakeLists.txt index 19ca590c1..fdc4ae649 100644 --- a/applets/systemmonitor/CMakeLists.txt +++ b/applets/systemmonitor/CMakeLists.txt @@ -1,15 +1,10 @@ -install(DIRECTORY common/ DESTINATION ${PLASMA_DATA_INSTALL_DIR}/plasmoids/org.kde.plasma.systemmonitor.net) -plasma_install_package(net org.kde.plasma.systemmonitor.net) +add_subdirectory(systemmonitor) -install(DIRECTORY common/ DESTINATION ${PLASMA_DATA_INSTALL_DIR}/plasmoids/org.kde.plasma.systemmonitor.cpu) +# Systemmonitor presets +plasma_install_package(coreusage org.kde.plasma.systemmonitor.cpucore) plasma_install_package(cpu org.kde.plasma.systemmonitor.cpu) - -install(DIRECTORY common/ DESTINATION ${PLASMA_DATA_INSTALL_DIR}/plasmoids/org.kde.plasma.systemmonitor.diskactivity) -plasma_install_package(diskactivity org.kde.plasma.systemmonitor.diskactivity) - -install(DIRECTORY common/ DESTINATION ${PLASMA_DATA_INSTALL_DIR}/plasmoids/org.kde.plasma.systemmonitor.memory) plasma_install_package(memory org.kde.plasma.systemmonitor.memory) - -install(DIRECTORY common/ DESTINATION ${PLASMA_DATA_INSTALL_DIR}/plasmoids/org.kde.plasma.systemmonitor.diskusage) plasma_install_package(diskusage org.kde.plasma.systemmonitor.diskusage) +plasma_install_package(diskactivity org.kde.plasma.systemmonitor.diskactivity) +plasma_install_package(net org.kde.plasma.systemmonitor.net) diff --git a/applets/systemmonitor/common/contents/config/main.xml b/applets/systemmonitor/common/contents/config/main.xml deleted file mode 100644 index 42adb008c..000000000 --- a/applets/systemmonitor/common/contents/config/main.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - 2000 - - - - - - - - 1 - - - - diff --git a/applets/systemmonitor/common/contents/ui/Applet.qml b/applets/systemmonitor/common/contents/ui/Applet.qml deleted file mode 100644 index 575f96dd7..000000000 --- a/applets/systemmonitor/common/contents/ui/Applet.qml +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2014 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.extras 2.0 as PlasmaExtras - -Item { - id: rootItem - - signal sourceAdded(string source) - property Component delegate - - width: units.gridUnit * 10 - height: units.gridUnit * 10 - Plasmoid.preferredRepresentation: plasmoid.fullRepresentation - Layout.minimumWidth: units.gridUnit * 12 * (plasmoid.formFactor === PlasmaCore.Types.Horizontal ? sourcesModel.count : 1) - Layout.minimumHeight: units.gridUnit * 4 * (plasmoid.formFactor === PlasmaCore.Types.Vertical ? sourcesModel.count : 1) - - Layout.preferredHeight: Layout.minimumHeight - - function addSource(source1, friendlyName1, source2, friendlyName2) { - var found = false; - for (var i = 0; i < sourcesModel.count; ++i) { - var obj = sourcesModel.get(i); - if (obj.source1 === encodeURIComponent(source1) && - obj.source2 === encodeURIComponent(source2)) { - found = true; - break; - } - } - if (found) { - return; - } - - smSource.connectSource(source1); - if (source2) { - smSource.connectSource(source2); - } - - sourcesModel.append( - {"source1": encodeURIComponent(source1), - "friendlyName1": friendlyName1, - "source2": encodeURIComponent(source2), - "friendlyName2": friendlyName2, - "dataSource": smSource}); - } - - function showSource(source) { - if (plasmoid.configuration.sources && plasmoid.configuration.sources.length > 0) { - return plasmoid.configuration.sources.indexOf(encodeURIComponent(source)) !== -1; - } else { - return sourceDefaultEnable(source); - } - } - - function sourceDefaultEnable(source) { - return true; - } - - ListModel { - id: sourcesModel - } - - Component.onCompleted: { - for (var i in smSource.sources) { - smSource.sourceAdded(smSource.sources[i]); - } - } - - PlasmaCore.DataSource { - id: smSource - - engine: "systemmonitor" - interval: plasmoid.configuration.updateInterval - onSourceAdded: { - if (showSource(source)) { - rootItem.sourceAdded(source); - } - } - onSourceRemoved: { - for (var i = sourcesModel.count - 1; i >= 0; --i) { - var obj = sourcesModel.get(i); - if (obj.source1 === source || obj.source2 === source) { - sourcesModel.remove(i); - } - } - smSource.disconnectSource(source); - } - } - Connections { - target: plasmoid.configuration - onSourcesChanged: { - if (plasmoid.configuration.sources.length === 0) { - for (var i in smSource.sources) { - var source = smSource.sources[i]; - smSource.sourceAdded(source); - } - - } else { - var sourcesToRemove = []; - - for (var i = sourcesModel.count - 1; i >= 0; --i) { - var obj = sourcesModel.get(i); - - if (plasmoid.configuration.sources.indexOf(encodeURIComponent(obj.source1)) === -1) { - sourcesToRemove.push(obj.source1); - } - } - - for (i = 0; i < sourcesToRemove.length; ++i) { - smSource.sourceRemoved(sourcesToRemove[i]); - } - - - for (var i in plasmoid.configuration.sources) { - var source = decodeURIComponent(plasmoid.configuration.sources[i]); - smSource.sourceAdded(source); - } - } - } - } - - PlasmaExtras.Heading { - id: heading - width: parent.width - level: 2 - text: plasmoid.title - visible: plasmoid.formFactor !== PlasmaCore.Types.Horizontal && plasmoid.formFactor !== PlasmaCore.Types.Vertical - } - - GridLayout { - rows: 1 - columns: 1 - flow: plasmoid.formFactor !== PlasmaCore.Types.Horizontal ? GridLayout.LeftToRight : GridLayout.TopToBottom - anchors { - top: heading.visible ? heading.bottom : parent.top - bottom: parent.bottom - } - width: parent.width - - Repeater { - model: sourcesModel - delegate: rootItem.delegate - } - } -} diff --git a/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml b/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml deleted file mode 100644 index ebeb9c6d4..000000000 --- a/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright 2013 Bhushan Shah - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. - */ - -import QtQuick 2.5 -import QtQuick.Controls 2.5 as QQC2 -import QtQuick.Layouts 1.3 - -import org.kde.kirigami 2.5 as Kirigami -import org.kde.plasma.core 2.0 as PlasmaCore - - -Item { - id: iconsPage - width: childrenRect.width - height: childrenRect.height - implicitWidth: formLayout.implicitWidth - implicitHeight: formLayout.implicitHeight - - property var cfg_sources: [] - - function sourcesChanged() { - if (! cfg_sources) { cfg_sources = [] } - if (cfg_sources.length == 0) { - for (var i in dataSourcesColumn.children) { - var child = dataSourcesColumn.children[i]; - if (child.checked !== undefined) { - child.checked = sourceDefaultEnable(child.source); - } - } - } else { - for (var i in dataSourcesColumn.children) { - var child = dataSourcesColumn.children[i]; - if (child.checked !== undefined) { - child.checked = cfg_sources.indexOf(child.source) !== -1; - } - } - } - } - - function sourceDefaultEnable(source) { - return true; - } - - onCfg_sourcesChanged: { - sourcesChanged(); - } - - property int cfg_updateInterval - - signal sourceAdded(string source) - - function addSource(source, friendlyName) { - var found = false; - for (var i = 0; i < sourcesModel.count; ++i) { - var obj = sourcesModel.get(i); - if (obj.source === source) { - found = true; - break; - } - } - if (found) { - return; - } - - sourcesModel.append( - {"source": encodeURIComponent(source), - "friendlyName": friendlyName}); - } - - PlasmaCore.DataSource { - id: smSource - - engine: "systemmonitor" - - onSourceAdded: { - iconsPage.sourceAdded(source); - } - onSourceRemoved: { - for (var i = sourcesModel.count - 1; i >= 0; --i) { - var obj = sourcesModel.get(i); - if (obj.source === source) { - sourcesModel.remove(i); - } - } - } - } - - Component.onCompleted: { - for (var i in smSource.sources) { - var source = smSource.sources[i]; - iconsPage.sourceAdded(source); - } - sourcesChanged(); - } - - ListModel { - id: sourcesModel - } - - Kirigami.FormLayout { - id: formLayout - - anchors.left: parent.left - anchors.right: parent.right - - QQC2.SpinBox { - id: updateIntervalSpinBox - Kirigami.FormData.label: i18n("Update interval:") - from: 100 - stepSize: 100 - to: 1000000 - editable: true - validator: DoubleValidator { - bottom: spinbox.from - top: spinbox.to - } - textFromValue: function(value) { - var seconds = value / 1000 - return i18ncp("SpinBox text", "%1 second", "%1 seconds", seconds.toFixed(1)) - } - valueFromText: function(text) { - return parseFloat(text) * 1000 - } - value: cfg_updateInterval - onValueModified: cfg_updateInterval = value - } - - Item { - Kirigami.FormData.isSection: true - } - - - ColumnLayout { - id: dataSourcesColumn - Kirigami.FormData.label: i18n("Show:") - Kirigami.FormData.buddyFor: children[1] // 0 is the Repeater - - Repeater { - id: repeater - model: sourcesModel - QQC2.CheckBox { - id: checkBox - text: model.friendlyName - property string source: model.source - onCheckedChanged: { - if (checked) { - if (cfg_sources.indexOf(model.source) == -1) { - cfg_sources.push(model.source); - } - } else { - var idx = cfg_sources.indexOf(model.source); - if (cfg_sources.length !== 1) { // This condition prohibits turning off the last item from the list. - if (idx !== -1) { - cfg_sources.splice(idx, 1); - } - } - } - cfg_sourcesChanged(); - } - } - } - } - } -} diff --git a/applets/systemmonitor/common/contents/ui/DoublePlotter.qml b/applets/systemmonitor/common/contents/ui/DoublePlotter.qml deleted file mode 100644 index 71016d82e..000000000 --- a/applets/systemmonitor/common/contents/ui/DoublePlotter.qml +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons - -KQuickAddons.Plotter { - id: plotter - property string sensorName: model.friendlyName1 - - Layout.fillWidth: true - Layout.fillHeight: true - horizontalGridLineCount: 0 - - function cycle(color, degrees) { - var min = Math.min(color.r, Math.min(color.g, color.b)); - var max = Math.max(color.r, Math.max(color.g, color.b)); - var c = max - min; - var h; - - if (c === 0) { - h = 0 - } else if (max === color.r) { - h = ((color.g - color.b) / c) % 6; - } else if (max === color.g) { - h = ((color.b - color.r) / c) + 2; - } else if (max === color.b) { - h = ((color.r - color.g) / c) + 4; - } - var hue = (1/6) * h + (degrees/360); - var saturation = c / (1 - Math.abs(2 * ((max+min)/2) - 1)); - var lightness = (max + min)/2; - - return Qt.hsla(hue, saturation, lightness, 1.0); - } - - property string downloadColor: theme.highlightColor - property string uploadColor: cycle(theme.highlightColor, -90) - - dataSets: [ - KQuickAddons.PlotData { - color: downloadColor - }, - KQuickAddons.PlotData { - color: uploadColor - } - ] - - PlasmaComponents.Label { - id: nameLabel - anchors { - left: parent.left - top: parent.top - } - } - - PlasmaComponents.Label { - id: speedLabel - wrapMode: Text.WordWrap - visible: plasmoid.formFactor !== PlasmaCore.Types.Vertical - anchors { - right: parent.right - } - } - - Connections { - target: model.dataSource - onNewData: { - if (sourceName.indexOf(decodeURIComponent(model.source1)) !== 0 && sourceName.indexOf(decodeURIComponent(model.source2)) !== 0) { - return; - } - - var data1 = model.dataSource.data[decodeURIComponent(model.source2)]; - var data2 = model.dataSource.data[decodeURIComponent(model.source1)]; - - if (data1 === undefined || data1.value === undefined || - data2 === undefined || data2.value === undefined) { - return; - } - - plotter.addSample([data1.value, data2.value]); - - if (plasmoid.formFactor !== PlasmaCore.Types.Vertical) { - nameLabel.text = plotter.sensorName - speedLabel.text = i18n(" %2 | %4", - downloadColor, - formatData(data1), - uploadColor, - formatData(data2)) - } else { - nameLabel.text = plotter.sensorName+ "\n" + formatData(data1) + "\n" + formatData(data2) - speedLabel.text = "" - } - } - } -} diff --git a/applets/systemmonitor/common/contents/ui/SinglePlotter.qml b/applets/systemmonitor/common/contents/ui/SinglePlotter.qml deleted file mode 100644 index c7f9a4d2a..000000000 --- a/applets/systemmonitor/common/contents/ui/SinglePlotter.qml +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons - - -KQuickAddons.Plotter { - id: plotter - property string sensorName: model.friendlyName1 - - Layout.fillWidth: true - Layout.fillHeight: true - //FIXME: doesn't seem to properly fill otherwise - Layout.preferredHeight: parent.height - horizontalGridLineCount: 0 - - dataSets: [ - KQuickAddons.PlotData { - color: theme.highlightColor - } - ] - - PlasmaComponents.Label { - id: nameLabel - anchors { - left: parent.left - top: parent.top - } - } - - PlasmaComponents.Label { - id: speedLabel - wrapMode: Text.WordWrap - visible: plasmoid.formFactor !== PlasmaCore.Types.Vertical - anchors { - right: parent.right - } - } - - Connections { - target: model.dataSource - onNewData: { - if (sourceName.indexOf(decodeURIComponent(model.source1)) !== 0) { - return; - } - - var data1 = model.dataSource.data[decodeURIComponent(model.source1)]; - - if (data1 === undefined || data1.value === undefined) { - return; - } - - plotter.addSample([data1.value]); - - if (plasmoid.formFactor !== PlasmaCore.Types.Vertical) { - nameLabel.text = plotter.sensorName - speedLabel.text = formatData(data1) - } else { - nameLabel.text = plotter.sensorName+ "\n" + formatData(data1) - speedLabel.text = "" - } - } - } -} - diff --git a/applets/sysguard/coreusage/metadata.desktop b/applets/systemmonitor/coreusage/metadata.desktop similarity index 88% rename from applets/sysguard/coreusage/metadata.desktop rename to applets/systemmonitor/coreusage/metadata.desktop index 33c29cb9f..c1e993db9 100644 --- a/applets/sysguard/coreusage/metadata.desktop +++ b/applets/systemmonitor/coreusage/metadata.desktop @@ -1,34 +1,34 @@ [Desktop Entry] Name=Individual Core Usage Name[de]=Einzelne Prozessorkernbelastung Comment=System monitor Widget that shows usage of individual CPU cores Type=Service Icon=ksysguardd X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml X-Plasma-Provides=org.kde.plasma.systemmonitor -X-Plasma-RootPath=org.kde.ksysguard.sensorchart +X-Plasma-RootPath=org.kde.plasma.systemmonitor X-KDE-PluginInfo-Author=Kai Uwe Broulik X-KDE-PluginInfo-Email=kde@privat.broulik.de -X-KDE-PluginInfo-Name=org.kde.ksysguard.sensorchart.cpucore +X-KDE-PluginInfo-Name=org.kde.plasma.systemmonitor.cpucore X-KDE-PluginInfo-Version=1.0 X-KDE-PluginInfo-Website=kde.org X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL-2.0+ X-KDE-PluginInfo-EnabledByDefault=true X-KDE-PluginInfo-Category=System Information [Config] chartFace=org.kde.ksysguard.barchart sensorIds=cpu/cpu*/TotalLoad totalSensor=cpu/system/TotalLoad textOnlySensorIds=cpu/system/loadavg1,cpu/system/loadavg5 [FaceConfig] rangeAuto=false rangeFrom=0 rangeTo=100 diff --git a/applets/systemmonitor/cpu/Messages.sh b/applets/systemmonitor/cpu/Messages.sh deleted file mode 100644 index 45b82b4cf..000000000 --- a/applets/systemmonitor/cpu/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.cpu.pot diff --git a/applets/systemmonitor/cpu/contents/config/config.qml b/applets/systemmonitor/cpu/contents/config/config.qml deleted file mode 100644 index 0d56fb56b..000000000 --- a/applets/systemmonitor/cpu/contents/config/config.qml +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2013 Bhushan Shah - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. - */ - -import QtQuick 2.0 - -import org.kde.plasma.configuration 2.0 - -ConfigModel { - ConfigCategory { - name: i18n("CPUs") - icon: "cpu" - source: "cpuConfig.qml" - } -} diff --git a/applets/systemmonitor/cpu/contents/ui/cpu.qml b/applets/systemmonitor/cpu/contents/ui/cpu.qml deleted file mode 100644 index 28bbda1ab..000000000 --- a/applets/systemmonitor/cpu/contents/ui/cpu.qml +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons - -Applet { - id: root - - onSourceAdded: { - var match = source.match(/^cpu\/(\w+)\/TotalLoad/); - if (match) { - root.addSource(source, match[1]); - } - } - - function sourceDefaultEnable(source) { - return source.match(/^cpu(\/|%2F)system(\/|%2F)TotalLoad/); - } - - delegate: SinglePlotter { - autoRange: false - rangeMin: 0 - rangeMax: 100 - function formatData(data) { - //i18nc("CPU usage: %1 is the value, %2 the unit datatype", "%1 %2") - //return i18n("%1 %2", Math.round(data.value), data.units); - return i18nc("CPU usage: %1 is the value, %2 the unit datatype", "%1 %2", Math.round(data.value), data.units); - } - } -} diff --git a/applets/systemmonitor/cpu/contents/ui/cpuConfig.qml b/applets/systemmonitor/cpu/contents/ui/cpuConfig.qml deleted file mode 100644 index bc147f43c..000000000 --- a/applets/systemmonitor/cpu/contents/ui/cpuConfig.qml +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons - -ConfigGeneral { - id: root - - onSourceAdded: { - var match = source.match(/^cpu\/(\w+)\/TotalLoad/); - if (match) { - root.addSource(source, match[1]); - } - } - - function sourceDefaultEnable(source) { - return source.match(/^cpu(\/|%2F)system(\/|%2F)TotalLoad/); - } -} diff --git a/applets/systemmonitor/cpu/metadata.desktop b/applets/systemmonitor/cpu/metadata.desktop index b0ca19ad2..066841a1b 100644 --- a/applets/systemmonitor/cpu/metadata.desktop +++ b/applets/systemmonitor/cpu/metadata.desktop @@ -1,110 +1,33 @@ [Desktop Entry] -Name=CPU Load Monitor -Name[ar]=مرقاب حِمل المعالج -Name[ca]=Monitor de càrrega de la CPU -Name[ca@valencia]=Monitor de càrrega de la CPU -Name[cs]=Monitor zatížení CPU -Name[da]=Overvågning af CPU-belastning -Name[de]=Monitor für Prozessor-Last -Name[el]=Επόπτης φόρτου ΚΜΕ -Name[en_GB]=CPU Load Monitor -Name[es]=Monitor de carga de la CPU -Name[et]=Protsessori koormuse jälgija -Name[eu]=PUZ zamaren begiralea -Name[fi]=Suoritinkäyttö -Name[fr]=Surveillance du processeur -Name[gl]=Vixilante da carga da CPU -Name[he]=מנטר מעבד -Name[hu]=Processzorfigyelő -Name[ia]=Monitor de carga de CPU -Name[id]=Pemantau Muatan CPU -Name[is]=Eftirlit með notkun örgjörva -Name[it]=Monitor del carico del processore -Name[ja]=CPU 負荷モニタ -Name[ko]=CPU 사용량 모니터 -Name[lt]=Procesoriaus apkrovos prižiūryklė -Name[lv]=CPU slodzes monitors -Name[ml]=സിപിയു നിരീക്ഷണോപാധി -Name[nl]=Monitor voor CPU-gebruik -Name[nn]=Prosessorlast-overvaking -Name[pa]=CPU ਲੋਡ ਲਈ ਨਿਗਰਾਨ -Name[pl]=Monitor obciążenia procesora -Name[pt]=Monitor de Carga do CPU -Name[pt_BR]=Monitor de carga da CPU -Name[ru]=Монитор нагрузки процессора -Name[sk]=Monitor zaťaženia CPU -Name[sl]=Nadzornik obremenitve procesorja -Name[sr]=надзор оптерећења процесора -Name[sr@ijekavian]=надзор оптерећења процесора -Name[sr@ijekavianlatin]=nadzor opterećenja procesora -Name[sr@latin]=nadzor opterećenja procesora -Name[sv]=Övervakning av processorlast -Name[tg]=Назорати боршавии CPU -Name[tr]=İşlemci Yükü İzleyici -Name[uk]=Використання процесорів -Name[x-test]=xxCPU Load Monitorxx -Name[zh_CN]=CPU 负载监视器 -Name[zh_TW]=CPU 負載監視器 -Comment=Monitor the load of the CPUs -Comment[ar]=راقِب حِمل المعالجات لديك -Comment[ast]=Supervisa la carga de les CPUs -Comment[ca]=Controla la càrrega de les CPU -Comment[ca@valencia]=Controla la càrrega de les CPU -Comment[cs]=Monitorovat zatížení procesor(ů) -Comment[da]=Overvåg belastningen af CPU'erne -Comment[de]=Überwacht die Auslastung der Prozessoren -Comment[el]=Παρακολούθηση του φόρτου των ΚΜΕ -Comment[en_GB]=Monitor the load of the CPUs -Comment[es]=Monitoriza la carga de las CPU -Comment[et]=Protsessorite koormuse jälgimine -Comment[eu]=Gainbegiratu PUZen zama -Comment[fi]=Seuraa suoritinten kuormaa -Comment[fr]=Surveille la charge des processeurs -Comment[gl]=Vixiar a carga das CPU. -Comment[he]=צג שימוש במעבד -Comment[hu]=A processzorterhelés monitorozása -Comment[id]=Pemantau muatan CPU -Comment[is]=Fylgjast með álagi á örgjörva -Comment[it]=Indica il carico dei processori -Comment[ja]=CPU の負荷を監視します -Comment[ko]=CPU 사용량 모니터 -Comment[lt]=Stebėti procesorių apkrovą -Comment[ml]=സിപിയുകളുടെ പ്രവര്‍ത്തനഭാരം നിരീക്ഷിക്കുക -Comment[nl]=Het gebruik van de CPU's monitoren -Comment[nn]=Overvaking av prosessorbruk -Comment[pa]=CPU ਦੇ ਲੋਡ ਦੀ ਨਿਗਰਾਨੀ -Comment[pl]=Monitoruje obciążenie procesora -Comment[pt]=Vigia a carga dos CPU's -Comment[pt_BR]=Monitora a carga das CPUs -Comment[ru]=Мониторинг степени загрузки процессоров -Comment[sk]=Kontrola zaťaženia CPU -Comment[sl]=Nadzor nad obremenitvijo procesorjev -Comment[sr]=Надгледајте оптерећење процесора -Comment[sr@ijekavian]=Надгледајте оптерећење процесора -Comment[sr@ijekavianlatin]=Nadgledajte opterećenje procesora -Comment[sr@latin]=Nadgledajte opterećenje procesora -Comment[sv]=Övervaka processorernas last -Comment[tr]=İşlemcilerin yüklerini izleyin -Comment[uk]=Монітор навантаження на процесори -Comment[x-test]=xxMonitor the load of the CPUsxx -Comment[zh_CN]=监视 CPU 负载 -Comment[zh_TW]=監視 CPU 的負載 - +Name=Total CPU Use +Name[de]=Gesamte Prozessorauslastung +Comment=System monitor Widget that shows the total CPU usage Type=Service Icon=cpu - X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/cpu.qml -X-Plasma-StandAloneApp=true +X-Plasma-MainScript=ui/main.qml +X-Plasma-Provides=org.kde.plasma.systemmonitor +X-Plasma-RootPath=org.kde.plasma.systemmonitor -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=mart@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.systemmonitor.cpu +X-KDE-PluginInfo-Author=Kai Uwe Broulik +X-KDE-PluginInfo-Email=kde@privat.broulik.de +X-KDE-PluginInfo-Name=org.kde.systemmonitor.cpu X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=https://kde.org/plasma-desktop -X-KDE-PluginInfo-Category=System Information +X-KDE-PluginInfo-Website=kde.org X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-FormFactors=tablet,mediacenter,desktop +X-KDE-PluginInfo-EnabledByDefault=true +X-KDE-PluginInfo-Category=System Information + +[Config] +chartFace=org.kde.ksysguard.piechart +sensorIds=cpu/system/TotalLoad +totalSensor=cpu/system/TotalLoad +textOnlySensorIds=cpu/system/processors,cpu/system/cores + +[FaceConfig] +rangeAuto=false +rangeFrom=0 +rangeTo=100 diff --git a/applets/systemmonitor/diskactivity/Messages.sh b/applets/systemmonitor/diskactivity/Messages.sh deleted file mode 100644 index 17260f35e..000000000 --- a/applets/systemmonitor/diskactivity/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.diskactivity.pot diff --git a/applets/systemmonitor/diskactivity/contents/config/config.qml b/applets/systemmonitor/diskactivity/contents/config/config.qml deleted file mode 100644 index d7c267b18..000000000 --- a/applets/systemmonitor/diskactivity/contents/config/config.qml +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2013 Bhushan Shah - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. - */ - -import QtQuick 2.0 - -import org.kde.plasma.configuration 2.0 - -ConfigModel { - ConfigCategory { - name: i18n("Disk activity") - icon: "drive-harddisk" - source: "diskactivityConfig.qml" - } -} diff --git a/applets/systemmonitor/diskactivity/contents/ui/diskactivity.qml b/applets/systemmonitor/diskactivity/contents/ui/diskactivity.qml deleted file mode 100644 index 47febfcbb..000000000 --- a/applets/systemmonitor/diskactivity/contents/ui/diskactivity.qml +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons -import org.kde.kcoreaddons 1.0 as KCoreAddons - -Applet { - id: root - - onSourceAdded: { - var match = source.match(/^disk\/([^\/]+)\/Rate\/wblk/); - if (match) { - var rSource = "disk/" + match[1] + "/Rate/rblk" - root.addSource(source, match[1], rSource, match[1]); - } - } - - delegate: DoublePlotter { - function formatData(data) { - return i18nc("%1 is value of data per seconds", "%1/s", KCoreAddons.Format.formatByteSize(data.value * 1024)) - } - } -} diff --git a/applets/systemmonitor/diskactivity/contents/ui/diskactivityConfig.qml b/applets/systemmonitor/diskactivity/contents/ui/diskactivityConfig.qml deleted file mode 100644 index 68c3dd80a..000000000 --- a/applets/systemmonitor/diskactivity/contents/ui/diskactivityConfig.qml +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons - -ConfigGeneral { - id: root - - onSourceAdded: { - var match = source.match(/^disk\/([^\/]+)\/Rate\/wblk/); - if (match) { - root.addSource(source, match[1]); - } - } -} diff --git a/applets/systemmonitor/diskactivity/metadata.desktop b/applets/systemmonitor/diskactivity/metadata.desktop index acb621b83..d6c0c4248 100644 --- a/applets/systemmonitor/diskactivity/metadata.desktop +++ b/applets/systemmonitor/diskactivity/metadata.desktop @@ -1,127 +1,31 @@ [Desktop Entry] -Name=Hard Disk I/O Monitor -Name[ar]=مراقب د/خ القرص الصلب -Name[bs]=Hard Disk I/O Monitor -Name[ca]=Monitor d'E/S de disc dur -Name[ca@valencia]=Monitor d'E/E de disc dur -Name[cs]=Monitor I/O pevného disku -Name[da]=Overvågning af harddisk-I/O -Name[de]=Überwachungsmonitor für Festplattenein- und ausgabe -Name[el]=Επόπτης χρήσης του σκληρού δίσκου -Name[en_GB]=Hard Disk I/O Monitor -Name[es]=Monitor de E/S del disco duro -Name[et]=Kõvaketta sisendi/väljundi jälgija -Name[eu]=Disko zurrun S/I begiralea -Name[fi]=Kiintolevyjen käyttöilmaisin -Name[fr]=Surveillance des disques durs (E/S) -Name[ga]=Monatóir I/A Diosca Crua -Name[gl]=Vixilante da E/S do disco duro -Name[he]=מנטר שימוש בכונן הקשיח -Name[hu]=Merevlemez I/O monitor -Name[ia]=Monitor de I/E del disco dur -Name[id]=Pemantau I/O Hard Disk -Name[is]=Eftirlit með I/O notkun harðdiska -Name[it]=Uso del disco fisso -Name[ja]=ハードディスク I/O モニタ -Name[kk]=Қатқыл дискінің Е/Ш бақылауы -Name[km]=ត្រួតពិនិត្យ I/O ថាសរឹង -Name[ko]=하드디스크 I/O 모니터 -Name[lt]=Standžiojo disko I/O prižiūryklė -Name[lv]=Cietā diska noslogojuma novērotājs -Name[ml]=ഹാര്‍ഡ് ഡിസ്ക് ഐ/ഒ നിരീക്ഷണോപാധി -Name[mr]=हार्ड डिस्क I/O नियंत्रक -Name[nb]=En overvåker for disk-I/U -Name[nds]=Fastplaat-I/O-Beluern -Name[nl]=Volgt de activiteit van de harde schijf -Name[nn]=Overvaking av diskaktivitet -Name[pa]=ਹਾਰਡ ਡਿਸਕ I/O ਮਾਨੀਟਰ -Name[pl]=Monitor WE/WY dysku twardego -Name[pt]=Monitor de E/S do Disco -Name[pt_BR]=Monitor de E/S do disco rígido -Name[ro]=Monitor pentru utilizarea discului dur -Name[ru]=Монитор активности жёстких дисков -Name[sk]=Monitor I/O pevného disku -Name[sl]=Nadzornik V/I trdega diska -Name[sr]=Надгледање У/И‑ја хард‑диска -Name[sr@ijekavian]=Надгледање У/И‑ја хард‑диска -Name[sr@ijekavianlatin]=Nadgledanje U/I‑ja hard‑diska -Name[sr@latin]=Nadgledanje U/I‑ja hard‑diska -Name[sv]=Övervakning av in- och utmatning för hårddisk -Name[tg]=Назорати диски компютерӣ I/O -Name[tr]=Sabit Disk G/Ç İzleyici -Name[uk]=Монітор роботи жорсткого диска -Name[vi]=Trình quản lý I/O đĩa cứng -Name[x-test]=xxHard Disk I/O Monitorxx -Name[zh_CN]=硬盘 I/O 监视器 -Name[zh_TW]=硬碟使用量 I/O 監視器 +Name=Hard Disk Activity Comment=An applet that monitors hard disk throughput and input/output -Comment[ar]=بُريْمج يراقب استخدام إنتاجيّة القرص الصلب ودَخْله/خَرْجه -Comment[bs]=Aplet koji prati hard disk protok ulaz / izlaz -Comment[ca]=Una miniaplicació que controla la velocitat de transferència, així com l'entrada/sortida de les dades al disc dur -Comment[ca@valencia]=Una miniaplicació que controla la velocitat de transferència, així com l'entrada/eixida de les dades en el disc dur -Comment[cs]=Aplet, jenž monitoruje propustnost disku a vstup/výstup -Comment[da]=En applet som overvåger gennemgang og input/output for harddisken -Comment[de]=Ein Miniprogramm, das den Festplattendurchsatz und die Festplattenein- und -ausgabe überwacht -Comment[el]=Μικροεφαρμογή που εποπτεύει τη ρυθμοαπόδοση και την είσοδο/έξοδο του σκληρού δίσκου -Comment[en_GB]=An applet that monitors hard disk throughput and input/output -Comment[es]=Una miniaplicación que monitoriza el rendimiento y la entrada/salida del disco duro -Comment[et]=Kõvaketta läbilaset ja sisendit/väljundit jälgiv aplett -Comment[eu]=Disko zurrunaren transferentzia tasa eraginkorra («throughput») eta sarrera/irteera gainbegiratzen dituen aplikaziotxo bat -Comment[fi]=Tarkkailee levyjen suoritus­tehoa ja siirtomäärää -Comment[fr]=Une applet surveillant l'activité des disques durs et de leurs entrées / sorties -Comment[gl]=Un trebello que vixía o rendemento e a entrada e saída -Comment[he]=ישומון למעקב אחר מהירות הכתיבה והקריאה בכונן -Comment[hu]=Egy kisalkalmazás, amely figyeli a merevlemez átvitelét és a bemenetet/kimenetet -Comment[ia]=Un applet que que monitora le prestation (throughput) e ingresso/egresso de disco dur -Comment[id]=Sebuah applet yang memantau lalu-lalang dan input/output hard disk -Comment[is]=Smáforrit sem fylgist með afköstum harðra diska og ílagi/frálagi -Comment[it]=Un'applet che controlla le prestazioni e l'uso del disco fisso -Comment[ja]=ハードディスクのスループットと入力/出力を監視するアプレット -Comment[kk]=Дискінің белсендігі және енгізу/шығаруды бақылау апплеті -Comment[km]=អាប់ភ្លេត​ដែល​ត្រួតពិនិត្យ​ថាសរឹង​ និង​ឧបករណ៍​ចេញ/ចូល -Comment[ko]=하드디스크 대역폭 및 I/O 상태를 보여 주는 애플릿 -Comment[lt]=Programėlė, kuri stebi disko apkrovą ir įvedimą/išvedimą -Comment[ml]=ഹാര്‍ഡ് ഡിസ്ക് പ്രവര്‍ത്തനം നിരീക്ഷിക്കാനുള്ള അപ്‌ലെറ്റ് -Comment[mr]=हार्ड डिस्क इनपुट व आउटपुट दर्शविणारे एप्लेट -Comment[nb]=Et miniprogram som overvåker dataflyt til og fra harddisk -Comment[nds]=En Lüttprogramm, dat den Fastplaat-Dörsatz un de In- un Utgaven beluert -Comment[nl]=Een applet die de activiteit van de harde schijf volgt -Comment[nn]=Skjermelement som overvaker dataflyt til og frå harddisk -Comment[pa]=ਹਾਰਡ ਡਿਸਕ ਥਰੂਪੁੱਟ ਅਤੇ ਇੰਪੁੱਟ/ਆਉਟਪੁੱਟ ਦੀ ਨਿਗਰਾਨੀ ਲਈ ਐਪਲਿਟ -Comment[pl]=Monitoruje przepustowość WE/WY dysku twardego -Comment[pt]=Uma 'applet' que vigia o rendimento e o fluxo de entrada-saída do disco -Comment[pt_BR]=Monitora a taxa de transferência e entrada/saída do disco rígido -Comment[ro]=Miniaplicație ce monitorizează traficul de intrare și cel de ieșire pentru discul dur -Comment[ru]=Мониторинг пропускной способности и процессов ввода/вывода жестких дисков -Comment[sk]=Applet, ktorý monitoruje priepustnosť pevného disku a vstup/výstup -Comment[sl]=Programček, ki nadzoruje prepustnost in vhod/izhod trdega diska -Comment[sr]=Аплет за надгледање пропусности и улаза/излаза хард‑диска -Comment[sr@ijekavian]=Аплет за надгледање пропусности и улаза/излаза хард‑диска -Comment[sr@ijekavianlatin]=Aplet za nadgledanje propusnosti i ulaza/izlaza hard‑diska -Comment[sr@latin]=Aplet za nadgledanje propusnosti i ulaza/izlaza hard‑diska -Comment[sv]=Ett miniprogram som övervakar hårddiskprestanda samt in- och utmatning -Comment[tr]=Sabit diski girdi/çıktı olarak izleyen bir programcık -Comment[uk]=Аплет, який стежить за даними, які записуються на жорсткий диск та читаються з жорсткого диска -Comment[vi]=Một ứng dụng nhỏ quản lý dữ liệu vào/ra trên đĩa cứng -Comment[x-test]=xxAn applet that monitors hard disk throughput and input/outputxx -Comment[zh_CN]=监视硬盘吞吐量和输入输出的小程序 -Comment[zh_TW]=監視硬碟效能與 I/O 的小程式 - Type=Service Icon=drive-harddisk - X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/diskactivity.qml +X-Plasma-MainScript=ui/main.qml +X-Plasma-Provides=org.kde.plasma.systemmonitor +X-Plasma-RootPath=org.kde.plasma.systemmonitor X-Plasma-StandAloneApp=true X-KDE-PluginInfo-Author=Marco Martin X-KDE-PluginInfo-Email=mart@kde.org X-KDE-PluginInfo-Name=org.kde.plasma.systemmonitor.diskactivity X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=https://kde.org/plasma-desktop -X-KDE-PluginInfo-Category=System Information +X-KDE-PluginInfo-Website=kde.org X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL-2.0+ +X-KDE-PluginInfo-EnabledByDefault=true +X-KDE-PluginInfo-Category=System Information X-KDE-FormFactors=tablet,mediacenter,desktop + +[Config] +chartFace=org.kde.ksysguard.linechart +sensorIds=disk/all/write,disk/all/read + +[FaceConfig] +rangeAuto=true +lineChartStacked=true diff --git a/applets/systemmonitor/diskusage/Messages.sh b/applets/systemmonitor/diskusage/Messages.sh deleted file mode 100644 index 26ffe5ac4..000000000 --- a/applets/systemmonitor/diskusage/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.diskusage.pot diff --git a/applets/systemmonitor/diskusage/contents/config/config.qml b/applets/systemmonitor/diskusage/contents/config/config.qml deleted file mode 100644 index 36bd844f4..000000000 --- a/applets/systemmonitor/diskusage/contents/config/config.qml +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2013 Bhushan Shah - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. - */ - -import QtQuick 2.0 - -import org.kde.plasma.configuration 2.0 - -ConfigModel { - ConfigCategory { - name: i18n("Disk usage") - icon: "drive-harddisk" - source: "diskusageConfig.qml" - } -} diff --git a/applets/systemmonitor/diskusage/contents/ui/diskusage.qml b/applets/systemmonitor/diskusage/contents/ui/diskusage.qml deleted file mode 100644 index 260f53eea..000000000 --- a/applets/systemmonitor/diskusage/contents/ui/diskusage.qml +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons -import org.kde.kcoreaddons 1.0 as KCoreAddons - -Applet { - id: root - - onSourceAdded: { - var match = source.match(/^partitions(.+)\/filllevel/); - if (match) { - var freeSource = "partitions" + match[1] + "/freespace"; - root.addSource(source, match[1], freeSource, match[1]); - } - } - - delegate: Item { - Layout.fillWidth: true - Layout.fillHeight: true - PlasmaComponents.Label { - id: label - text: model.friendlyName1 - anchors { - left: parent.left - bottom: progressBar.top - } - } - PlasmaComponents.Label { - id: freeSpace - anchors { - right: parent.right - bottom: progressBar.top - } - } - PlasmaComponents.ProgressBar { - id: progressBar - minimumValue: 0 - maximumValue: 100 - anchors { - left: parent.left - right: parent.right - bottom: parent.bottom - } - } - Connections { - target: model.dataSource - onNewData: { - if (sourceName.indexOf(decodeURIComponent(model.source1)) !== 0) { - return; - } - - var data1 = model.dataSource.data[decodeURIComponent(model.source1)]; - var data2 = model.dataSource.data[decodeURIComponent(model.source2)]; - - if (data1 !== undefined && data1.value !== undefined) { - progressBar.value = data1.value; - } - - if (data2 !== undefined && data2.value !== undefined) { - freeSpace.text = KCoreAddons.Format.formatByteSize(data2.value * 1024); - } - } - } - } -} diff --git a/applets/systemmonitor/diskusage/contents/ui/diskusageConfig.qml b/applets/systemmonitor/diskusage/contents/ui/diskusageConfig.qml deleted file mode 100644 index f3c5d6dbf..000000000 --- a/applets/systemmonitor/diskusage/contents/ui/diskusageConfig.qml +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons - -ConfigGeneral { - id: root - - onSourceAdded: { - var match = source.match(/^partitions(.+)\/filllevel/); - if (match) { - root.addSource(source, match[1]); - } - } -} diff --git a/applets/systemmonitor/diskusage/metadata.desktop b/applets/systemmonitor/diskusage/metadata.desktop index 0832cefb3..9e7e8fe08 100644 --- a/applets/systemmonitor/diskusage/metadata.desktop +++ b/applets/systemmonitor/diskusage/metadata.desktop @@ -1,125 +1,32 @@ [Desktop Entry] -Name=Hard Disk Space Usage -Name[ar]=استخدام مساحة القرص الصلب -Name[bs]=Iskorisenost Hard diska -Name[ca]=Ús d'espai de disc dur -Name[ca@valencia]=Ús d'espai de disc dur -Name[cs]=Využití místa na pevném disku -Name[da]=Brug af harddiskplads -Name[de]=Festplattenbelegung -Name[el]=Χρήση χώρου σκληρού δίσκου -Name[en_GB]=Hard Disk Space Usage -Name[es]=Espacio usado en el disco duro -Name[et]=Kõvaketta ruumikasutus -Name[eu]=Disko zurruneko espazioaren erabilera -Name[fi]=Kiintolevyjen tilankäyttö -Name[fr]=Utilisation de l'espace des disques dur -Name[gl]=Uso do espazo do disco duro -Name[he]=שימוש בדיסק -Name[hu]=Lemezterület használat -Name[ia]=Usage de spatio del disco dur -Name[id]=Penggunaan Ruang Hard Disk -Name[is]=Staða harðra diska -Name[it]=Spazio del disco fisso -Name[ja]=ハードディスク使用量 -Name[kk]=Қатқыл дискідегі пайдаланған орын -Name[km]=ការ​ប្រើ​ប្រាស់​ទំហំ​ថាសរឹង -Name[ko]=하드디스크 공간 사용량 -Name[lt]=Standžiojo disko vietos panaudojimas -Name[lv]=Cietā diska telpas lietojums -Name[ml]=ഹാര്‍ഡ് ഡിസ്ക് ഉപയോഗം -Name[mr]=हार्ड डिस्क वापर -Name[nb]=Plassbruk for harddisk -Name[nds]=Fastplaat-Bruuk -Name[nl]=Ruimtegebruik van de harde schijf -Name[nn]=Plassbruk for harddisk -Name[pa]=ਹਾਰਡ ਡਿਸਕ ਥਾਂ ਵਰਤੋਂ -Name[pl]=Wykorzystanie dysku twardego -Name[pt]=Utilização do Disco Rígido -Name[pt_BR]=Uso do espaço do disco rígido -Name[ro]=Utilizarea spațiului pe discul dur -Name[ru]=Использование места на диске -Name[sk]=Využitie miesta na pevnom disku -Name[sl]=Uporaba prostora na trdem disku -Name[sr]=заузеће хард диска -Name[sr@ijekavian]=заузеће хард диска -Name[sr@ijekavianlatin]=zauzeće hard diska -Name[sr@latin]=zauzeće hard diska -Name[sv]=Utrymmesanvändning för hårddisk -Name[tr]=Sabit Disk Alanı Kullanımı -Name[uk]=Використання місця на диску -Name[vi]=Sử dụng không gian đĩa -Name[x-test]=xxHard Disk Space Usagexx -Name[zh_CN]=硬盘空间使用情况 -Name[zh_TW]=硬碟空間使用量 -Comment=An applet that monitors hard disk space usage and percentage -Comment[ar]=بُريْمج يراقب استخدام مساحة القرص الصلب ونسبته المئوية -Comment[bs]=Aplet koji prati korištenje prostora na hard disku i postotak -Comment[ca]=Una miniaplicació que controla l'ús d'espai i el tant per cent al disc dur -Comment[ca@valencia]=Una miniaplicació que controla l'ús d'espai i el tant per cent en el disc dur -Comment[cs]=Aplet, jenž monitoruje zaplnění místa na disku -Comment[da]=En applet som overvåger brug af harddiskplads og procent ledig plads -Comment[de]=Ein Miniprogramm, das die Festplattenbelegung absolut und in Prozent überwacht -Comment[el]=Μικροεφαρμογή που εποπτεύει την ποσοτική και ποσοστιαία χρήση χώρου του σκληρού δίσκου -Comment[en_GB]=An applet that monitors hard disk space usage and percentage -Comment[es]=Una miniaplicación que monitoriza el uso y porcentaje del espacio en disco duro -Comment[et]=Kõvaketta ruumikasutust ja protsenti jälgiv aplett -Comment[eu]=Disko zurruneko espazioaren erabilera eta ehunekoa gainbegiratzen dituen aplikaziotxo bat -Comment[fi]=Näyttää levyjen tilan­käytön ja sen prosenttiosuuden -Comment[fr]=Une applet surveillant l'utilisation de l'espace des disques durs et donnant des pourcentages -Comment[gl]=Un trebello que vixía o espazo usado do disco duro e a porcentaxe -Comment[he]=ישומון להצגת סך השימוש בכוננים השונים -Comment[hu]=Egy kisalkalmazás, amely figyeli a merevlemez használatot és százalékot -Comment[ia]=Un applet que monitora usage e percentage de spatio de disco dur -Comment[id]=Sebuah applet yang memantau persentase dan penggunaan ruang hard disk -Comment[is]=Smáforrit sem fylgist með notkun harðra diska og prósentuhlutfalli á lausu plássi -Comment[it]=Un'applet che controlla l'uso dello spazio su disco fisso -Comment[ja]=ハードディスクの使用量とパーセンテージを監視するアプレット -Comment[kk]=Қатқыл дискідегі пайдаланған орын және пайызын бақылау аплеті -Comment[km]=អាប់ភ្លេត​ដែល​ត្រួតពិនិត្យ​​ការ​ប្រើប្រាស់​ និង​ភាគរយ​ទំហំ​ថាសរឹង -Comment[ko]=하드디스크 공간 사용량 및 비율을 보여 주는 애플릿 -Comment[lt]=Programėlė, kuri stebi disko vietos panaudojimą ir procentinę dalį -Comment[ml]=ഹാര്‍ഡ് ഡിസ്ക് സ്ഥലോപയോഗം നിരീക്ഷിക്കാനുള്ള അപ്‌ലെറ്റ് -Comment[mr]=हार्ड डिस्क वापर व टक्केवारी दर्शविणारे एप्लेट -Comment[nb]=Et miniprogram som overvåker bruk av plass på harddisk, og prosentvis -Comment[nds]=En Lüttprogramm, dat den Fastplaat-Bruuk afsluuts un in Perzent beluert -Comment[nl]=Een applet die het ruimtegebruik van de harde schijf volgt -Comment[nn]=Skjemelement som overvaker bruk av diskplass på harddisk, og viser som prosent -Comment[pa]=ਐਪਲਿਟ, ਜੋ ਕਿ ਹਾਰਡ ਡਿਸਕ ਵਲੋਂ ਵਰਤੀ ਥਾਂ ਅਤੇ ਫੀਸਦੀ ਦੀ ਨਿਗਰਾਨੀ ਕਰਦਾ ਹੈ -Comment[pl]=Monitoruje wykorzystaną przestrzeń i procent wykorzystania dysku twardego -Comment[pt]=Uma 'applet' que vigia a utilização e percentagem do disco -Comment[pt_BR]=Monitora o uso do espaço do disco rígido e a porcentagem -Comment[ro]=Miniaplicație ce monitorizează gradul de utilizare a discului dur -Comment[ru]=Мониторинг используемого дискового пространства -Comment[sk]=Applet, ktorý monitoruje použitie miesta na pevnom disku a percentá -Comment[sl]=Programček, ki nadzoruje uporabo prostora na trdem disku -Comment[sr]=Аплет за надгледање заузећа хард диска -Comment[sr@ijekavian]=Аплет за надгледање заузећа хард диска -Comment[sr@ijekavianlatin]=Aplet za nadgledanje zauzeća hard diska -Comment[sr@latin]=Aplet za nadgledanje zauzeća hard diska -Comment[sv]=Ett miniprogram som övervakar hårddiskutrymme och procent -Comment[tr]=Sabit disk kullanımını izleyen ve yüzde olarak gösteren bir programcık -Comment[uk]=Аплет, який стежить за використанням місця на диску -Comment[vi]=Một ứng dụng nhỏ quản lý phần trăm sử dụng không gian đĩa -Comment[x-test]=xxAn applet that monitors hard disk space usage and percentagexx -Comment[zh_CN]=监视硬盘空间使用率的小程序 -Comment[zh_TW]=監視硬碟空間使用量百分比的小程式 - +Name=Disk Usage +Comment=System monitor Widget that shows the usage of the root partition Type=Service -Icon=drive-harddisk - +Icon=cpu X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/diskusage.qml -X-Plasma-StandAloneApp=true +X-Plasma-MainScript=ui/main.qml +X-Plasma-Provides=org.kde.plasma.systemmonitor +X-Plasma-RootPath=org.kde.plasma.systemmonitor X-KDE-PluginInfo-Author=Marco Martin X-KDE-PluginInfo-Email=mart@kde.org X-KDE-PluginInfo-Name=org.kde.plasma.systemmonitor.diskusage X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=https://kde.org/plasma-desktop -X-KDE-PluginInfo-Category=System Information +X-KDE-PluginInfo-Website=kde.org X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-FormFactors=tablet,mediacenter,desktop +X-KDE-PluginInfo-EnabledByDefault=true +X-KDE-PluginInfo-Category=System Information + +[Config] +chartFace=org.kde.ksysguard.piechart +sensorIds=partitions/all/usedspace +totalSensor=partitions/all/filllevel +textOnlySensorIds=partitions/all/total + +[FaceConfig] +rangeAuto=true +rangeFrom=0 +rangeTo=100 diff --git a/applets/systemmonitor/memory/Messages.sh b/applets/systemmonitor/memory/Messages.sh deleted file mode 100644 index 0d542a921..000000000 --- a/applets/systemmonitor/memory/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.memory.pot diff --git a/applets/systemmonitor/memory/contents/config/config.qml b/applets/systemmonitor/memory/contents/config/config.qml deleted file mode 100644 index c311fe54b..000000000 --- a/applets/systemmonitor/memory/contents/config/config.qml +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2013 Bhushan Shah - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. - */ - -import QtQuick 2.0 - -import org.kde.plasma.configuration 2.0 - -ConfigModel { - ConfigCategory { - name: i18n("Memory") - icon: "media-flash" - source: "memoryConfig.qml" - } -} diff --git a/applets/systemmonitor/memory/contents/ui/memory.qml b/applets/systemmonitor/memory/contents/ui/memory.qml deleted file mode 100644 index 489bd84b1..000000000 --- a/applets/systemmonitor/memory/contents/ui/memory.qml +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons -import org.kde.kcoreaddons 1.0 as KCoreAddons - -Applet { - id: root - - onSourceAdded: { - if (source === "mem/physical/application") { - root.addSource(source, i18n("Physical memory")); - } else if (source === "mem/swap/used") { - root.addSource(source, i18n("Swap")); - } - } - - delegate: SinglePlotter { - autoRange: false - rangeMin: 0 - rangeMax: 0 - function formatData(data) { - rangeMax = data.max; - return KCoreAddons.Format.formatByteSize(data.value * 1024) - } - } -} diff --git a/applets/systemmonitor/memory/contents/ui/memoryConfig.qml b/applets/systemmonitor/memory/contents/ui/memoryConfig.qml deleted file mode 100644 index 9c635655f..000000000 --- a/applets/systemmonitor/memory/contents/ui/memoryConfig.qml +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons - -ConfigGeneral { - id: root - - onSourceAdded: { - if (source === "mem/physical/application") { - root.addSource(source, i18n("Physical memory")); - } else if (source === "mem/swap/used") { - root.addSource(source, i18n("Swap")); - } - } -} diff --git a/applets/systemmonitor/memory/metadata.desktop b/applets/systemmonitor/memory/metadata.desktop index 23f1ecd05..0b2d801b2 100644 --- a/applets/systemmonitor/memory/metadata.desktop +++ b/applets/systemmonitor/memory/metadata.desktop @@ -1,151 +1,33 @@ [Desktop Entry] -Name=Memory Status -Name[ar]=حالة الذاكرة -Name[ast]=Estáu de la memoria -Name[bg]=Състояние на паметта -Name[bs]=Stanje memorije -Name[ca]=Estat de la memòria -Name[ca@valencia]=Estat de la memòria -Name[cs]=Stav paměti -Name[da]=Hukommelsesstatus -Name[de]=Speicherstatus -Name[el]=Κατάσταση μνήμης -Name[en_GB]=Memory Status -Name[eo]=Memora stato -Name[es]=Estado de la memoria -Name[et]=Mälu olek -Name[eu]=Memoria egoera -Name[fi]=Muistin käyttö -Name[fr]=État de la mémoire -Name[ga]=Stádas Cuimhne -Name[gl]=Estado da memoria -Name[gu]=મેમરી પરિસ્થિતિ -Name[he]=מצב הזיכרון -Name[hi]=मेमोरी स्थिति -Name[hr]=Stanje memorije -Name[hu]=Memóriaállapot -Name[ia]=Stato de memoria -Name[id]=Status Memori -Name[is]=Staða minnis -Name[it]=Stato della memoria -Name[ja]=メモリの状態 -Name[kk]=Жад күй-жайы -Name[km]=ស្ថានភាព​សតិ -Name[kn]=ಸ್ಮೃತಿ (ಮೆಮೊರಿ) ಸ್ಥಿತಿ -Name[ko]=메모리 상태 -Name[lt]=Atminties būsena -Name[lv]=Atmiņas statuss -Name[mr]=स्मृति स्थिति -Name[nb]=Minnestatus -Name[nds]=Spieker-Status -Name[nl]=Geheugen-status -Name[nn]=Minnestatus -Name[pa]=ਮੈਮੋਰੀ ਹਾਲਤ -Name[pl]=Wykorzystanie pamięci -Name[pt]=Estado da Memória -Name[pt_BR]=Status da memória -Name[ro]=Stare memorie -Name[ru]=Использование памяти -Name[si]=මතක තත්ත්වය -Name[sk]=Stav pamäte -Name[sl]=Stanje pomnilnika -Name[sr]=стање меморије -Name[sr@ijekavian]=стање меморије -Name[sr@ijekavianlatin]=stanje memorije -Name[sr@latin]=stanje memorije -Name[sv]=Minnesstatus -Name[th]=สถานะหน่วยความจำ -Name[tr]=Bellek Durumu -Name[ug]=ئەسلەك ھالىتى -Name[uk]=Стан пам’яті -Name[wa]=Estat del memwere -Name[x-test]=xxMemory Statusxx -Name[zh_CN]=内存状态 -Name[zh_TW]=記憶體狀態 -Comment=A RAM usage monitor -Comment[ar]=مرقاب لاستخدام الذاكرة العشوائية -Comment[bg]=Изпозлване на оперативната памет (RAM) -Comment[bs]=Nadgledanje upotrebe RAM‑a -Comment[ca]=Un controlador d'ús de la RAM -Comment[ca@valencia]=Un controlador d'ús de la RAM -Comment[cs]=Monitor využití RAM -Comment[csb]=Mònitór brëkòwaniô pamiãcë RAM -Comment[da]=Overvågning af ram-forbrug -Comment[de]=Ein Überwachungsmonitor für den Arbeitsspeicher -Comment[el]=Ένας επόπτης χρήσης μνήμης RAM -Comment[en_GB]=A RAM usage monitor -Comment[eo]=RAM uzada rigardilo -Comment[es]=Monitor de uso de la RAM -Comment[et]=RAM-i kasutuse jälgija -Comment[eu]=RAM erabileraren begirale bat -Comment[fi]=Näyttää muistin käytön -Comment[fr]=Surveillance de l'usage de la mémoire vive -Comment[fy]=In RAM brûkme monitor -Comment[ga]=Monatóir úsáid RAM -Comment[gl]=Un vixilante do utilización da memoria RAM -Comment[gu]=રેમ વપરાશ દેખરેખ -Comment[he]=משמש לניטור השימוש בזיכרון ה־RAM -Comment[hi]=रेम उपयोग मॉनीटर -Comment[hr]=Nadzor korištenja RAM memorije -Comment[hu]=Memóriahasználat-figyelő -Comment[ia]=Un monitor del usage de RAM -Comment[id]=Sebuah pemantau penggunaan RAM -Comment[is]=Eftirlit með notkun vinnsluminnis -Comment[it]=Indica l'uso della RAM -Comment[ja]=RAM 使用率を監視します -Comment[kk]=Жадыны пайдалануын бақылау -Comment[km]=កម្មវិធី​ត្រួតពិនិត្យ​ការ​ប្រើ​សតិ -Comment[kn]=RAM ಬಳಕೆಯ ಮೇಲ್ವಿಚಾರಕ -Comment[ko]=RAM 사용량 모니터 -Comment[lt]=RAM naudojimo prižiūryklė -Comment[lv]=Atmiņas izmantotāja novērotājs -Comment[mai]=रैम उपयोग मानीटर -Comment[mk]=Монитор на користењето на меморијата -Comment[ml]=ഒരു റാം ഉപയോഗ നിരീക്ഷണോപാധി -Comment[mr]=RAM वापरणी नियंत्रक -Comment[nb]=En overvåker for RAM-bruk -Comment[nds]=En Kieker för den RAM-Bruuk -Comment[nl]=Volgt het RAM-gebruik -Comment[nn]=Overvaking av minnebruk -Comment[pa]=ਇੱਕ RAM ਵਰਤੋਂ ਮਾਨੀਟਰ -Comment[pl]=Monitoruje wykorzystanie pamięci RAM -Comment[pt]=Um monitor da utilização da RAM -Comment[pt_BR]=Um monitor de utilização da RAM -Comment[ro]=Monitor pentru utilizarea memoriei -Comment[ru]=Монитор использования оперативной памяти -Comment[si]=RAM භාවිතය නිරික්‍ෂකය -Comment[sk]=Monitor využitia RAM -Comment[sl]=Nadzornik porabe hitrega pomnilnika -Comment[sr]=Надгледање употребе РАМ‑а -Comment[sr@ijekavian]=Надгледање употребе РАМ‑а -Comment[sr@ijekavianlatin]=Nadgledanje upotrebe RAM‑a -Comment[sr@latin]=Nadgledanje upotrebe RAM‑a -Comment[sv]=Övervakning av minnesanvändning -Comment[tg]=Назорати истифодабарии RAM -Comment[th]=ตัวติดตามการใช้งานหน่วยความจำ -Comment[tr]=Bir bellek kullanımı izleyici -Comment[ug]=RAM ئىشلىتىشنى كۆزەتكۈچ -Comment[uk]=Монітор використання пам’яті -Comment[wa]=On corwaitoe di l' eployaedje del RAM -Comment[x-test]=xxA RAM usage monitorxx -Comment[zh_CN]=RAM 利用率监视器 -Comment[zh_TW]=記憶體使用量監視器 - +Name=Memory Usage +Name[de]=Speicherverwendung +Comment=System monitor Widget that shows physical memory usage Type=Service -Icon=media-flash - +Icon=ksysguardd X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/memory.qml -X-Plasma-StandAloneApp=true +X-Plasma-MainScript=ui/main.qml +X-Plasma-Provides=org.kde.plasma.systemmonitor +X-Plasma-RootPath=org.kde.plasma.systemmonitor -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=mart@kde.org +X-KDE-PluginInfo-Author=Kai Uwe Broulik +X-KDE-PluginInfo-Email=kde@privat.broulik.de X-KDE-PluginInfo-Name=org.kde.plasma.systemmonitor.memory X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=https://kde.org/plasma-desktop -X-KDE-PluginInfo-Category=System Information +X-KDE-PluginInfo-Website=kde.org X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-FormFactors=tablet,mediacenter,desktop +X-KDE-PluginInfo-EnabledByDefault=true +X-KDE-PluginInfo-Category=System Information + +[Config] +chartFace=org.kde.ksysguard.piechart +sensorIds=mem/physical/allocated +totalSensor=mem/physical/allocatedlevel +textOnlySensorIds=mem/physical/total + +[FaceConfig] +rangeAuto=true +rangeFrom=0 +rangeTo=100 diff --git a/applets/systemmonitor/net/Messages.sh b/applets/systemmonitor/net/Messages.sh deleted file mode 100644 index 8523a0e03..000000000 --- a/applets/systemmonitor/net/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.net.pot diff --git a/applets/systemmonitor/net/contents/config/config.qml b/applets/systemmonitor/net/contents/config/config.qml deleted file mode 100644 index 2d7e1004d..000000000 --- a/applets/systemmonitor/net/contents/config/config.qml +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2013 Bhushan Shah - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. - */ - -import QtQuick 2.0 - -import org.kde.plasma.configuration 2.0 - -ConfigModel { - ConfigCategory { - name: i18n("Interfaces") - icon: "network-workgroup" - source: "netConfig.qml" - } - ConfigCategory { - name: i18n("Units") - icon: "kruler" - source: "displayConfig.qml" - } -} diff --git a/applets/systemmonitor/net/contents/ui/displayConfig.qml b/applets/systemmonitor/net/contents/ui/displayConfig.qml deleted file mode 100644 index e3c6416ba..000000000 --- a/applets/systemmonitor/net/contents/ui/displayConfig.qml +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2019 George Vogiatzis - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import QtQuick.Controls 2.5 as QQC2 -import org.kde.kirigami 2.5 as Kirigami - -Kirigami.FormLayout { - property int cfg_displayUnit: plasmoid.configuration.displayUnit - - QQC2.ButtonGroup { - id: displayUnitGroup - } - - QQC2.RadioButton { - id: byteDisplayUnit - QQC2.ButtonGroup.group: displayUnitGroup - - Kirigami.FormData.label: i18nc("@label", "Display unit:") - - text: i18nc("@option:radio", "Byte") - checked: cfg_displayUnit == 0 - onClicked: if (checked) {cfg_displayUnit = 0;} - } - - QQC2.RadioButton { - id: bitDisplayUnit - QQC2.ButtonGroup.group: displayUnitGroup - - text: i18nc("@option:radio", "bit") - - checked: cfg_displayUnit == 1 - onClicked: if (checked) {cfg_displayUnit = 1;} - } -} diff --git a/applets/systemmonitor/net/contents/ui/net.qml b/applets/systemmonitor/net/contents/ui/net.qml deleted file mode 100644 index 7507f1cb7..000000000 --- a/applets/systemmonitor/net/contents/ui/net.qml +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons -import org.kde.kcoreaddons 1.0 as KCoreAddons - -Applet { - id: root - - onSourceAdded: { - if (source.indexOf("network/interfaces/lo/") !== -1) { - return; - } - var match = source.match(/^network\/interfaces\/(\w+)\/transmitter\/data$/); - if (match) { - var rxSource = "network/interfaces/" + match[1] + "/receiver/data"; - root.addSource(source, match[1], rxSource, match[1]); - } - } - - delegate: DoublePlotter { - function formatData(data) { - if (plasmoid.configuration.displayUnit === 0) { - var value = data.value * 1024 - return i18nc("%1 is the displayed data transfer speed in bytes per second", "%1/s", KCoreAddons.Format.formatByteSize(value)); - } else { - var value = data.value * 1024 * 8 - if (value > (1024 * 1024)) { - return i18nc("%1 is the displayed data transfer speed in megabits per second", "%1 Mbps", (value / (1024 * 1024)).toFixed(1)); - } - if (value > 1024) { - return i18nc("%1 is the displayed data transfer speed in kilobits per second", "%1 Kbps", (value / 1024)); - } - return i18nc("%1 is the displayed data transfer speed in bits per second", "%1 bps", value); - } - } - } -} diff --git a/applets/systemmonitor/net/contents/ui/netConfig.qml b/applets/systemmonitor/net/contents/ui/netConfig.qml deleted file mode 100644 index df8d56c95..000000000 --- a/applets/systemmonitor/net/contents/ui/netConfig.qml +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * - * This program 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 or - * (at your option) any later version. - * - * This program 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 General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import org.kde.plasma.plasmoid 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons - -ConfigGeneral { - id: root - - onSourceAdded: { - if (source.indexOf("network/interfaces/lo/") !== -1) { - return; - } - var match = source.match(/^network\/interfaces\/(\w+)\/transmitter\/data$/); - if (match) { - root.addSource(source, match[1]); - } - } -} diff --git a/applets/systemmonitor/net/metadata.desktop b/applets/systemmonitor/net/metadata.desktop index e19c86683..0ad0ab6fb 100644 --- a/applets/systemmonitor/net/metadata.desktop +++ b/applets/systemmonitor/net/metadata.desktop @@ -1,157 +1,30 @@ [Desktop Entry] -Name=Network Monitor -Name[ar]=مرقاب الشبكة -Name[bg]=Наблюдение на мрежата -Name[bs]=Nadzor mreže -Name[ca]=Monitor de la xarxa -Name[ca@valencia]=Monitor de la xarxa -Name[cs]=Monitor sítě -Name[da]=Netværksovervågning -Name[de]=Netzwerküberwachung -Name[el]=Επόπτης δικτύου -Name[en_GB]=Network Monitor -Name[es]=Monitor de red -Name[et]=Võrgujälgija -Name[eu]=Sareko begiralea -Name[fi]=Verkon käyttö -Name[fr]=Surveillance du réseau -Name[ga]=Monatóir an Líonra -Name[gl]=Vixilante da rede -Name[gu]=નેટવર્ક મોનિટર -Name[he]=מוניטור רשת -Name[hi]=नेटवर्क नरीक्षण -Name[hr]=Nadzornik mreže -Name[hu]=Hálózatfigyelő -Name[ia]=Monitor de Rete -Name[id]=Pemantau Jaringan -Name[is]=Netkerfisvaktari -Name[it]=Monitor di rete -Name[ja]=ネットワークモニタ -Name[kk]=Желіні бақылау -Name[km]=ត្រួតពិនិត្យ​បណ្ដាញ -Name[kn]=ಜಾಲಬಂಧ ಮೇಲ್ವಿಚಾರಕ -Name[ko]=네트워크 모니터 -Name[lt]=Tinklo prižiūryklė -Name[lv]=Tīkla monitors -Name[ml]=നെറ്റ്‌വര്‍ക്ക് മോണിറ്റര്‍ -Name[mr]=संजाळ नियंत्रक -Name[nb]=Nettverksovervåker -Name[nds]=Nettwark-Kieker -Name[nl]=Netwerkmonitor -Name[nn]=Nettverksovervaking -Name[pa]=ਨੈੱਟਵਰਕ ਨਿਗਰਾਨ -Name[pl]=Monitor sieci -Name[pt]=Monitor da Rede -Name[pt_BR]=Monitor da rede -Name[ro]=Monitor de rețea -Name[ru]=Сетевой монитор -Name[se]=Fierbmi -Name[si]=ජාල මොනිටරය -Name[sk]=Monitor siete -Name[sl]=Nadzornik omrežja -Name[sr]=надзор мреже -Name[sr@ijekavian]=надзор мреже -Name[sr@ijekavianlatin]=nadzor mreže -Name[sr@latin]=nadzor mreže -Name[sv]=Nätverksövervakning -Name[tg]=Назорати шабака -Name[th]=ติดตามการใช้งานเครือข่าย -Name[tr]=Ağ İzleyici -Name[ug]=تور كۆزەتكۈچ -Name[uk]=Монітор мережі -Name[wa]=Corwaitoe del rantoele -Name[x-test]=xxNetwork Monitorxx -Name[zh_CN]=网络监视器 -Name[zh_TW]=網路監控 -Comment=A network usage monitor -Comment[ar]=مرقاب لاستخدام الشبكة -Comment[be@latin]=Nazirańnik zaniataści sietki -Comment[bg]=Наблюдение на изпозлването на мрежата -Comment[bs]=Nadgledanje upotrebe mreže -Comment[ca]=Un controlador d'ús de la xarxa -Comment[ca@valencia]=Un controlador d'ús de la xarxa -Comment[cs]=Monitor využití sítě -Comment[csb]=Mònitór brëkòwaniô sécë -Comment[da]=Overvågning af netværkstrafik -Comment[de]=Ein Überwachungsmonitor für Netzwerke -Comment[el]=Ένας επόπτης χρήσης του δικτύου -Comment[en_GB]=A network usage monitor -Comment[es]=Monitor de uso de la red -Comment[et]=Võrgukasutuse jälgija -Comment[eu]=Sare erabileraren begirale bat -Comment[fi]=Näyttää verkon käytön -Comment[fr]=Surveillance de l'usage réseau -Comment[fy]=In netwurk brûkme monitor -Comment[ga]=Monatóir úsáide an líonra -Comment[gl]=Un vixilante do estado da rede -Comment[gu]=નેટવર્ક સ્થિતિ દેખરેખ -Comment[he]=משמש לניטור השימוש ברשת -Comment[hi]=नेटवर्क उपयोग मॉनीटर -Comment[hne]=नेटवर्क उपयोग देखइया -Comment[hr]=Nadzor korištenja mreže -Comment[hsb]=Monitor, kiž pokazuje wućeženosć syće -Comment[hu]=Kijelzi a hálózat állapotát -Comment[ia]=Un monitor de usage de rete -Comment[id]=Sebuah pemantau penggunaan jaringan -Comment[is]=Eftirlit með notkun netsins -Comment[it]=Indica l'uso della rete -Comment[ja]=ネットワークの活動を監視します -Comment[kk]=Желі пайдалануын бақылау -Comment[km]=កម្មវិធី​ត្រួតពិនិត្យ​ការ​ប្រើ​បណ្ដាញ -Comment[kn]=ಜಾಲಬಂಧ ಬಳಕೆಯ ಮೇಲ್ವಿಚಾರಕ -Comment[ko]=네트워크 사용량 모니터 -Comment[ku]=Temaşekerê rewşa torê -Comment[lt]=Tinklo naudojimo prižiūryklė -Comment[lv]=Tīkla noslogojuma novērotājs -Comment[mk]=Монитор на користењето на мрежата -Comment[ml]=ഒരു നെറ്റ്‌വര്‍ക്ക് ഉപയോഗ നിരീക്ഷണോപാധി -Comment[mr]=संजाळ वापरणी नियंत्रक -Comment[nb]=En overvåker for nettverksbruk -Comment[nds]=En Kieker för den Nettwark-Bruuk -Comment[nl]=Toont het netwerkgebruik -Comment[nn]=Overvaking av nettverksbruk -Comment[or]=ଗୋଟିଏ ନେଟୱର୍କ ବ୍ୟବହାର ବିଧି ନିରିକ୍ଷକ -Comment[pa]=ਨੈੱਟਵਰਕ ਵਰਤੋਂ ਨਿਗਰਾਨ -Comment[pl]=Monitoruje wykorzystanie sieci -Comment[pt]=Um monitor da utilização da rede -Comment[pt_BR]=Um monitor de utilização da rede -Comment[ro]=Monitor de utilizare a rețelei -Comment[ru]=Монитор сетевой активности -Comment[si]=ජාල භාවිතය නිරික්‍ෂකය -Comment[sk]=Monitor využitia siete -Comment[sl]=Nadzornik uporabe omrežja -Comment[sr]=Надгледање употребе мреже -Comment[sr@ijekavian]=Надгледање употребе мреже -Comment[sr@ijekavianlatin]=Nadgledanje upotrebe mreže -Comment[sr@latin]=Nadgledanje upotrebe mreže -Comment[sv]=Övervakning av nätverksanvändning -Comment[ta]=பிணைய பயன்பாடு நோட்டம் -Comment[tg]=Назорати истифодабарии шабака -Comment[th]=ตัวติดตามดูการใช้งานเครือข่าย -Comment[tr]=Bir ağ kullanımı izleyici -Comment[ug]=تور ئىشلىتىشنى كۆزەتكۈچ -Comment[uk]=Монітор використання мережі -Comment[wa]=On corwaitoe di l' eployaedje del rantoele -Comment[x-test]=xxA network usage monitorxx -Comment[zh_CN]=网络利用率监视器 -Comment[zh_TW]=網路使用量監視器 +Name=Network speed +Comment=System monitor Widget that shows the download and upload data rate Type=Service Icon=network-workgroup - X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/net.qml -X-Plasma-StandAloneApp=true - -X-Plasma-ConfigPlugins=solid-actions,device_automounter_kcm +X-Plasma-MainScript=ui/main.qml +X-Plasma-Provides=org.kde.plasma.systemmonitor +X-Plasma-RootPath=org.kde.plasma.systemmonitor X-KDE-PluginInfo-Author=Marco Martin X-KDE-PluginInfo-Email=mart@kde.org X-KDE-PluginInfo-Name=org.kde.plasma.systemmonitor.net X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=https://kde.org/plasma-desktop -X-KDE-PluginInfo-Category=System Information +X-KDE-PluginInfo-Website=kde.org X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL-2.0+ -X-KDE-FormFactors=tablet,mediacenter,desktop +X-KDE-PluginInfo-EnabledByDefault=true +X-KDE-PluginInfo-Category=System Information + +[Config] +chartFace=org.kde.ksysguard.linechart +sensorIds=network/all/receivedDataRate,network/all/sentDataRate +totalSensor= +textOnlySensorIds= + +[FaceConfig] +lineChartSmooth=true diff --git a/applets/sysguard/sensorchart/CMakeLists.txt b/applets/systemmonitor/systemmonitor/CMakeLists.txt similarity index 50% rename from applets/sysguard/sensorchart/CMakeLists.txt rename to applets/systemmonitor/systemmonitor/CMakeLists.txt index eb2089af0..9c95a2e6b 100644 --- a/applets/sysguard/sensorchart/CMakeLists.txt +++ b/applets/systemmonitor/systemmonitor/CMakeLists.txt @@ -1,33 +1,33 @@ -set(sensorchart_SRCS - sensorchart.cpp +set(systemmonitor_SRCS + systemmonitor.cpp ) -add_library(plasma_applet_ksysguard_sensorchart MODULE ${sensorchart_SRCS}) +add_library(plasma_applet_systemmonitor MODULE ${systemmonitor_SRCS}) -kcoreaddons_desktop_to_json(plasma_applet_ksysguard_sensorchart package/metadata.desktop) +kcoreaddons_desktop_to_json(plasma_applet_systemmonitor package/metadata.desktop) -target_link_libraries(plasma_applet_ksysguard_sensorchart +target_link_libraries(plasma_applet_systemmonitor Qt5::Gui Qt5::Qml Qt5::Quick Qt5::DBus KF5::Plasma KF5::Package KF5::I18n KF5::ConfigCore KF5::ConfigGui KF5::Declarative KF5::SysGuard KF5::Sensors KF5::NewStuff ) -install(TARGETS plasma_applet_ksysguard_sensorchart DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets) +install(TARGETS plasma_applet_systemmonitor DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets) -plasma_install_package(package org.kde.ksysguard.sensorchart) +plasma_install_package(package org.kde.plasma.systemmonitor) -install(FILES sensorchart-faces.knsrc sensorchart-presets.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR}) +install(FILES systemmonitor-faces.knsrc systemmonitor-presets.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR}) add_subdirectory(packagestructure) add_subdirectory(faces) diff --git a/applets/sysguard/sensorchart/Messages.sh b/applets/systemmonitor/systemmonitor/Messages.sh similarity index 75% rename from applets/sysguard/sensorchart/Messages.sh rename to applets/systemmonitor/systemmonitor/Messages.sh index 5148f7dc8..54741b1e5 100755 --- a/applets/sysguard/sensorchart/Messages.sh +++ b/applets/systemmonitor/systemmonitor/Messages.sh @@ -1,4 +1,4 @@ #! /usr/bin/env bash $EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.ksysguard.sensorchart.pot +$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.pot rm -f rc.cpp diff --git a/applets/sysguard/sensorchart/faces/CMakeLists.txt b/applets/systemmonitor/systemmonitor/faces/CMakeLists.txt similarity index 100% rename from applets/sysguard/sensorchart/faces/CMakeLists.txt rename to applets/systemmonitor/systemmonitor/faces/CMakeLists.txt diff --git a/applets/sysguard/sensorchart/faces/barchart/contents/config/main.xml b/applets/systemmonitor/systemmonitor/faces/barchart/contents/config/main.xml similarity index 100% rename from applets/sysguard/sensorchart/faces/barchart/contents/config/main.xml rename to applets/systemmonitor/systemmonitor/faces/barchart/contents/config/main.xml diff --git a/applets/sysguard/sensorchart/faces/barchart/contents/ui/BarChart.qml b/applets/systemmonitor/systemmonitor/faces/barchart/contents/ui/BarChart.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/barchart/contents/ui/BarChart.qml rename to applets/systemmonitor/systemmonitor/faces/barchart/contents/ui/BarChart.qml diff --git a/applets/sysguard/sensorchart/faces/barchart/contents/ui/CompactRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/barchart/contents/ui/CompactRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/barchart/contents/ui/CompactRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/barchart/contents/ui/CompactRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/barchart/contents/ui/Config.qml b/applets/systemmonitor/systemmonitor/faces/barchart/contents/ui/Config.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/barchart/contents/ui/Config.qml rename to applets/systemmonitor/systemmonitor/faces/barchart/contents/ui/Config.qml diff --git a/applets/sysguard/sensorchart/faces/barchart/contents/ui/FullRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/barchart/contents/ui/FullRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/barchart/contents/ui/FullRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/barchart/contents/ui/FullRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/barchart/metadata.desktop b/applets/systemmonitor/systemmonitor/faces/barchart/metadata.desktop similarity index 100% rename from applets/sysguard/sensorchart/faces/barchart/metadata.desktop rename to applets/systemmonitor/systemmonitor/faces/barchart/metadata.desktop diff --git a/applets/sysguard/sensorchart/faces/linechart/contents/config/main.xml b/applets/systemmonitor/systemmonitor/faces/linechart/contents/config/main.xml similarity index 100% rename from applets/sysguard/sensorchart/faces/linechart/contents/config/main.xml rename to applets/systemmonitor/systemmonitor/faces/linechart/contents/config/main.xml diff --git a/applets/sysguard/sensorchart/faces/linechart/contents/ui/CompactRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/CompactRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/linechart/contents/ui/CompactRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/CompactRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/linechart/contents/ui/Config.qml b/applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/Config.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/linechart/contents/ui/Config.qml rename to applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/Config.qml diff --git a/applets/sysguard/sensorchart/faces/linechart/contents/ui/FullRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/FullRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/linechart/contents/ui/FullRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/FullRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/linechart/contents/ui/LineChart.qml b/applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/LineChart.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/linechart/contents/ui/LineChart.qml rename to applets/systemmonitor/systemmonitor/faces/linechart/contents/ui/LineChart.qml diff --git a/applets/sysguard/sensorchart/faces/linechart/metadata.desktop b/applets/systemmonitor/systemmonitor/faces/linechart/metadata.desktop similarity index 100% rename from applets/sysguard/sensorchart/faces/linechart/metadata.desktop rename to applets/systemmonitor/systemmonitor/faces/linechart/metadata.desktop diff --git a/applets/sysguard/sensorchart/faces/piechart/contents/config/main.xml b/applets/systemmonitor/systemmonitor/faces/piechart/contents/config/main.xml similarity index 100% rename from applets/sysguard/sensorchart/faces/piechart/contents/config/main.xml rename to applets/systemmonitor/systemmonitor/faces/piechart/contents/config/main.xml diff --git a/applets/sysguard/sensorchart/faces/piechart/contents/ui/CompactRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/CompactRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/piechart/contents/ui/CompactRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/CompactRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/piechart/contents/ui/Config.qml b/applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/Config.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/piechart/contents/ui/Config.qml rename to applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/Config.qml diff --git a/applets/sysguard/sensorchart/faces/piechart/contents/ui/FullRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/FullRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/piechart/contents/ui/FullRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/FullRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/piechart/contents/ui/PieChart.qml b/applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/PieChart.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/piechart/contents/ui/PieChart.qml rename to applets/systemmonitor/systemmonitor/faces/piechart/contents/ui/PieChart.qml diff --git a/applets/sysguard/sensorchart/faces/piechart/metadata.desktop b/applets/systemmonitor/systemmonitor/faces/piechart/metadata.desktop similarity index 100% rename from applets/sysguard/sensorchart/faces/piechart/metadata.desktop rename to applets/systemmonitor/systemmonitor/faces/piechart/metadata.desktop diff --git a/applets/sysguard/sensorchart/faces/table/contents/config/main.xml b/applets/systemmonitor/systemmonitor/faces/table/contents/config/main.xml similarity index 100% rename from applets/sysguard/sensorchart/faces/table/contents/config/main.xml rename to applets/systemmonitor/systemmonitor/faces/table/contents/config/main.xml diff --git a/applets/sysguard/sensorchart/faces/table/contents/ui/CompactRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/table/contents/ui/CompactRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/table/contents/ui/CompactRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/table/contents/ui/CompactRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/table/contents/ui/Config.qml b/applets/systemmonitor/systemmonitor/faces/table/contents/ui/Config.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/table/contents/ui/Config.qml rename to applets/systemmonitor/systemmonitor/faces/table/contents/ui/Config.qml diff --git a/applets/sysguard/sensorchart/faces/table/contents/ui/FullRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/table/contents/ui/FullRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/table/contents/ui/FullRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/table/contents/ui/FullRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/table/metadata.desktop b/applets/systemmonitor/systemmonitor/faces/table/metadata.desktop similarity index 100% rename from applets/sysguard/sensorchart/faces/table/metadata.desktop rename to applets/systemmonitor/systemmonitor/faces/table/metadata.desktop diff --git a/applets/sysguard/sensorchart/faces/textonly/contents/ui/CompactRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/textonly/contents/ui/CompactRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/textonly/contents/ui/CompactRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/textonly/contents/ui/CompactRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/textonly/contents/ui/FullRepresentation.qml b/applets/systemmonitor/systemmonitor/faces/textonly/contents/ui/FullRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/faces/textonly/contents/ui/FullRepresentation.qml rename to applets/systemmonitor/systemmonitor/faces/textonly/contents/ui/FullRepresentation.qml diff --git a/applets/sysguard/sensorchart/faces/textonly/metadata.desktop b/applets/systemmonitor/systemmonitor/faces/textonly/metadata.desktop similarity index 100% rename from applets/sysguard/sensorchart/faces/textonly/metadata.desktop rename to applets/systemmonitor/systemmonitor/faces/textonly/metadata.desktop diff --git a/applets/sysguard/sensorchart/package/contents/config/config.qml b/applets/systemmonitor/systemmonitor/package/contents/config/config.qml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/config/config.qml rename to applets/systemmonitor/systemmonitor/package/contents/config/config.qml diff --git a/applets/sysguard/sensorchart/package/contents/config/main.xml b/applets/systemmonitor/systemmonitor/package/contents/config/main.xml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/config/main.xml rename to applets/systemmonitor/systemmonitor/package/contents/config/main.xml diff --git a/applets/sysguard/sensorchart/package/contents/ui/CompactRepresentation.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/CompactRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/ui/CompactRepresentation.qml rename to applets/systemmonitor/systemmonitor/package/contents/ui/CompactRepresentation.qml diff --git a/applets/sysguard/sensorchart/package/contents/ui/FullRepresentation.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/FullRepresentation.qml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/ui/FullRepresentation.qml rename to applets/systemmonitor/systemmonitor/package/contents/ui/FullRepresentation.qml diff --git a/applets/sysguard/sensorchart/package/contents/ui/config/ConfigAppearance.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigAppearance.qml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/ui/config/ConfigAppearance.qml rename to applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigAppearance.qml diff --git a/applets/sysguard/sensorchart/package/contents/ui/config/ConfigSensors.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigSensors.qml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/ui/config/ConfigSensors.qml rename to applets/systemmonitor/systemmonitor/package/contents/ui/config/ConfigSensors.qml diff --git a/applets/sysguard/sensorchart/package/contents/ui/config/FaceDetails.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/config/FaceDetails.qml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/ui/config/FaceDetails.qml rename to applets/systemmonitor/systemmonitor/package/contents/ui/config/FaceDetails.qml diff --git a/applets/sysguard/sensorchart/package/contents/ui/config/SaveDialog.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/config/SaveDialog.qml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/ui/config/SaveDialog.qml rename to applets/systemmonitor/systemmonitor/package/contents/ui/config/SaveDialog.qml diff --git a/applets/sysguard/sensorchart/package/contents/ui/config/UsedSensorsView.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/config/UsedSensorsView.qml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/ui/config/UsedSensorsView.qml rename to applets/systemmonitor/systemmonitor/package/contents/ui/config/UsedSensorsView.qml diff --git a/applets/sysguard/sensorchart/package/contents/ui/main.qml b/applets/systemmonitor/systemmonitor/package/contents/ui/main.qml similarity index 100% rename from applets/sysguard/sensorchart/package/contents/ui/main.qml rename to applets/systemmonitor/systemmonitor/package/contents/ui/main.qml diff --git a/applets/sysguard/sensorchart/package/metadata.desktop b/applets/systemmonitor/systemmonitor/package/metadata.desktop similarity index 83% rename from applets/sysguard/sensorchart/package/metadata.desktop rename to applets/systemmonitor/systemmonitor/package/metadata.desktop index 502f5024b..455a2326d 100644 --- a/applets/sysguard/sensorchart/package/metadata.desktop +++ b/applets/systemmonitor/systemmonitor/package/metadata.desktop @@ -1,22 +1,22 @@ [Desktop Entry] Encoding=UTF-8 Name=System monitor Sensor Comment=Displays a configurable chart of a system monitor sensor Icon=ksysguardd Type=Service X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml -X-KDE-Library=plasma_applet_ksysguard_sensorchart +X-KDE-Library=plasma_applet_systemmonitor X-KDE-PluginInfo-Author=Marco Martin X-KDE-PluginInfo-Email=mart@kde.org X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=org.kde.ksysguard.sensorchart +X-KDE-PluginInfo-Name=org.kde.plasma.systemmonitor X-KDE-PluginInfo-Version=1.0 X-KDE-PluginInfo-Website=kde.org X-KDE-PluginInfo-Category=System Information X-Plasma-Provides=org.kde.plasma.systemmonitor diff --git a/applets/sysguard/sensorchart/packagestructure/CMakeLists.txt b/applets/systemmonitor/systemmonitor/packagestructure/CMakeLists.txt similarity index 100% rename from applets/sysguard/sensorchart/packagestructure/CMakeLists.txt rename to applets/systemmonitor/systemmonitor/packagestructure/CMakeLists.txt diff --git a/applets/sysguard/sensorchart/packagestructure/config-package.h.cmake b/applets/systemmonitor/systemmonitor/packagestructure/config-package.h.cmake similarity index 100% rename from applets/sysguard/sensorchart/packagestructure/config-package.h.cmake rename to applets/systemmonitor/systemmonitor/packagestructure/config-package.h.cmake diff --git a/applets/sysguard/sensorchart/packagestructure/sensorapplet-packagestructure.json b/applets/systemmonitor/systemmonitor/packagestructure/sensorapplet-packagestructure.json similarity index 100% rename from applets/sysguard/sensorchart/packagestructure/sensorapplet-packagestructure.json rename to applets/systemmonitor/systemmonitor/packagestructure/sensorapplet-packagestructure.json diff --git a/applets/sysguard/sensorchart/packagestructure/sensorappletpackage.cpp b/applets/systemmonitor/systemmonitor/packagestructure/sensorappletpackage.cpp similarity index 100% rename from applets/sysguard/sensorchart/packagestructure/sensorappletpackage.cpp rename to applets/systemmonitor/systemmonitor/packagestructure/sensorappletpackage.cpp diff --git a/applets/sysguard/sensorchart/sensorchart-faces.knsrc b/applets/systemmonitor/systemmonitor/systemmonitor-faces.knsrc similarity index 100% rename from applets/sysguard/sensorchart/sensorchart-faces.knsrc rename to applets/systemmonitor/systemmonitor/systemmonitor-faces.knsrc diff --git a/applets/sysguard/sensorchart/sensorchart-presets.knsrc b/applets/systemmonitor/systemmonitor/systemmonitor-presets.knsrc similarity index 100% rename from applets/sysguard/sensorchart/sensorchart-presets.knsrc rename to applets/systemmonitor/systemmonitor/systemmonitor-presets.knsrc diff --git a/applets/sysguard/sensorchart/sensorchart.cpp b/applets/systemmonitor/systemmonitor/systemmonitor.cpp similarity index 83% rename from applets/sysguard/sensorchart/sensorchart.cpp rename to applets/systemmonitor/systemmonitor/systemmonitor.cpp index 097c67825..07fda9dd9 100644 --- a/applets/sysguard/sensorchart/sensorchart.cpp +++ b/applets/systemmonitor/systemmonitor/systemmonitor.cpp @@ -1,581 +1,583 @@ /*************************************************************************** * Copyright (C) 2019 Marco Martin * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ -#include "sensorchart.h" +#include "systemmonitor.h" #include #include #include #include #include #include #include #include #include #include #include #include FacesModel::FacesModel(QObject *parent) : QStandardItemModel(parent) {} void FacesModel::load() { clear(); auto list = KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/SensorApplet")); // NOTE: This will diable completely the internal in-memory cache KPackage::Package p; p.install(QString(), QString()); for (auto plugin : list) { QStandardItem *item = new QStandardItem(plugin.name()); item->setData(plugin.name(), FacesModel::ModelDataRole); item->setData(plugin.pluginId(), FacesModel::PluginIdRole); appendRow(item); } } QString FacesModel::pluginId(int row) { return data(index(row, 0), PluginIdRole).toString(); } QHash FacesModel::roleNames() const { QHash roles = QAbstractItemModel::roleNames(); roles[ModelDataRole] = "modelData"; roles[PluginIdRole] = "pluginId"; return roles; } PresetsModel::PresetsModel(QObject *parent) : QStandardItemModel(parent) {} QString PresetsModel::pluginId(int row) const { return data(index(row, 0), PluginIdRole).toString(); } QHash PresetsModel::roleNames() const { QHash roles = QAbstractItemModel::roleNames(); roles[ModelDataRole] = "modelData"; roles[PluginIdRole] = "pluginId"; roles[ConfigRole] = "config"; roles[WritableRole] = "writable"; return roles; } -SensorChart::SensorChart(QObject *parent, const QVariantList &args) +SystemMonitor::SystemMonitor(QObject *parent, const QVariantList &args) : Plasma::Applet(parent, args) { setHasConfigurationInterface(true); m_facePackage = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/SensorApplet"), QStringLiteral("org.kde.ksysguard.linechart")); //Don't set the preset right now as we can't write on the config here because we don't have a Corona yet if (args.count() > 2 && args.mid(3).length() > 0) { const QString preset = args.mid(3).first().toString(); if (preset.length() > 0) { m_pendingStartupPreset = preset; } } } -SensorChart::~SensorChart() +SystemMonitor::~SystemMonitor() = default; -void SensorChart::init() +void SystemMonitor::init() { configChanged(); - // NOTE: taking the pluginId this way, we take it from the child applet (cpu monitor, memory, whatever) rather than the parent fallback applet (sensorchart) + // NOTE: taking the pluginId this way, we take it from the child applet (cpu monitor, memory, whatever) rather than the parent fallback applet (systemmonitor) const QString pluginId = KPluginMetaData(kPackage().path() + QStringLiteral("metadata.desktop")).pluginId(); if (!m_pendingStartupPreset.isNull()) { setCurrentPreset(m_pendingStartupPreset); } else { //Take it from the config, which is *not* accessible from plasmoid.config as is not in config.xml const QString preset = config().readEntry("CurrentPreset", pluginId); setCurrentPreset(preset); if (preset.isEmpty()) { resetToCustomPreset(); emit currentPresetChanged(); } } } -void SensorChart::configChanged() +void SystemMonitor::configChanged() { setFace(configScheme()->property("chartFace").toString()); } -void SensorChart::setFace(const QString &face) -{ +void SystemMonitor::setFace(const QString &face) +{qWarning()<<"AAAA"<deleteLater(); } if (m_faceConfigLoader) { m_faceConfigLoader->deleteLater(); } m_faceConfigLoader = new KConfigLoader(cg, &file, this); m_faceConfiguration = new KDeclarative::ConfigPropertyMap(m_faceConfigLoader, this); } emit faceChanged(); } -QString SensorChart::face() const +QString SystemMonitor::face() const { return m_face; } -QString SensorChart::faceName() const +QString SystemMonitor::faceName() const { if (!m_faceMetadata) { return QString(); } return m_faceMetadata->readName(); } -QString SensorChart::faceIcon() const +QString SystemMonitor::faceIcon() const { if (!m_faceMetadata) { return QString(); } return m_faceMetadata->readIcon(); } -QString SensorChart::currentPreset() const +QString SystemMonitor::currentPreset() const { return m_currentPreset; } -void SensorChart::setCurrentPreset(const QString &preset) +void SystemMonitor::setCurrentPreset(const QString &preset) { if (preset == m_currentPreset) { return; } m_currentPreset = preset; config().writeEntry("CurrentPreset", preset); if (preset.isEmpty()) { resetToCustomPreset(); emit currentPresetChanged(); return; } auto presetPackage = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/Applet")); presetPackage.setPath(preset); if (!presetPackage.isValid()) { return; } - if (presetPackage.metadata().value(QStringLiteral("X-Plasma-RootPath")) != QStringLiteral("org.kde.ksysguard.sensorchart")) { + if (presetPackage.metadata().value(QStringLiteral("X-Plasma-RootPath")) != QStringLiteral("org.kde.plasma.systemmonitor")) { return; } - disconnect(configScheme(), &KCoreConfigSkeleton::configChanged, this, &SensorChart::resetToCustomPresetUserConfiguring); - disconnect(m_faceConfigLoader, &KCoreConfigSkeleton::configChanged, this, &SensorChart::resetToCustomPresetUserConfiguring); + disconnect(configScheme(), &KCoreConfigSkeleton::configChanged, this, &SystemMonitor::resetToCustomPresetUserConfiguring); + disconnect(m_faceConfigLoader, &KCoreConfigSkeleton::configChanged, this, &SystemMonitor::resetToCustomPresetUserConfiguring); KDesktopFile df(presetPackage.path() + QStringLiteral("metadata.desktop")); KConfigGroup configGroup(df.group("Config")); // Load the title KConfigSkeletonItem *item = configScheme()->findItemByName(QStringLiteral("title")); if (item) { item->setProperty(df.readName()); configScheme()->save(); //why read? read will update KConfigSkeletonItem::mLoadedValue, //allowing a write operation to be performed next time configScheme()->read(); } //Remove the "custon" value from presets models if (m_availablePresetsModel && m_availablePresetsModel->data(m_availablePresetsModel->index(0, 0), PresetsModel::PluginIdRole).toString().isEmpty()) { m_availablePresetsModel->removeRow(0); } // Load the global config keys for (const QString &key : configGroup.keyList()) { KConfigSkeletonItem *item = configScheme()->findItemByName(key); if (item) { if (item->property().type() == QVariant::StringList) { // Special case: sensor ids or textOnlySensorIds can have wildchars that need to be expanded if (key == "sensorIds" || key == "textOnlySensorIds") { const QStringList partialEntries = configGroup.readEntry(key, QStringList()); QStringList sensors; for (const QString &id : partialEntries) { KSysGuard::SensorQuery query{id}; query.execute(); query.waitForFinished(); sensors.append(query.sensorIds()); } item->setProperty(QVariant::fromValue(sensors)); } else { item->setProperty(QVariant::fromValue(configGroup.readEntry(key, QStringList()))); } } else { const QString &value = configGroup.readEntry(key); if (key == QStringLiteral("chartFace") && value.length() > 0) { setFace(value); } item->setProperty(value); } configScheme()->save(); //why read? read will update KConfigSkeletonItem::mLoadedValue, //allowing a write operation to be performed next time configScheme()->read(); } } - configGroup = KConfigGroup(df.group("FaceConfig")); - for (const QString &key : configGroup.keyList()) { - KConfigSkeletonItem *item = m_faceConfigLoader->findItemByName(key); - if (item) { - if (item->property().type() == QVariant::StringList) { - item->setProperty(configGroup.readEntry(key, QStringList())); - } else { - item->setProperty(configGroup.readEntry(key)); + if (m_faceConfigLoader) { + configGroup = KConfigGroup(df.group("FaceConfig")); + for (const QString &key : configGroup.keyList()) { + KConfigSkeletonItem *item = m_faceConfigLoader->findItemByName(key); + if (item) { + if (item->property().type() == QVariant::StringList) { + item->setProperty(configGroup.readEntry(key, QStringList())); + } else { + item->setProperty(configGroup.readEntry(key)); + } + m_faceConfigLoader->save(); + m_faceConfigLoader->read(); } - m_faceConfigLoader->save(); - m_faceConfigLoader->read(); } } emit currentPresetChanged(); - connect(configScheme(), &KCoreConfigSkeleton::configChanged, this, &SensorChart::resetToCustomPresetUserConfiguring); - connect(m_faceConfigLoader, &KCoreConfigSkeleton::configChanged, this, &SensorChart::resetToCustomPresetUserConfiguring); + connect(configScheme(), &KCoreConfigSkeleton::configChanged, this, &SystemMonitor::resetToCustomPresetUserConfiguring); + connect(m_faceConfigLoader, &KCoreConfigSkeleton::configChanged, this, &SystemMonitor::resetToCustomPresetUserConfiguring); } -void SensorChart::resetToCustomPresetUserConfiguring() +void SystemMonitor::resetToCustomPresetUserConfiguring() { // automatically switch to "custom" preset only when the user changes settings from the dialog, *not* nettings changed programmatically by the plasmoid itself if (isUserConfiguring()) { resetToCustomPreset(); } } -void SensorChart::resetToCustomPreset() +void SystemMonitor::resetToCustomPreset() { if (m_availablePresetsModel && !m_availablePresetsModel->data(m_availablePresetsModel->index(0, 0), PresetsModel::PluginIdRole).toString().isEmpty()) { QStandardItem *item = new QStandardItem(i18n("Custom")); item->setData(i18n("Custom"), PresetsModel::ModelDataRole); m_availablePresetsModel->insertRow(0, item); } setCurrentPreset(QString()); } -QString SensorChart::compactRepresentationPath() const +QString SystemMonitor::compactRepresentationPath() const { return m_facePackage.filePath("CompactRepresentation"); } -QString SensorChart::fullRepresentationPath() const +QString SystemMonitor::fullRepresentationPath() const { return m_facePackage.filePath("FullRepresentation"); } -QString SensorChart::configPath() const +QString SystemMonitor::configPath() const { return m_facePackage.filePath("ConfigUI"); } -bool SensorChart::supportsSensorsColors() const +bool SystemMonitor::supportsSensorsColors() const { if (!m_faceMetadata) { return false; } KConfigGroup cg(m_faceMetadata, QStringLiteral("Config")); return cg.readEntry("SupportsSensorsColors", false); } -bool SensorChart::supportsTotalSensor() const +bool SystemMonitor::supportsTotalSensor() const { if (!m_faceMetadata) { return false; } KConfigGroup cg(m_faceMetadata, QStringLiteral("Config")); return cg.readEntry("SupportsTotalSensor", false); } -bool SensorChart::supportsTextOnlySensors() const +bool SystemMonitor::supportsTextOnlySensors() const { if (!m_faceMetadata) { return false; } KConfigGroup cg(m_faceMetadata, QStringLiteral("Config")); return cg.readEntry("SupportsTextOnlySensors", false); } -QAbstractItemModel *SensorChart::availableFacesModel() +QAbstractItemModel *SystemMonitor::availableFacesModel() { if (m_availableFacesModel) { return m_availableFacesModel; } m_availableFacesModel = new FacesModel(this); m_availableFacesModel->load(); return m_availableFacesModel; } -QAbstractItemModel *SensorChart::availablePresetsModel() +QAbstractItemModel *SystemMonitor::availablePresetsModel() { if (m_availablePresetsModel) { return m_availablePresetsModel; } m_availablePresetsModel = new PresetsModel(this); // TODO move that into a PresetsModel::load() reloadAvailablePresetsModel(); if (m_currentPreset.isEmpty()) { resetToCustomPreset(); } return m_availablePresetsModel; } -void SensorChart::reloadAvailablePresetsModel() +void SystemMonitor::reloadAvailablePresetsModel() { if (!m_availablePresetsModel) { availablePresetsModel(); return; } m_availablePresetsModel->clear(); QList plugins = KPackage::PackageLoader::self()->findPackages(QStringLiteral("Plasma/Applet"), QString(), [](const KPluginMetaData &plugin) { - return plugin.value(QStringLiteral("X-Plasma-RootPath")) == QStringLiteral("org.kde.ksysguard.sensorchart"); + return plugin.value(QStringLiteral("X-Plasma-RootPath")) == QStringLiteral("org.kde.plasma.systemmonitor"); }); QSet usedNames; // We iterate backwards because packages under ~/.local are listed first, while we want them last auto it = plugins.rbegin(); for (; it != plugins.rend(); ++it) { const auto &plugin = *it; KPackage::Package p = KPackage::PackageLoader::self()->loadPackage("Plasma/Applet", plugin.pluginId()); KDesktopFile df(p.path() + QStringLiteral("metadata.desktop")); QString baseName = df.readName(); QString name = baseName; int id = 0; while (usedNames.contains(name)) { name = baseName % " (" % QString::number(++id) % ")"; } usedNames << name; QStandardItem *item = new QStandardItem(baseName); // TODO config QVariantMap config; KConfigGroup configGroup(df.group("Config")); const QStringList keys = configGroup.keyList(); for (const QString &key : keys) { // all strings for now, type conversion happens in QML side when we have the config property map config.insert(key, configGroup.readEntry(key)); } item->setData(name, PresetsModel::ModelDataRole); item->setData(plugin.pluginId(), PresetsModel::PluginIdRole); item->setData(config, PresetsModel::ConfigRole); item->setData(QFileInfo(p.path() + QStringLiteral("metadata.desktop")).isWritable(), PresetsModel::WritableRole); m_availablePresetsModel->appendRow(item); } } -QObject *SensorChart::faceConfiguration() const +QObject *SystemMonitor::faceConfiguration() const { return m_faceConfiguration; } -void SensorChart::createNewPreset(const QString &pluginName, const QString &comment, const QString &author, const QString &email, const QString &license, const QString &website) +void SystemMonitor::createNewPreset(const QString &pluginName, const QString &comment, const QString &author, const QString &email, const QString &license, const QString &website) { QTemporaryDir dir; if (!dir.isValid()) { return; } KConfig c(dir.path() % QLatin1Literal("/metadata.desktop")); KConfigGroup cg(&c, "Desktop Entry"); cg.writeEntry("Name", configScheme()->property("title")); cg.writeEntry("Comment", comment); cg.writeEntry("Icon", "ksysguardd"); cg.writeEntry("X-Plasma-API", "declarativeappletscript"); cg.writeEntry("X-Plasma-MainScript", "ui/main.qml"); cg.writeEntry("X-Plasma-Provides", "org.kde.plasma.systemmonitor"); - cg.writeEntry("X-Plasma-RootPath", "org.kde.ksysguard.sensorchart"); + cg.writeEntry("X-Plasma-RootPath", "org.kde.plasma.systemmonitor"); cg.writeEntry("X-KDE-PluginInfo-Name", pluginName); cg.writeEntry("X-KDE-ServiceTypes", "Plasma/Applet"); cg.writeEntry("X-KDE-PluginInfo-Author", author); cg.writeEntry("X-KDE-PluginInfo-Email", email); cg.writeEntry("X-KDE-PluginInfo-Website", website); cg.writeEntry("X-KDE-PluginInfo-Category", "System Information"); cg.writeEntry("X-KDE-PluginInfo-License", license); cg.writeEntry("X-KDE-PluginInfo-EnabledByDefault", "true"); cg.writeEntry("X-KDE-PluginInfo-Version", "0.1"); cg.sync(); cg = KConfigGroup(&c, "Config"); for (KConfigSkeletonItem *item : configScheme()->items()) { cg.writeEntry(item->key(), item->property()); } cg.sync(); cg = KConfigGroup(&c, "FaceConfig"); for (KConfigSkeletonItem *item : m_faceConfigLoader->items()) { cg.writeEntry(item->key(), item->property()); } cg.sync(); auto presetPackage = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/Applet")); auto *job = presetPackage.install(dir.path()); connect(job, &KJob::finished, this, [this, pluginName] () { reloadAvailablePresetsModel(); setCurrentPreset(pluginName); }); } -void SensorChart::savePreset() +void SystemMonitor::savePreset() { - QString pluginName = QStringLiteral("org.kde.ksysguard.sensorchart.preset"); + QString pluginName = QStringLiteral("org.kde.plasma.systemmonitor.preset"); int suffix = 0; auto presetPackage = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/Applet")); do { presetPackage.setPath(QString()); presetPackage.setPath(pluginName + QString::number(++suffix)); } while (!presetPackage.filePath("metadata").isEmpty()); pluginName += QString::number(suffix); createNewPreset(pluginName, QString(), QString(), QString(), QStringLiteral("LGPL 2.1+"), QString()); } -void SensorChart::getNewPresets(QQuickItem *ctx) +void SystemMonitor::getNewPresets(QQuickItem *ctx) { - return getNewStuff(ctx, QStringLiteral("sensorchart-presets.knsrc"), i18n("Download New Presets")); + return getNewStuff(ctx, QStringLiteral("systemmonitor-presets.knsrc"), i18n("Download New Presets")); } -void SensorChart::uninstallPreset(const QString &pluginId) +void SystemMonitor::uninstallPreset(const QString &pluginId) { auto presetPackage = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/Applet"), pluginId); - if (presetPackage.metadata().value("X-Plasma-RootPath") != QStringLiteral("org.kde.ksysguard.sensorchart")) { + if (presetPackage.metadata().value("X-Plasma-RootPath") != QStringLiteral("org.kde.plasma.systemmonitor")) { return; } QDir root(presetPackage.path()); root.cdUp(); auto *job = presetPackage.uninstall(pluginId, root.path()); connect(job, &KJob::finished, this, [this] () { reloadAvailablePresetsModel(); }); } -void SensorChart::getNewFaces(QQuickItem *ctx) +void SystemMonitor::getNewFaces(QQuickItem *ctx) { - getNewStuff(ctx, QStringLiteral("sensorchart-faces.knsrc"), i18n("Download New Display Styles")); + getNewStuff(ctx, QStringLiteral("systemmonitor-faces.knsrc"), i18n("Download New Display Styles")); } -void SensorChart::getNewStuff(QQuickItem *ctx, const QString &knsrc, const QString &title) +void SystemMonitor::getNewStuff(QQuickItem *ctx, const QString &knsrc, const QString &title) { if (m_newStuffDialog) { return; } m_newStuffDialog = new KNS3::DownloadDialog(knsrc); m_newStuffDialog->setWindowTitle(title); m_newStuffDialog->setWindowModality(Qt::WindowModal); m_newStuffDialog->winId(); // so it creates the windowHandle(); m_newStuffDialog->setAttribute(Qt::WA_DeleteOnClose); connect(m_newStuffDialog.data(), &KNS3::DownloadDialog::accepted, this, [this] { if (m_availableFacesModel) { m_availableFacesModel->load(); } reloadAvailablePresetsModel(); }); if (ctx && ctx->window()) { m_newStuffDialog->windowHandle()->setTransientParent(ctx->window()); } m_newStuffDialog->show(); } -K_EXPORT_PLASMA_APPLET_WITH_JSON(sensorchart, SensorChart, "metadata.json") +K_EXPORT_PLASMA_APPLET_WITH_JSON(systemmonitor, SystemMonitor, "metadata.json") -#include "sensorchart.moc" +#include "systemmonitor.moc" diff --git a/applets/sysguard/sensorchart/sensorchart.h b/applets/systemmonitor/systemmonitor/systemmonitor.h similarity index 97% rename from applets/sysguard/sensorchart/sensorchart.h rename to applets/systemmonitor/systemmonitor/systemmonitor.h index 569c405ab..3f2ff9914 100644 --- a/applets/sysguard/sensorchart/sensorchart.h +++ b/applets/systemmonitor/systemmonitor/systemmonitor.h @@ -1,170 +1,170 @@ /*************************************************************************** * Copyright (C) 2019 Marco Martin * * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #pragma once #include #include #include #include #include #include class ApplicationListModel; class QQuickItem; class KConfigLoader; namespace KDeclarative { class ConfigPropertyMap; } class FacesModel : public QStandardItemModel { Q_OBJECT public: enum AdditionalRoles { ModelDataRole = Qt::UserRole + 1, PluginIdRole }; Q_ENUM(AdditionalRoles) FacesModel(QObject *parent = nullptr); ~FacesModel() = default; void load(); Q_INVOKABLE QString pluginId(int row); QHash roleNames() const override; }; class PresetsModel : public QStandardItemModel { Q_OBJECT public: enum AdditionalRoles { ModelDataRole = Qt::UserRole + 1, PluginIdRole, ConfigRole, WritableRole }; Q_ENUM(AdditionalRoles) PresetsModel(QObject *parent = nullptr); ~PresetsModel() = default; Q_INVOKABLE QString pluginId(int row) const; // really needed? QHash roleNames() const override; }; -class SensorChart : public Plasma::Applet +class SystemMonitor : public Plasma::Applet { Q_OBJECT Q_PROPERTY(QString face READ face NOTIFY faceChanged) Q_PROPERTY(QString faceName READ faceName NOTIFY faceChanged) Q_PROPERTY(QString currentPreset READ currentPreset WRITE setCurrentPreset NOTIFY currentPresetChanged) Q_PROPERTY(QString faceIcon READ faceIcon NOTIFY faceChanged) Q_PROPERTY(QString compactRepresentationPath READ compactRepresentationPath NOTIFY faceChanged) Q_PROPERTY(QString fullRepresentationPath READ fullRepresentationPath NOTIFY faceChanged) Q_PROPERTY(QString configPath READ configPath NOTIFY faceChanged) Q_PROPERTY(bool supportsSensorsColors READ supportsSensorsColors NOTIFY faceChanged) Q_PROPERTY(bool supportsTotalSensor READ supportsTotalSensor NOTIFY faceChanged) Q_PROPERTY(bool supportsTextOnlySensors READ supportsTextOnlySensors NOTIFY faceChanged) Q_PROPERTY(QAbstractItemModel *availableFacesModel READ availableFacesModel CONSTANT) Q_PROPERTY(QAbstractItemModel *availablePresetsModel READ availablePresetsModel CONSTANT) /** * Configuration object: each config key will be a writable property of this object. property bindings work. */ Q_PROPERTY(QObject *faceConfiguration READ faceConfiguration NOTIFY faceChanged) public: - SensorChart( QObject *parent, const QVariantList &args ); - ~SensorChart() override; + SystemMonitor( QObject *parent, const QVariantList &args ); + ~SystemMonitor() override; void init() override; // Getter, also for QML QString face() const; // Setter internal use only void setFace(const QString &face); QString faceName() const; QString faceIcon() const; QString currentPreset() const; void setCurrentPreset(const QString &preset); QString compactRepresentationPath() const; QString fullRepresentationPath() const; QString configPath() const; bool supportsSensorsColors() const; bool supportsTotalSensor() const; bool supportsTextOnlySensors() const; QAbstractItemModel *availableFacesModel(); QAbstractItemModel *availablePresetsModel(); QObject *faceConfiguration() const; void reloadAvailablePresetsModel(); // TODO: should there be a dialog that lets the user insert the metadata? void createNewPreset(const QString &pluginName, const QString &comment, const QString &author, const QString &email, const QString &license, const QString &website); Q_INVOKABLE void savePreset(); Q_INVOKABLE void getNewPresets(QQuickItem *ctx); Q_INVOKABLE void uninstallPreset(const QString &pluginId); Q_INVOKABLE void getNewFaces(QQuickItem *ctx); public Q_SLOTS: void configChanged() override; Q_SIGNALS: void faceChanged(); void currentPresetChanged(); private: void resetToCustomPresetUserConfiguring(); void resetToCustomPreset(); void getNewStuff(QQuickItem *ctx, const QString &knsrc, const QString &title); QString m_face; QString m_currentPreset; QString m_pendingStartupPreset; KPackage::Package m_facePackage; KDesktopFile *m_faceMetadata = nullptr; FacesModel *m_availableFacesModel = nullptr; PresetsModel *m_availablePresetsModel = nullptr; KConfigLoader *m_faceConfigLoader = nullptr; KDeclarative::ConfigPropertyMap *m_faceConfiguration = nullptr; QPointer m_newStuffDialog; }; diff --git a/shell/scripting/applet.cpp b/shell/scripting/applet.cpp index 878f99194..2a20033f9 100644 --- a/shell/scripting/applet.cpp +++ b/shell/scripting/applet.cpp @@ -1,274 +1,274 @@ /* * Copyright 2009 Aaron Seigo * * This program 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, or * (at your option) any later version. * * This program 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 General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "applet.h" #include #include #include #include #include #include #include namespace WorkspaceScripting { class Applet::Private { public: Private() : configDirty(false), inWallpaperConfig(false) { } KConfigGroup configGroup; QStringList configGroupPath; KConfigGroup globalConfigGroup; QStringList globalConfigGroupPath; bool configDirty : 1; bool inWallpaperConfig : 1; }; -Applet::Applet(QObject *parent) +Applet::Applet(ScriptEngine *parent) : QObject(parent), d(new Applet::Private) { } Applet::~Applet() { delete d; } void Applet::setCurrentConfigGroup(const QStringList &groupNames) { Plasma::Applet *app = applet(); if (!app) { d->configGroup = KConfigGroup(); d->configGroupPath.clear(); return; } d->configGroup = app->config(); d->configGroupPath = groupNames; foreach (const QString &groupName, groupNames) { d->configGroup = KConfigGroup(&d->configGroup, groupName); } d->inWallpaperConfig = !groupNames.isEmpty() && groupNames.first() == QLatin1String("Wallpaper"); } QStringList Applet::currentConfigGroup() const { return d->configGroupPath; } QStringList Applet::configKeys() const { if (d->configGroup.isValid()) { return d->configGroup.keyList(); } return QStringList(); } QStringList Applet::configGroups() const { if (d->configGroup.isValid()) { return d->configGroup.groupList(); } return QStringList(); } QVariant Applet::readConfig(const QString &key, const QJSValue &def) const { if (d->configGroup.isValid()) { return d->configGroup.readEntry(key, def.toVariant()); } else { return QVariant(); } } void Applet::writeConfig(const QString &key, const QJSValue &value) { if (d->configGroup.isValid()) { if (d->inWallpaperConfig) { //hacky, but only way to make the wallpaper react immediately QObject *wallpaperGraphicsObject = applet()->property("wallpaperGraphicsObject").value(); if (wallpaperGraphicsObject) { KDeclarative::ConfigPropertyMap *config = static_cast(wallpaperGraphicsObject->property("configuration").value()); config->setProperty(key.toLatin1(), value.toVariant()); } } else if (applet()->configScheme()) { //check if it can be written in the applets' configScheme KConfigSkeletonItem *item = applet()->configScheme()->findItemByName(key); if (item) { item->setProperty(value.toVariant()); applet()->configScheme()->blockSignals(true); applet()->configScheme()->save(); //why read? read will update KConfigSkeletonItem::mLoadedValue, //allowing a write operation to be performed next time applet()->configScheme()->read(); applet()->configScheme()->blockSignals(false); emit applet()->configScheme()->configChanged(); } } d->configGroup.writeEntry(key, value.toVariant()); d->configDirty = true; } } void Applet::setCurrentGlobalConfigGroup(const QStringList &groupNames) { Plasma::Applet *app = applet(); if (!app) { d->globalConfigGroup = KConfigGroup(); d->globalConfigGroupPath.clear(); return; } d->globalConfigGroup = app->globalConfig(); d->globalConfigGroupPath = groupNames; foreach (const QString &groupName, groupNames) { d->globalConfigGroup = KConfigGroup(&d->globalConfigGroup, groupName); } } QStringList Applet::currentGlobalConfigGroup() const { return d->globalConfigGroupPath; } QStringList Applet::globalConfigKeys() const { if (d->globalConfigGroup.isValid()) { return d->globalConfigGroup.keyList(); } return QStringList(); } QStringList Applet::globalConfigGroups() const { if (d->globalConfigGroup.isValid()) { return d->globalConfigGroup.groupList(); } return QStringList(); } QVariant Applet::readGlobalConfig(const QString &key, const QJSValue &def) const { if (d->globalConfigGroup.isValid()) { return d->globalConfigGroup.readEntry(key, def.toVariant()); } else { return QVariant(); } } void Applet::writeGlobalConfig(const QString &key, const QJSValue &value) { if (d->globalConfigGroup.isValid()) { d->globalConfigGroup.writeEntry(key, value.toVariant()); d->configDirty = true; } } void Applet::reloadConfigIfNeeded() { if (d->configDirty) { reloadConfig(); } } void Applet::reloadConfig() { Plasma::Applet *app = applet(); if (app) { KConfigGroup cg = app->config(); if (!app->isContainment()) { app->restore(cg); } app->configChanged(); if (app->containment() && app->containment()->corona()) { app->containment()->corona()->requestConfigSync(); } d->configDirty = false; } } QString Applet::version() const { Plasma::Applet *app = applet(); if (!app) { return QString(); } return app->pluginInfo().version(); } void Applet::setLocked(bool locked) { Plasma::Applet *app = applet(); if (!app) { return; } app->setImmutability(locked ? Plasma::Types::UserImmutable : Plasma::Types::Mutable); KConfigGroup cg = app->config(); if (!app->isContainment()) { cg = cg.parent(); } if (cg.isValid()) { cg.writeEntry("immutability", (int)app->immutability()); } } bool Applet::locked() const { Plasma::Applet *app = applet(); if (!app) { return Plasma::Types::Mutable; } return app->immutability() != Plasma::Types::Mutable; } Plasma::Applet *Applet::applet() const { return nullptr; } } diff --git a/shell/scripting/applet.h b/shell/scripting/applet.h index 6064e0624..61af3d642 100644 --- a/shell/scripting/applet.h +++ b/shell/scripting/applet.h @@ -1,84 +1,87 @@ /* * Copyright 2010 Aaron Seigo * * This program 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, or * (at your option) any later version. * * This program 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 General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef APPLET #define APPLET #include #include #include #include +#include "scriptengine.h" namespace Plasma { class Applet; } // namespace Plasma +class ScriptEngine; + namespace WorkspaceScripting { class Applet : public QObject { Q_OBJECT Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup) public: - explicit Applet(QObject *parent = nullptr); + explicit Applet(ScriptEngine *parent = nullptr); ~Applet() override; QStringList configKeys() const; QStringList configGroups() const; void setCurrentConfigGroup(const QStringList &groupNames); QStringList currentConfigGroup() const; QStringList globalConfigKeys() const; QStringList globalConfigGroups() const; void setCurrentGlobalConfigGroup(const QStringList &groupNames); QStringList currentGlobalConfigGroup() const; QString version() const; void setLocked(bool locked); bool locked() const; virtual Plasma::Applet *applet() const; protected: void reloadConfigIfNeeded(); public Q_SLOTS: virtual QVariant readConfig(const QString &key, const QJSValue &def = QString()) const; virtual void writeConfig(const QString &key, const QJSValue &value); virtual QVariant readGlobalConfig(const QString &key, const QJSValue &def = QString()) const; virtual void writeGlobalConfig(const QString &key, const QJSValue &value); virtual void reloadConfig(); private: class Private; Private * const d; }; } #endif diff --git a/shell/scripting/scriptengine.cpp b/shell/scripting/scriptengine.cpp index e4c7d9c47..41982c845 100644 --- a/shell/scripting/scriptengine.cpp +++ b/shell/scripting/scriptengine.cpp @@ -1,447 +1,447 @@ /* * Copyright 2009 Aaron Seigo * * This program 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, or * (at your option) any later version. * * This program 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 General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "scriptengine.h" #include "scriptengine_v1.h" #include #include #include #include #include #include #include #include #include #include #include #include #include // KIO //#include // no camelcase include #include #include #include #include #include #include #include "appinterface.h" #include "containment.h" #include "configgroup.h" #include "panel.h" #include "widget.h" #include "../shellcorona.h" #include "../standaloneappcorona.h" #include "../screenpool.h" namespace WorkspaceScripting { ScriptEngine::ScriptEngine(Plasma::Corona *corona, QObject *parent) : QJSEngine(parent), m_corona(corona) { Q_ASSERT(m_corona); m_appInterface = new AppInterface(this); connect(m_appInterface, &AppInterface::print, this, &ScriptEngine::print); m_scriptSelf = globalObject(); m_globalScriptEngineObject = new ScriptEngine::V1(this); m_localizedContext = new KLocalizedContext(this); setupEngine(); } ScriptEngine::~ScriptEngine() { } QString ScriptEngine::errorString() const { return m_errorString; } QJSValue ScriptEngine::wrap(Plasma::Applet *w) { - Widget *wrapper = new Widget(w); + Widget *wrapper = new Widget(w, this); return newQObject(wrapper); } QJSValue ScriptEngine::wrap(Plasma::Containment *c) { Containment *wrapper = isPanel(c) ? new Panel(c, this) : new Containment(c, this); return newQObject(wrapper); } int ScriptEngine::defaultPanelScreen() const { return 1; } QJSValue ScriptEngine::newError(const QString &message) { return evaluate(QString("new Error('%1');").arg(message)); } QString ScriptEngine::onlyExec(const QString &commandLine) { if (commandLine.isEmpty()) { return commandLine; } return KShell::splitArgs(commandLine, KShell::TildeExpand).first(); } void ScriptEngine::setupEngine() { QJSValue globalScriptEngineObject = newQObject(m_globalScriptEngineObject); QJSValue localizedContext = newQObject(m_localizedContext); QJSValue appInterface = newQObject(m_appInterface); //AppInterface stuff //FIXME: this line doesn't have much effect for now, if QTBUG-68397 gets fixed, //all the connects to rewrite the properties won't be necessary anymore //globalObject().setPrototype(appInterface); //FIXME: remove __AppInterface if QTBUG-68397 gets solved //as workaround we build manually a js object with getters and setters m_scriptSelf.setProperty(QStringLiteral("__AppInterface"), appInterface); QJSValue res = evaluate("__proto__ = {\ get locked() {return __AppInterface.locked;},\ get hasBattery() {return __AppInterface.hasBattery;},\ get screenCount() {return __AppInterface.screenCount;},\ get activityIds() {return __AppInterface.activityIds;},\ get panelIds() {return __AppInterface.panelIds;},\ get knownPanelTypes() {return __AppInterface.knownPanelTypes;},\ get knownActivityTypes() {return __AppInterface.knownActivityTypes;},\ get knownWidgetTypes() {return __AppInterface.knownWidgetTypes;},\ get theme() {return __AppInterface.theme;},\ set theme(name) {__AppInterface.theme = name;},\ get applicationVersion() {return __AppInterface.applicationVersion;},\ get platformVersion() {return __AppInterface.platformVersion;},\ get scriptingVersion() {return __AppInterface.scriptingVersion;},\ get multihead() {return __AppInterface.multihead;},\ get multiheadScreen() {return __AppInterface.multihead;},\ get locale() {return __AppInterface.locale;},\ get language() {return __AppInterface.language;},\ get languageId() {return __AppInterface.languageId;},\ }"); Q_ASSERT(!res.isError()); //methods from AppInterface m_scriptSelf.setProperty(QStringLiteral("screenGeometry"), appInterface.property("screenGeometry")); m_scriptSelf.setProperty(QStringLiteral("lockCorona"), appInterface.property("lockCorona")); m_scriptSelf.setProperty(QStringLiteral("sleep"), appInterface.property("sleep")); m_scriptSelf.setProperty(QStringLiteral("print"), appInterface.property("print")); m_scriptSelf.setProperty(QStringLiteral("getApiVersion"), globalScriptEngineObject.property("getApiVersion")); //Constructors: prefer them js based as they make the c++ code of panel et al way simpler without hacks to get the engine m_scriptSelf.setProperty(QStringLiteral("__newPanel"), globalScriptEngineObject.property("newPanel")); m_scriptSelf.setProperty(QStringLiteral("__newConfigFile"), globalScriptEngineObject.property("configFile")); //definitions of qrectf properties from documentation //only properties/functions which were already binded are. //TODO KF6: just a plain QRectF binding res = evaluate("function QRectF(x,y,w,h) {\ return {x: x, y: y, width: w, height: h,\ get left() {return this.x},\ get top() {return this.y},\ get right() {return this.x + this.width},\ get bottom() {return this.y + this.height},\ get empty() {return this.width <= 0 || this.height <= 0},\ get null() {return this.width == 0 || this.height == 0},\ get valid() {return !this.empty},\ adjust: function(dx1, dy1, dx2, dy2) {\ this.x += dx1; this.y += dy1;\ this.width = this.width - dx1 + dx2;\ this.height = this.height - dy1 + dy2;},\ adjusted: function(dx1, dy1, dx2, dy2) {\ return new QRectF(this.x + dx1, this.y + dy1,\ this.width - dx1 + dx2,\ this.height - dy1 + dy2)},\ translate: function(dx, dy) {this.x += dx; this.y += dy;},\ setCoords: function(x1, y1, x2, y2) {\ this.x = x1; this.y = y1;\ this.width = x2 - x1;\ this.height = y2 - y1;},\ setRect: function(x1, y1, w1, h1) {\ this.x = x1; this.y = y1;\ this.width = w1; this.height = h1;},\ contains: function(x1, y1) { return x1 >= this.x && x1 <= this.x + this.width && y1 >= this.y && y1 <= this.y + this.height},\ moveBottom: function(bottom1) {this.y = bottom1 - this.height;},\ moveLeft: function(left1) {this.x = left1;},\ moveRight: function(right1) {this.x = right1 - this.width;},\ moveTop: function(top1) {this.y = top1;},\ moveTo: function(x1, y1) {this.x = x1; this.y = y1;}\ }};\ function ConfigFile(config, group){return __newConfigFile(config, group)};\ function Panel(plugin){return __newPanel(plugin)};"); Q_ASSERT(!res.isError()); m_scriptSelf.setProperty(QStringLiteral("createActivity"), globalScriptEngineObject.property("createActivity")); m_scriptSelf.setProperty(QStringLiteral("setCurrentActivity"), globalScriptEngineObject.property("setCurrentActivity")); m_scriptSelf.setProperty(QStringLiteral("currentActivity"), globalScriptEngineObject.property("currentActivity")); m_scriptSelf.setProperty(QStringLiteral("activities"), globalScriptEngineObject.property("activities")); m_scriptSelf.setProperty(QStringLiteral("activityName"), globalScriptEngineObject.property("activityName")); m_scriptSelf.setProperty(QStringLiteral("setActivityName"), globalScriptEngineObject.property("setActivityName")); m_scriptSelf.setProperty(QStringLiteral("loadSerializedLayout"), globalScriptEngineObject.property("loadSerializedLayout")); m_scriptSelf.setProperty(QStringLiteral("desktopsForActivity"), globalScriptEngineObject.property("desktopsForActivity")); m_scriptSelf.setProperty(QStringLiteral("desktops"), globalScriptEngineObject.property("desktops")); m_scriptSelf.setProperty(QStringLiteral("desktopById"), globalScriptEngineObject.property("desktopById")); m_scriptSelf.setProperty(QStringLiteral("desktopForScreen"), globalScriptEngineObject.property("desktopForScreen")); m_scriptSelf.setProperty(QStringLiteral("panelById"), globalScriptEngineObject.property("panelById")); m_scriptSelf.setProperty(QStringLiteral("panels"), globalScriptEngineObject.property("panels")); m_scriptSelf.setProperty(QStringLiteral("fileExists"), globalScriptEngineObject.property("fileExists")); m_scriptSelf.setProperty(QStringLiteral("loadTemplate"), globalScriptEngineObject.property("loadTemplate")); m_scriptSelf.setProperty(QStringLiteral("applicationExists"), globalScriptEngineObject.property("applicationExists")); m_scriptSelf.setProperty(QStringLiteral("defaultApplication"), globalScriptEngineObject.property("defaultApplication")); m_scriptSelf.setProperty(QStringLiteral("userDataPath"), globalScriptEngineObject.property("userDataPath")); m_scriptSelf.setProperty(QStringLiteral("applicationPath"), globalScriptEngineObject.property("applicationPath")); m_scriptSelf.setProperty(QStringLiteral("knownWallpaperPlugins"), globalScriptEngineObject.property("knownWallpaperPlugins")); m_scriptSelf.setProperty(QStringLiteral("gridUnit"), globalScriptEngineObject.property("gridUnit")); m_scriptSelf.setProperty(QStringLiteral("setImmutability"), globalScriptEngineObject.property("setImmutability")); m_scriptSelf.setProperty(QStringLiteral("immutability"), globalScriptEngineObject.property("immutability")); //i18n m_scriptSelf.setProperty(QStringLiteral("i18n"), localizedContext.property("i18n")); m_scriptSelf.setProperty(QStringLiteral("i18nc"), localizedContext.property("i18nc")); m_scriptSelf.setProperty(QStringLiteral("i18np"), localizedContext.property("i18np")); m_scriptSelf.setProperty(QStringLiteral("i18ncp"), localizedContext.property("i18ncp")); m_scriptSelf.setProperty(QStringLiteral("i18nd"), localizedContext.property("i18nd")); m_scriptSelf.setProperty(QStringLiteral("i18ndc"), localizedContext.property("i18ndc")); m_scriptSelf.setProperty(QStringLiteral("i18ndp"), localizedContext.property("i18ndp")); m_scriptSelf.setProperty(QStringLiteral("i18ndcp"), localizedContext.property("i18ndcp")); m_scriptSelf.setProperty(QStringLiteral("xi18n"), localizedContext.property("xi18n")); m_scriptSelf.setProperty(QStringLiteral("xi18nc"), localizedContext.property("xi18nc")); m_scriptSelf.setProperty(QStringLiteral("xi18np"), localizedContext.property("xi18np")); m_scriptSelf.setProperty(QStringLiteral("xi18ncp"), localizedContext.property("xi18ncp")); m_scriptSelf.setProperty(QStringLiteral("xi18nd"), localizedContext.property("xi18nd")); m_scriptSelf.setProperty(QStringLiteral("xi18ndc"), localizedContext.property("xi18ndc")); m_scriptSelf.setProperty(QStringLiteral("xi18ndp"), localizedContext.property("xi18ndp")); m_scriptSelf.setProperty(QStringLiteral("xi18ndcp"), localizedContext.property("xi18ndcp")); } bool ScriptEngine::isPanel(const Plasma::Containment *c) { if (!c) { return false; } return c->containmentType() == Plasma::Types::PanelContainment || c->containmentType() == Plasma::Types::CustomPanelContainment; } Plasma::Corona *ScriptEngine::corona() const { return m_corona; } bool ScriptEngine::evaluateScript(const QString &script, const QString &path) { m_errorString = QString(); QJSValue result = evaluate(script, path); if (result.isError()) { //qDebug() << "catch the exception!"; QString error = i18n("Error: %1 at line %2\n\nBacktrace:\n%3", result.toString(), result.property("lineNumber").toInt(), result.property("stack").toVariant().value().join(QLatin1String("\n "))); emit printError(error); emit exception(result); m_errorString = error; return false; } return true; } void ScriptEngine::exception(const QJSValue &value) { //qDebug() << "exception caught!" << value.toVariant(); emit printError(value.toVariant().toString()); } QStringList ScriptEngine::pendingUpdateScripts(Plasma::Corona *corona) { if (!corona->package().metadata().isValid()) { qWarning() << "Warning: corona package invalid"; return QStringList(); } const QString appName = corona->package().metadata().pluginName(); QStringList scripts; const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "plasma/shells/" + appName + QStringLiteral("/contents/updates"), QStandardPaths::LocateDirectory); for (const QString& dir : dirs) { QDirIterator it(dir, QStringList() << QStringLiteral("*.js")); while (it.hasNext()) { scripts.append(it.next()); } } QStringList scriptPaths; if (scripts.isEmpty()) { //qDebug() << "no update scripts"; return scriptPaths; } KConfigGroup cg(KSharedConfig::openConfig(), "Updates"); QStringList performed = cg.readEntry("performed", QStringList()); const QString localXdgDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); foreach (const QString &script, scripts) { if (performed.contains(script)) { continue; } if (script.startsWith(localXdgDir)) { // qDebug() << "skipping user local script: " << script; continue; } scriptPaths.append(script); performed.append(script); } cg.writeEntry("performed", performed); KSharedConfig::openConfig()->sync(); return scriptPaths; } QStringList ScriptEngine::availableActivities() const { ShellCorona *sc = qobject_cast(m_corona); StandaloneAppCorona *ac = qobject_cast(m_corona); if (sc) { return sc->availableActivities(); } else if (ac) { return ac->availableActivities(); } return QStringList(); } QList ScriptEngine::desktopsForActivity(const QString &id) { QList result; // confirm this activity actually exists bool found = false; for (const QString &act: availableActivities()) { if (act == id) { found = true; break; } } if (!found) { return result; } foreach (Plasma::Containment *c, m_corona->containments()) { if (c->activity() == id && !isPanel(c)) { result << new Containment(c, this); } } if (result.count() == 0) { // we have no desktops for this activity, so lets make them now // this can happen when the activity already exists but has never been activated // with the current shell package and layout.js is run to set up the shell for the // first time ShellCorona *sc = qobject_cast(m_corona); StandaloneAppCorona *ac = qobject_cast(m_corona); if (sc) { foreach (int i, sc->screenIds()) { result << new Containment(sc->createContainmentForActivity(id, i), this); } } else if (ac) { const int numScreens = m_corona->numScreens(); for (int i = 0; i < numScreens; ++i) { result << new Containment(ac->createContainmentForActivity(id, i), this); } } } return result; } Plasma::Containment *ScriptEngine::createContainment(const QString &type, const QString &plugin) { bool exists = false; const KPluginInfo::List list = Plasma::PluginLoader::listContainmentsOfType(type); foreach (const KPluginInfo &info, list) { if (info.pluginName() == plugin) { exists = true; break; } } if (!exists) { return nullptr; } Plasma::Containment *c = nullptr; if (type == QLatin1String("Panel")) { ShellCorona *sc = qobject_cast(m_corona); StandaloneAppCorona *ac = qobject_cast(m_corona); if (sc) { c = sc->addPanel(plugin); } else if (ac) { c = ac->addPanel(plugin); } } else { c = m_corona->createContainment(plugin); } if (c) { if (type == QLatin1String("Panel")) { // some defaults c->setFormFactor(Plasma::Types::Horizontal); c->setLocation(Plasma::Types::TopEdge); //we have to force lastScreen of the newly created containment, //or it won't have a screen yet at that point, breaking JS code //that relies on it //NOTE: if we'll allow setting a panel screen from JS, it will have to use the following lines as well KConfigGroup cg=c->config(); cg.writeEntry(QStringLiteral("lastScreen"), 0); c->restore(cg); } c->updateConstraints(Plasma::Types::AllConstraints | Plasma::Types::StartupCompletedConstraint); c->flushPendingConstraintsEvents(); } return c; } Containment *ScriptEngine::createContainmentWrapper(const QString &type, const QString &plugin) { Plasma::Containment *c = createContainment(type, plugin); return isPanel(c) ? new Panel(c, this) : new Containment(c, this); } } // namespace WorkspaceScripting diff --git a/shell/scripting/widget.cpp b/shell/scripting/widget.cpp index daf02d24f..e4a59a65a 100644 --- a/shell/scripting/widget.cpp +++ b/shell/scripting/widget.cpp @@ -1,199 +1,218 @@ /* * Copyright 2009 Aaron Seigo * * This program 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, or * (at your option) any later version. * * This program 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 General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "widget.h" #include #include +#include + #include #include #include +#include "scriptengine.h" + namespace WorkspaceScripting { class Widget::Private { public: Private() { } + QPointer engine; QPointer applet; }; -Widget::Widget(Plasma::Applet *applet, QObject *parent) +Widget::Widget(Plasma::Applet *applet, ScriptEngine *parent) : Applet(parent), d(new Widget::Private) { + d->engine = parent; d->applet = applet; setCurrentConfigGroup(QStringList()); setCurrentGlobalConfigGroup(QStringList()); } Widget::~Widget() { reloadConfigIfNeeded(); delete d; } uint Widget::id() const { if (d->applet) { return d->applet.data()->id(); } return 0; } QString Widget::type() const { if (d->applet) { return d->applet.data()->pluginMetaData().pluginId(); } return QString(); } void Widget::remove() { if (d->applet) { d->applet.data()->destroy(); d->applet.clear(); } } void Widget::setGlobalShortcut(const QString &shortcut) { if (d->applet) { d->applet.data()->setGlobalShortcut(QKeySequence(shortcut)); } } QString Widget::globalShorcut() const { if (d->applet) { return d->applet.data()->globalShortcut().toString(); } return QString(); } Plasma::Applet *Widget::applet() const { return d->applet.data(); } int Widget::index() const { if (!d->applet) { return -1; } Plasma::Applet *applet = d->applet.data(); Plasma::Containment *c = applet->containment(); if (!c) { return -1; } /*QGraphicsLayout *layout = c->layout(); if (!layout) { return - 1; } for (int i = 0; i < layout->count(); ++i) { if (layout->itemAt(i) == applet) { return i; } }*/ return -1; } void Widget::setIndex(int index) { Q_UNUSED(index) /* if (!d->applet) { return; } Plasma::Applet *applet = d->applet.data(); Plasma::Containment *c = applet->containment(); if (!c) { return; } //FIXME: this is hackish. would be nice to define this for gridlayouts too QGraphicsLinearLayout *layout = dynamic_cast(c->layout()); if (!layout) { return; } layout->insertItem(index, applet);*/ } QJSValue Widget::geometry() const { - /*if (d->applet) { - return d->applet.data()->geometry(); + if (!d->applet) { + return QJSValue(); } -*/ - return QJSValue(); + + QQuickItem *appletItem = d->applet->property("_plasma_graphicObject").value(); + + if (!appletItem) { + return QJSValue(); + } + + QRectF geom(appletItem->x(), appletItem->y(), appletItem->width(), appletItem->height()); + geom = appletItem->mapRectToScene(geom); + QJSValue val = d->engine->newObject(); + val.setProperty(QStringLiteral("x"), geom.x()); + val.setProperty(QStringLiteral("y"), geom.y()); + val.setProperty(QStringLiteral("width"), geom.width()); + val.setProperty(QStringLiteral("height"), geom.height()); + return val; } void Widget::setGeometry(const QJSValue &geometry) { Q_UNUSED(geometry) /*if (d->applet) { d->applet.data()->setGeometry(geometry); KConfigGroup cg = d->applet.data()->config().parent(); if (cg.isValid()) { cg.writeEntry("geometry", geometry); } }*/ } void Widget::showConfigurationInterface() { /* if (d->applet) { d->applet.data()->showConfigurationInterface(); }*/ } QString Widget::userBackgroundHints() const { QMetaEnum hintEnum = QMetaEnum::fromType(); return hintEnum.valueToKey(applet()->userBackgroundHints()); } void Widget::setUserBackgroundHints(QString hint) { QMetaEnum hintEnum = QMetaEnum::fromType(); bool ok; int value = hintEnum.keyToValue(hint.toUtf8().constData(), &ok); if (ok) { applet()->setUserBackgroundHints(Plasma::Types::BackgroundHints(value)); } } } diff --git a/shell/scripting/widget.h b/shell/scripting/widget.h index d1401d9d0..7d49b8e38 100644 --- a/shell/scripting/widget.h +++ b/shell/scripting/widget.h @@ -1,87 +1,89 @@ /* * Copyright 2009 Aaron Seigo * * This program 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, or * (at your option) any later version. * * This program 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 General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef WIDGET #define WIDGET #include #include #include "applet.h" namespace Plasma { class Applet; } // namespace Plasma +class ScriptEngine; + namespace WorkspaceScripting { class Widget : public Applet { Q_OBJECT Q_PROPERTY(QString type READ type) Q_PROPERTY(QString version READ version) Q_PROPERTY(int id READ id) Q_PROPERTY(QStringList configKeys READ configKeys) Q_PROPERTY(QStringList configGroups READ configGroups) Q_PROPERTY(QStringList globalConfigKeys READ globalConfigKeys) Q_PROPERTY(QStringList globalConfigGroups READ globalConfigGroups) Q_PROPERTY(int index WRITE setIndex READ index) //We pass our js based QRect wrapper instead of a simple QRectF Q_PROPERTY(QJSValue geometry WRITE setGeometry READ geometry) Q_PROPERTY(QStringList currentConfigGroup WRITE setCurrentConfigGroup READ currentConfigGroup) Q_PROPERTY(QString globalShortcut WRITE setGlobalShortcut READ globalShorcut) Q_PROPERTY(bool locked READ locked WRITE setLocked) Q_PROPERTY(QString userBackgroundHints WRITE setUserBackgroundHints READ userBackgroundHints) public: - explicit Widget(Plasma::Applet *applet, QObject *parent = nullptr); + explicit Widget(Plasma::Applet *applet, ScriptEngine *parent = nullptr); ~Widget() override; uint id() const; QString type() const; int index() const; void setIndex(int index); QJSValue geometry() const; void setGeometry(const QJSValue &geometry); void setGlobalShortcut(const QString &shortcut); QString globalShorcut() const; QString userBackgroundHints() const; void setUserBackgroundHints(QString hint); Plasma::Applet *applet() const override; public Q_SLOTS: void remove(); void showConfigurationInterface(); private: class Private; Private * const d; }; } #endif