Changeset View
Changeset View
Standalone View
Standalone View
applets/systemloadviewer/package/contents/ui/SystemLoadViewer.qml
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 41 | property var cpuColors: setColorsManually ? [plasmoid.configuration.cpuSysColor, | |||
---|---|---|---|---|---|
43 | plasmoid.configuration.cpuNiceColor, | 43 | plasmoid.configuration.cpuNiceColor, | ||
44 | plasmoid.configuration.cpuIOWaitColor] | 44 | plasmoid.configuration.cpuIOWaitColor] | ||
45 | : [theme.buttonFocusColor, | 45 | : [theme.buttonFocusColor, | ||
46 | theme.highlightColor, | 46 | theme.highlightColor, | ||
47 | theme.visitedLinkColor, | 47 | theme.visitedLinkColor, | ||
48 | theme.linkColor] | 48 | theme.linkColor] | ||
49 | 49 | | |||
50 | property var memoryColors: setColorsManually ? [plasmoid.configuration.memApplicationColor, | 50 | property var memoryColors: setColorsManually ? [plasmoid.configuration.memApplicationColor, | ||
51 | plasmoid.configuration.memBuffersColor, | 51 | plasmoid.configuration.memBuffersColor] | ||
52 | plasmoid.configuration.memCachedColor] | | |||
53 | : [theme.buttonFocusColor, | 52 | : [theme.buttonFocusColor, | ||
54 | theme.visitedLinkColor, | 53 | theme.visitedLinkColor] | ||
55 | theme.highlightColor] | | |||
56 | 54 | | |||
57 | property var swapColors: setColorsManually ? [plasmoid.configuration.swapUsedColor] | 55 | property var swapColors: setColorsManually ? [plasmoid.configuration.swapUsedColor] | ||
58 | : [theme.highlightColor] | 56 | : [theme.highlightColor] | ||
59 | 57 | | |||
60 | property var cacheColors: setColorsManually ? [plasmoid.configuration.cacheDirtyColor, | 58 | property var cacheColors: setColorsManually ? [plasmoid.configuration.cacheDirtyColor, | ||
61 | plasmoid.configuration.cacheWritebackColor] | 59 | plasmoid.configuration.cacheWritebackColor] | ||
62 | : [theme.buttonFocusColor, | 60 | : [theme.buttonFocusColor, | ||
63 | theme.visitedLinkColor] | 61 | theme.visitedLinkColor] | ||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 125 | PlasmaCore.DataSource { | |||
134 | property string sysLoad: cpuSystem + "sys" | 132 | property string sysLoad: cpuSystem + "sys" | ||
135 | property string ioWait: cpuSystem + "wait" | 133 | property string ioWait: cpuSystem + "wait" | ||
136 | property string averageClock: cpuSystem + "AverageClock" | 134 | property string averageClock: cpuSystem + "AverageClock" | ||
137 | property string totalLoad: cpuSystem + "TotalLoad" | 135 | property string totalLoad: cpuSystem + "TotalLoad" | ||
138 | property string memPhysical: "mem/physical/" | 136 | property string memPhysical: "mem/physical/" | ||
139 | property string memFree: memPhysical + "free" | 137 | property string memFree: memPhysical + "free" | ||
140 | property string memApplication: memPhysical + "application" | 138 | property string memApplication: memPhysical + "application" | ||
141 | property string memBuffers: memPhysical + "buf" | 139 | property string memBuffers: memPhysical + "buf" | ||
142 | property string memCached: memPhysical + "cached" | | |||
143 | property string memUsed: memPhysical + "used" | 140 | property string memUsed: memPhysical + "used" | ||
144 | property string swap: "mem/swap/" | 141 | property string swap: "mem/swap/" | ||
145 | property string swapUsed: swap + "used" | 142 | property string swapUsed: swap + "used" | ||
146 | property string swapFree: swap + "free" | 143 | property string swapFree: swap + "free" | ||
147 | property string cache: "mem/cache/" | 144 | property string cache: "mem/cache/" | ||
148 | property string cacheDirty: cache + "dirty" | 145 | property string cacheDirty: cache + "dirty" | ||
149 | property string cacheWriteback: cache + "writeback" | 146 | property string cacheWriteback: cache + "writeback" | ||
150 | property string cores: "system/cores" | 147 | property string cores: "system/cores" | ||
151 | 148 | | |||
152 | property var totalCpuLoadProportions: [.0, .0, .0, .0] | 149 | property var totalCpuLoadProportions: [.0, .0, .0, .0] | ||
153 | property int maxCpuIndex: 0 | 150 | property int maxCpuIndex: 0 | ||
154 | property var memoryUsageProportions: [.0, .0, .0] | 151 | property var memoryUsageProportions: [.0, .0] | ||
155 | property double swapUsageProportion: .0 | 152 | property double swapUsageProportion: .0 | ||
156 | property var cacheUsageProportions: [.0, .0] | 153 | property var cacheUsageProportions: [.0, .0] | ||
157 | 154 | | |||
158 | property double maxCache: 0.0 | 155 | property double maxCache: 0.0 | ||
159 | 156 | | |||
160 | connectedSources: [ cores ] | 157 | connectedSources: [ cores ] | ||
161 | 158 | | |||
162 | function sources() { | 159 | function sources() { | ||
163 | var array = [niceLoad, userLoad, sysLoad, | 160 | var array = [niceLoad, userLoad, sysLoad, | ||
164 | ioWait, memFree, memApplication, memBuffers, | 161 | ioWait, memFree, memApplication, memBuffers, | ||
165 | memCached, memUsed, swapUsed, swapFree, | 162 | memUsed, swapUsed, swapFree, | ||
166 | averageClock, totalLoad, cores, cacheDirty, | 163 | averageClock, totalLoad, cores, cacheDirty, | ||
167 | cacheWriteback] | 164 | cacheWriteback] | ||
168 | 165 | | |||
169 | if (plasmoid.configuration.cpuAllActivated) { | 166 | if (plasmoid.configuration.cpuAllActivated) { | ||
170 | for (var i = 0; i <= maxCpuIndex; i++) { | 167 | for (var i = 0; i <= maxCpuIndex; i++) { | ||
171 | array.push("cpu/cpu" + i + "/TotalLoad"); | 168 | array.push("cpu/cpu" + i + "/TotalLoad"); | ||
172 | array.push("cpu/cpu" + i + "/clock"); | 169 | array.push("cpu/cpu" + i + "/clock"); | ||
173 | array.push("cpu/cpu" + i + "/nice"); | 170 | array.push("cpu/cpu" + i + "/nice"); | ||
Show All 20 Lines | 189 | else if (sourceName == ioWait) { | |||
194 | totalCpuLoadProportionsChanged() | 191 | totalCpuLoadProportionsChanged() | ||
195 | } | 192 | } | ||
196 | else if (sourceName == memApplication) { | 193 | else if (sourceName == memApplication) { | ||
197 | memoryUsageProportions[0] = fitMemoryUsage(data.value) | 194 | memoryUsageProportions[0] = fitMemoryUsage(data.value) | ||
198 | } | 195 | } | ||
199 | else if (sourceName == memBuffers) { | 196 | else if (sourceName == memBuffers) { | ||
200 | memoryUsageProportions[1] = fitMemoryUsage(data.value) | 197 | memoryUsageProportions[1] = fitMemoryUsage(data.value) | ||
201 | } | 198 | } | ||
202 | else if (sourceName == memCached) { | | |||
203 | memoryUsageProportions[2] = fitMemoryUsage(data.value) | | |||
204 | memoryUsageProportionsChanged() | | |||
205 | } | | |||
206 | else if (sourceName == swapUsed) { | 199 | else if (sourceName == swapUsed) { | ||
207 | swapUsageProportion = fitSwapUsage(data.value) | 200 | swapUsageProportion = fitSwapUsage(data.value) | ||
208 | swapUsageProportionChanged() | 201 | swapUsageProportionChanged() | ||
209 | } | 202 | } | ||
210 | else if (sourceName == cacheWriteback) { | 203 | else if (sourceName == cacheWriteback) { | ||
211 | cacheUsageProportions = fitCacheUsage() | 204 | cacheUsageProportions = fitCacheUsage() | ||
212 | cacheUsageProportionsChanged() | 205 | cacheUsageProportionsChanged() | ||
213 | } | 206 | } | ||
▲ Show 20 Lines • Show All 341 Lines • Show Last 20 Lines |