diff --git a/applets/systemmonitor/common/contents/ui/Applet.qml b/applets/systemmonitor/common/contents/ui/Applet.qml --- a/applets/systemmonitor/common/contents/ui/Applet.qml +++ b/applets/systemmonitor/common/contents/ui/Applet.qml @@ -66,6 +66,18 @@ "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 } @@ -82,11 +94,9 @@ engine: "systemmonitor" interval: plasmoid.configuration.updateInterval onSourceAdded: { - if (plasmoid.configuration.sources && plasmoid.configuration.sources.length > 0 && - plasmoid.configuration.sources.indexOf(encodeURIComponent(source)) === -1) { - return; + if (showSource(source)) { + rootItem.sourceAdded(source); } - rootItem.sourceAdded(source); } onSourceRemoved: { for (var i = sourcesModel.count - 1; i >= 0; --i) { diff --git a/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml b/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml --- a/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml +++ b/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml @@ -40,7 +40,7 @@ for (var i in dataSourcesColumn.children) { var child = dataSourcesColumn.children[i]; if (child.checked !== undefined) { - child.checked = true; + child.checked = sourceDefaultEnable(child.source); } } } else { @@ -53,6 +53,10 @@ } } + function sourceDefaultEnable(source) { + return true; + } + onCfg_sourcesChanged: { sourcesChanged(); } diff --git a/applets/systemmonitor/cpu/contents/ui/cpu.qml b/applets/systemmonitor/cpu/contents/ui/cpu.qml --- a/applets/systemmonitor/cpu/contents/ui/cpu.qml +++ b/applets/systemmonitor/cpu/contents/ui/cpu.qml @@ -35,6 +35,10 @@ } } + function sourceDefaultEnable(source) { + return source.match(/^cpu(\/|%2F)system(\/|%2F)TotalLoad/); + } + delegate: SinglePlotter { autoRange: false rangeMin: 0 diff --git a/applets/systemmonitor/cpu/contents/ui/cpuConfig.qml b/applets/systemmonitor/cpu/contents/ui/cpuConfig.qml --- a/applets/systemmonitor/cpu/contents/ui/cpuConfig.qml +++ b/applets/systemmonitor/cpu/contents/ui/cpuConfig.qml @@ -34,4 +34,8 @@ root.addSource(source, match[1]); } } + + function sourceDefaultEnable(source) { + return source.match(/^cpu(\/|%2F)system(\/|%2F)TotalLoad/); + } }