Commit 2e129f84 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[System Monitor Applet] Add setting for update interval

BUG: 353063
FIXED-IN: 5.13.0

Differential Revision: https://phabricator.kde.org/D6864
parent b9f9581f
......@@ -9,6 +9,10 @@
<entry name="sources" type="StringList">
<label>Which "systemmonitor" dataengine sources this applet will take data from.</label>
</entry>
<entry name="updateInterval" type="Int">
<label>The interval in milliseconds to update the data shown.</label>
<default>2000</default>
</entry>
</group>
</kcfg>
......@@ -81,7 +81,7 @@ Item {
id: smSource
engine: "systemmonitor"
interval: 2000
interval: plasmoid.configuration.updateInterval
onSourceAdded: {
if (plasmoid.configuration.sources.length > 0 &&
plasmoid.configuration.sources.indexOf(encodeURIComponent(source)) === -1) {
......
......@@ -48,6 +48,7 @@ Item {
}
}
}
property int cfg_updateInterval
signal sourceAdded(string source)
......@@ -102,6 +103,22 @@ Item {
id: mainColumn
anchors.left: parent.left
Layouts.RowLayout {
Controls.Label {
text: i18n("Update Interval:")
}
Controls.SpinBox {
id: updateIntervalSpinBox
decimals: 2
suffix: i18nc("Suffix for spinbox (seconds)", " sec")
maximumValue: 1000
stepSize: 0.5
onValueChanged: cfg_updateInterval = value * 1000
Component.onCompleted: value = cfg_updateInterval / 1000
}
}
Repeater {
id: repeater
model: sourcesModel
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment