114 lines
2.8 KiB
QML
114 lines
2.8 KiB
QML
import QtQuick 2.9
|
|
import QtMultimedia 5.8
|
|
import QtQuick.Window 2.2
|
|
import QtQuick.Controls 2.2
|
|
import QtQuick.Layouts 1.3
|
|
import QtGraphicalEffects 1.0
|
|
import QtQuick.Controls.Styles 1.4
|
|
|
|
import de.itsblue.ScStw 2.0
|
|
import de.itsblue.ScStw.Styling 2.0
|
|
import de.itsblue.ScStw.Styling.Components 1.0
|
|
import de.itsblue.ScStwApp 2.0
|
|
|
|
import "../components"
|
|
|
|
Column {
|
|
id: control
|
|
|
|
spacing: parentObj.rowSpacing
|
|
|
|
property string title: "autostart"
|
|
property var parentObj
|
|
|
|
function updateSetting(key, val, del){
|
|
del.busy = true
|
|
speedBackend.settings.writeSetting(key, val, ScStwSettings.KeyLevel)
|
|
del.busy = false
|
|
}
|
|
|
|
function loadSetting(key, del){
|
|
return speedBackend.settings.readSetting(key, ScStwSettings.KeyLevel)
|
|
}
|
|
|
|
SmoothSwitchDelegate {
|
|
id: ready_del
|
|
|
|
property bool busy: false
|
|
|
|
width: parent.width
|
|
height: parentObj.delegateHeight
|
|
|
|
enabled: !busy
|
|
|
|
text: qsTr("say 'ready'")
|
|
|
|
checked: parent.loadSetting(ScStwSettings.ReadySoundEnableSetting, ready_del)
|
|
|
|
onCheckedChanged: {
|
|
parent.updateSetting(ScStwSettings.ReadySoundEnableSetting, checked, ready_del)
|
|
}
|
|
}
|
|
|
|
InputDelegate {
|
|
id: ready_delay_del
|
|
|
|
property bool busy: false
|
|
|
|
width: parent.width
|
|
height: parentObj.delegateHeight
|
|
|
|
enabled: !busy && ready_del.checked
|
|
|
|
text: qsTr("delay (ms)")
|
|
inputHint: qsTr("time")
|
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
|
|
|
inputText: control.loadSetting(ScStwSettings.ReadySoundDelaySetting, ready_delay_del)
|
|
|
|
onInputFinished: {
|
|
control.updateSetting(ScStwSettings.ReadySoundDelaySetting, inputText, ready_delay_del)
|
|
}
|
|
}
|
|
|
|
SmoothSwitchDelegate {
|
|
id: at_marks_del
|
|
|
|
property bool busy: false
|
|
|
|
width: parent.width
|
|
height: parentObj.delegateHeight
|
|
|
|
enabled: !busy
|
|
|
|
text: qsTr("say 'at your marks'")
|
|
|
|
checked: control.loadSetting(ScStwSettings.AtYourMarksSoundEnableSetting , ready_del)
|
|
|
|
onCheckedChanged: {
|
|
parent.updateSetting(ScStwSettings.AtYourMarksSoundEnableSetting, at_marks_del.checked, at_marks_del)
|
|
}
|
|
}
|
|
|
|
InputDelegate {
|
|
id: at_marks_delay_del
|
|
|
|
property bool busy: false
|
|
|
|
width: parent.width
|
|
height: parentObj.delegateHeight
|
|
|
|
text: qsTr("delay (ms)")
|
|
inputHint: qsTr("time")
|
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
|
|
|
enabled: !busy && at_marks_del.checked
|
|
|
|
inputText: control.loadSetting(ScStwSettings.AtYourMarksSoundDelaySetting, at_marks_delay_del)
|
|
|
|
onInputFinished: {
|
|
control.updateSetting(ScStwSettings.AtYourMarksSoundDelaySetting, inputText, at_marks_delay_del)
|
|
}
|
|
}
|
|
}
|
|
|