Changeset View
Changeset View
Standalone View
Standalone View
applets/systemmonitor/common/contents/ui/ConfigGeneral.qml
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 42 | } else { | |||
---|---|---|---|---|---|
43 | for (var i in mainColumn.children) { | 43 | for (var i in mainColumn.children) { | ||
44 | var child = mainColumn.children[i]; | 44 | var child = mainColumn.children[i]; | ||
45 | if (child.checked !== undefined) { | 45 | if (child.checked !== undefined) { | ||
46 | child.checked = cfg_sources.indexOf(child.source) !== -1; | 46 | child.checked = cfg_sources.indexOf(child.source) !== -1; | ||
47 | } | 47 | } | ||
48 | } | 48 | } | ||
49 | } | 49 | } | ||
50 | } | 50 | } | ||
51 | property int cfg_updateInterval | ||||
51 | 52 | | |||
52 | signal sourceAdded(string source) | 53 | signal sourceAdded(string source) | ||
53 | 54 | | |||
54 | function addSource(source, friendlyName) { | 55 | function addSource(source, friendlyName) { | ||
55 | var found = false; | 56 | var found = false; | ||
56 | for (var i = 0; i < sourcesModel.count; ++i) { | 57 | for (var i = 0; i < sourcesModel.count; ++i) { | ||
57 | var obj = sourcesModel.get(i); | 58 | var obj = sourcesModel.get(i); | ||
58 | if (obj.source == source) { | 59 | if (obj.source == source) { | ||
Show All 38 Lines | |||||
97 | ListModel { | 98 | ListModel { | ||
98 | id: sourcesModel | 99 | id: sourcesModel | ||
99 | } | 100 | } | ||
100 | 101 | | |||
101 | Layouts.ColumnLayout { | 102 | Layouts.ColumnLayout { | ||
102 | id: mainColumn | 103 | id: mainColumn | ||
103 | anchors.left: parent.left | 104 | anchors.left: parent.left | ||
104 | 105 | | |||
106 | Layouts.RowLayout { | ||||
107 | Controls.Label { | ||||
108 | text: i18n("Update Interval:") | ||||
109 | } | ||||
110 | | ||||
111 | Controls.SpinBox { | ||||
112 | id: updateIntervalSpinBox | ||||
113 | decimals: 2 | ||||
114 | suffix: i18nc("Suffix for spinbox (seconds)", " sec") | ||||
115 | maximumValue: 1000 | ||||
cfeck: Maybe it should also specify a minimum value, e.g. 0.05 sec. for 20 updates per second. | |||||
I just did what ksysguard does where a 0 interval pauses updating, for whatever reason this may be useful.. broulik: I just did what ksysguard does where a 0 interval pauses updating, for whatever reason this may… | |||||
116 | stepSize: 0.5 | ||||
117 | onValueChanged: cfg_updateInterval = value * 1000 | ||||
118 | Component.onCompleted: value = cfg_updateInterval / 1000 | ||||
119 | } | ||||
120 | } | ||||
121 | | ||||
105 | Repeater { | 122 | Repeater { | ||
106 | id: repeater | 123 | id: repeater | ||
107 | model: sourcesModel | 124 | model: sourcesModel | ||
108 | Controls.CheckBox { | 125 | Controls.CheckBox { | ||
109 | id: checkBox | 126 | id: checkBox | ||
110 | text: model.friendlyName | 127 | text: model.friendlyName | ||
111 | property string source: model.source | 128 | property string source: model.source | ||
112 | onCheckedChanged: { | 129 | onCheckedChanged: { | ||
Show All 16 Lines |
Maybe it should also specify a minimum value, e.g. 0.05 sec. for 20 updates per second.