2019-10-18 16:10:41 +02:00
|
|
|
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
|
2020-05-26 17:57:54 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
import "../components"
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: control
|
|
|
|
|
|
|
|
spacing: parentObj.rowSpacing
|
|
|
|
|
|
|
|
property string title: "autostart"
|
|
|
|
property var parentObj
|
|
|
|
|
|
|
|
function updateSetting(key, val, del){
|
2019-11-02 15:22:50 +01:00
|
|
|
del.busy = true
|
2020-10-09 15:44:24 +02:00
|
|
|
scStwAppSettings.writeSetting(key, val, ScStwSettings.KeyLevel)
|
2019-11-02 15:22:50 +01:00
|
|
|
del.busy = false
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function loadSetting(key, del){
|
2020-10-09 15:44:24 +02:00
|
|
|
return scStwAppSettings.readSetting(key, ScStwSettings.KeyLevel)
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
SmoothSwitchDelegate {
|
|
|
|
id: ready_del
|
|
|
|
|
2020-10-09 15:44:24 +02:00
|
|
|
property ScStwSetting setting: scStwAppSettings.getSetting(ScStwSettings.ReadySoundEnableSetting, ScStwSettings.KeyLevel)
|
2019-11-02 15:22:50 +01:00
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
width: parent.width
|
|
|
|
height: parentObj.delegateHeight
|
|
|
|
|
2020-07-11 20:30:50 +02:00
|
|
|
checked: setting.value
|
2019-10-18 16:10:41 +02:00
|
|
|
|
|
|
|
onCheckedChanged: {
|
2020-07-11 20:30:50 +02:00
|
|
|
enabled = false
|
|
|
|
setting.value = checked
|
|
|
|
enabled = true
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
2020-07-11 20:30:50 +02:00
|
|
|
|
|
|
|
text: qsTr("say 'ready'")
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
InputDelegate {
|
|
|
|
id: ready_delay_del
|
|
|
|
|
2019-11-02 15:22:50 +01:00
|
|
|
property bool busy: false
|
2020-10-09 15:44:24 +02:00
|
|
|
property ScStwSetting setting: scStwAppSettings.getSetting(ScStwSettings.ReadySoundDelaySetting, ScStwSettings.KeyLevel)
|
2019-11-02 15:22:50 +01:00
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
width: parent.width
|
|
|
|
height: parentObj.delegateHeight
|
|
|
|
|
2019-11-02 15:22:50 +01:00
|
|
|
enabled: !busy && ready_del.checked
|
2019-10-18 16:10:41 +02:00
|
|
|
|
|
|
|
text: qsTr("delay (ms)")
|
|
|
|
inputHint: qsTr("time")
|
|
|
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
|
|
|
|
2020-07-11 20:30:50 +02:00
|
|
|
inputText: setting.value
|
2019-10-18 16:10:41 +02:00
|
|
|
|
|
|
|
onInputFinished: {
|
2020-07-11 20:30:50 +02:00
|
|
|
console.log("input finished")
|
|
|
|
busy = true
|
|
|
|
setting.value = inputText
|
|
|
|
busy = false
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SmoothSwitchDelegate {
|
|
|
|
id: at_marks_del
|
|
|
|
|
2020-10-09 15:44:24 +02:00
|
|
|
property ScStwSetting setting: scStwAppSettings.getSetting(ScStwSettings.AtYourMarksSoundEnableSetting, ScStwSettings.KeyLevel)
|
2019-11-02 15:22:50 +01:00
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
width: parent.width
|
|
|
|
height: parentObj.delegateHeight
|
|
|
|
|
|
|
|
text: qsTr("say 'at your marks'")
|
|
|
|
|
2020-07-11 20:30:50 +02:00
|
|
|
checked: setting.value
|
2019-10-18 16:10:41 +02:00
|
|
|
|
|
|
|
onCheckedChanged: {
|
2020-07-11 20:30:50 +02:00
|
|
|
enabled = false
|
|
|
|
setting.value = checked
|
|
|
|
enabled = true
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
InputDelegate {
|
|
|
|
id: at_marks_delay_del
|
|
|
|
|
2019-11-02 15:22:50 +01:00
|
|
|
property bool busy: false
|
2020-10-09 15:44:24 +02:00
|
|
|
property ScStwSetting setting: scStwAppSettings.getSetting(ScStwSettings.AtYourMarksSoundDelaySetting, ScStwSettings.KeyLevel)
|
2019-11-02 15:22:50 +01:00
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
width: parent.width
|
|
|
|
height: parentObj.delegateHeight
|
|
|
|
|
|
|
|
text: qsTr("delay (ms)")
|
|
|
|
inputHint: qsTr("time")
|
|
|
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
|
|
|
|
2020-07-11 20:30:50 +02:00
|
|
|
enabled: !busy && at_marks_del.checked
|
2019-10-18 16:10:41 +02:00
|
|
|
|
2020-07-11 20:30:50 +02:00
|
|
|
inputText: setting.value
|
2019-10-18 16:10:41 +02:00
|
|
|
|
|
|
|
onInputFinished: {
|
2020-07-11 20:30:50 +02:00
|
|
|
busy = true
|
|
|
|
setting.setValue(inputText)
|
|
|
|
busy = false
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|