mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-16 07:09:58 +00:00
refactor: remoove unsued code annd settings
This commit is contained in:
@ -44,9 +44,6 @@
|
||||
<entry name="interval" type="Int">
|
||||
<default>1000</default>
|
||||
</entry>
|
||||
<entry name="queueLimit" type="Int">
|
||||
<default>0</default>
|
||||
</entry>
|
||||
<entry name="tempUnits" type="String">
|
||||
<default>Celsius</default>
|
||||
</entry>
|
||||
@ -62,15 +59,9 @@
|
||||
<entry name="acOffline" type="String">
|
||||
<default>( )</default>
|
||||
</entry>
|
||||
<entry name="telemetryCount" type="Int">
|
||||
<entry name="historyCount" type="Int">
|
||||
<default>100</default>
|
||||
</entry>
|
||||
<entry name="telemetryRemote" type="Bool">
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="telemetryId" type="String">
|
||||
<default></default>
|
||||
</entry>
|
||||
</group>
|
||||
|
||||
<group name="Tooltip">
|
||||
|
@ -41,15 +41,12 @@ KCM.SimpleKCM {
|
||||
property alias cfg_height: widgetHeight.value
|
||||
property alias cfg_width: widgetWidth.value
|
||||
property alias cfg_interval: update.value
|
||||
property alias cfg_queueLimit: queueLimit.value
|
||||
property string cfg_tempUnits: tempUnits.value
|
||||
property alias cfg_customTime: customTime.value
|
||||
property alias cfg_customUptime: customUptime.value
|
||||
property alias cfg_acOnline: acOnline.value
|
||||
property alias cfg_acOffline: acOffline.value
|
||||
property alias cfg_telemetryCount: telemetryCount.value
|
||||
property alias cfg_telemetryRemote: telemetryRemote.checked
|
||||
property alias cfg_telemetryId: telemetryId.value
|
||||
property alias cfg_historyCount: historyCount.value
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
@ -116,15 +113,6 @@ KCM.SimpleKCM {
|
||||
value: plasmoid.configuration.interval
|
||||
}
|
||||
|
||||
IntegerSelector {
|
||||
id: queueLimit
|
||||
maximumValue: 99
|
||||
minimumValue: 0
|
||||
stepSize: 1
|
||||
text: i18n("Messages queue limit")
|
||||
value: plasmoid.configuration.queueLimit
|
||||
}
|
||||
|
||||
ComboBoxSelector {
|
||||
id: tempUnits
|
||||
model: [
|
||||
@ -226,30 +214,19 @@ KCM.SimpleKCM {
|
||||
GroupBox {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
title: i18n("Telemetry")
|
||||
title: i18n("History")
|
||||
|
||||
Column {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
|
||||
CheckBoxSelector {
|
||||
id: telemetryRemote
|
||||
text: i18n("Enable remote telemetry")
|
||||
}
|
||||
|
||||
IntegerSelector {
|
||||
id: telemetryCount
|
||||
id: historyCount
|
||||
maximumValue: 10000
|
||||
minimumValue: 0
|
||||
stepSize: 50
|
||||
text: i18n("History count")
|
||||
value: plasmoid.configuration.telemetryCount
|
||||
}
|
||||
|
||||
LineSelector {
|
||||
id: telemetryId
|
||||
text: i18n("Telemetry ID")
|
||||
value: plasmoid.configuration.telemetryId
|
||||
value: plasmoid.configuration.historyCount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -168,8 +168,7 @@ PlasmoidItem {
|
||||
|
||||
// init submodule
|
||||
awKeys.initDataAggregator(tooltipSettings)
|
||||
awKeys.initKeys(plasmoid.configuration.text, plasmoid.configuration.interval,
|
||||
plasmoid.configuration.queueLimit, plasmoid.configuration.optimize)
|
||||
awKeys.initKeys(plasmoid.configuration.text, plasmoid.configuration.interval, plasmoid.configuration.optimize)
|
||||
awKeys.setWrapNewLines(plasmoid.configuration.wrapNewLines)
|
||||
// configure aggregator
|
||||
awKeys.setAggregatorProperty("acOffline", plasmoid.configuration.acOffline)
|
||||
@ -178,20 +177,8 @@ PlasmoidItem {
|
||||
awKeys.setAggregatorProperty("customUptime", plasmoid.configuration.customUptime)
|
||||
awKeys.setAggregatorProperty("tempUnits", plasmoid.configuration.tempUnits)
|
||||
awKeys.setAggregatorProperty("translate", plasmoid.configuration.translateStrings)
|
||||
// update telemetry ID
|
||||
if (plasmoid.configuration.telemetryId.length === 0)
|
||||
plasmoid.configuration.telemetryId = generateUuid()
|
||||
// save telemetry
|
||||
awTelemetryHandler.init(plasmoid.configuration.telemetryCount,
|
||||
plasmoid.configuration.telemetryId)
|
||||
awTelemetryHandler.init(plasmoid.configuration.historyCount)
|
||||
awTelemetryHandler.put("awwidgetconfig", plasmoid.configuration.text)
|
||||
}
|
||||
|
||||
// code from http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
|
||||
function generateUuid() {
|
||||
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
||||
let r = Math.random() * 16 | 0, v = c === "x" ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user