mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
add telemetry configuration
This commit is contained in:
parent
89cb4b74fd
commit
26b375254a
@ -62,6 +62,12 @@
|
|||||||
<entry name="acOffline" type="string">
|
<entry name="acOffline" type="string">
|
||||||
<default>( )</default>
|
<default>( )</default>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry name="telemetry" type="bool">
|
||||||
|
<default>false</default>
|
||||||
|
</entry>
|
||||||
|
<entry name="telemetryId" type="string">
|
||||||
|
<default></default>
|
||||||
|
</entry>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<group name="Tooltip">
|
<group name="Tooltip">
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 1.3 as QtControls
|
||||||
|
|
||||||
import org.kde.plasma.private.awesomewidget 1.0
|
import org.kde.plasma.private.awesomewidget 1.0
|
||||||
|
|
||||||
@ -26,9 +27,6 @@ Item {
|
|||||||
AWActions {
|
AWActions {
|
||||||
id: awActions
|
id: awActions
|
||||||
}
|
}
|
||||||
AWConfigHelper {
|
|
||||||
id: awConfig
|
|
||||||
}
|
|
||||||
|
|
||||||
width: childrenRect.width
|
width: childrenRect.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
@ -53,6 +51,8 @@ Item {
|
|||||||
property alias cfg_customUptime: customUptime.value
|
property alias cfg_customUptime: customUptime.value
|
||||||
property alias cfg_acOnline: acOnline.value
|
property alias cfg_acOnline: acOnline.value
|
||||||
property alias cfg_acOffline: acOffline.value
|
property alias cfg_acOffline: acOffline.value
|
||||||
|
property alias cfg_telemetry: telemetry.checked
|
||||||
|
property alias cfg_telemetryId: telemetryId.value
|
||||||
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@ -191,37 +191,74 @@ Item {
|
|||||||
value: plasmoid.configuration.acOffline
|
value: plasmoid.configuration.acOffline
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonSelector {
|
QtControls.GroupBox {
|
||||||
value: i18n("Drop key cache")
|
height: implicitHeight
|
||||||
onButtonActivated: awActions.dropCache()
|
width: parent.width
|
||||||
}
|
title: i18n("Actions")
|
||||||
|
|
||||||
ButtonSelector {
|
Column {
|
||||||
ExportDialog {
|
height: implicitHeight
|
||||||
id: saveConfigAs
|
width: parent.width
|
||||||
configuration: plasmoid.configuration
|
ButtonSelector {
|
||||||
}
|
value: i18n("Drop key cache")
|
||||||
|
onButtonActivated: awActions.dropCache()
|
||||||
value: i18n("Export configuration")
|
}
|
||||||
onButtonActivated: saveConfigAs.open()
|
ButtonSelector {
|
||||||
}
|
ExportDialog {
|
||||||
|
id: saveConfigAs
|
||||||
ButtonSelector {
|
configuration: plasmoid.configuration
|
||||||
ImportDialog {
|
}
|
||||||
id: loadConfigFrom
|
value: i18n("Export configuration")
|
||||||
onConfigurationReceived: {
|
onButtonActivated: saveConfigAs.open()
|
||||||
for (var key in configuration)
|
}
|
||||||
plasmoid.configuration[key] = configuration[key]
|
ButtonSelector {
|
||||||
|
ImportDialog {
|
||||||
|
id: loadConfigFrom
|
||||||
|
onConfigurationReceived: {
|
||||||
|
for (var key in configuration)
|
||||||
|
plasmoid.configuration[key] = configuration[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
value: i18n("Import configuration")
|
||||||
|
onButtonActivated: loadConfigFrom.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
value: i18n("Import configuration")
|
QtControls.GroupBox {
|
||||||
onButtonActivated: loadConfigFrom.open()
|
height: implicitHeight
|
||||||
|
width: parent.width
|
||||||
|
title: i18n("Telemetry")
|
||||||
|
|
||||||
|
Column {
|
||||||
|
height: implicitHeight
|
||||||
|
width: parent.width
|
||||||
|
CheckBoxSelector {
|
||||||
|
id: telemetry
|
||||||
|
text: i18n("Enable remote telemetry")
|
||||||
|
}
|
||||||
|
LineSelector {
|
||||||
|
id: telemetryId
|
||||||
|
text: i18n("Telemetry ID")
|
||||||
|
value: plasmoid.configuration.telemetryId
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (debug) console.debug()
|
if (debug) console.debug()
|
||||||
|
|
||||||
|
// generate UUID if missing
|
||||||
|
if (telemetryId.value.length == 0)
|
||||||
|
telemetryId.value = generateUuid()
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateUuid() {
|
||||||
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||||
|
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
|
||||||
|
return v.toString(16);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user