add config page
This commit is contained in:
24
package/contents/ui/configGeneral.qml
Normal file
24
package/contents/ui/configGeneral.qml
Normal file
@ -0,0 +1,24 @@
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 2.5 as QQC2
|
||||
import org.kde.kirigami 2.4 as Kirigami
|
||||
|
||||
QQC2.Pane {
|
||||
id: root
|
||||
|
||||
property alias cfg_pollingrate: pollingrate.value
|
||||
|
||||
Kirigami.FormLayout {
|
||||
anchors.fill: parent
|
||||
wideMode: false
|
||||
|
||||
QQC2.SpinBox {
|
||||
id: pollingrate
|
||||
Kirigami.FormData.label: i18nc("@label", "pollingrate in seconds:")
|
||||
onValueChanged: {
|
||||
console.log("cfg_pollingrate: " + cfg_pollingrate);
|
||||
}
|
||||
from: 2
|
||||
to: 60
|
||||
}
|
||||
}
|
||||
}
|
@ -6,13 +6,14 @@ import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
Item {
|
||||
id: main
|
||||
|
||||
property int pollingrate: Plasmoid.configuration.pollingrate
|
||||
property int batteryPercent: -2
|
||||
|
||||
PlasmaCore.DataSource {
|
||||
id: hsSource
|
||||
engine: "executable"
|
||||
connectedSources: ["headsetcontrol -bc"]
|
||||
interval: 2000
|
||||
interval: pollingrate * 1e3
|
||||
onNewData: {
|
||||
if(data['exit_code'] > 0)
|
||||
return console.log('error lol');
|
||||
|
Reference in New Issue
Block a user