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-04-07 16:33:02 +02:00
|
|
|
import com.itsblue.speedclimbingstopwatch 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-04-17 19:57:33 +02:00
|
|
|
speedBackend.writeSetting(scStw.baseStationSettingToString(key) , val)
|
2019-11-02 15:22:50 +01:00
|
|
|
del.busy = false
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function loadSetting(key, del){
|
|
|
|
return speedBackend.readSetting(key)
|
|
|
|
}
|
|
|
|
|
|
|
|
SmoothSwitchDelegate {
|
|
|
|
id: ready_del
|
|
|
|
|
2019-11-02 15:22:50 +01:00
|
|
|
property bool busy: false
|
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
width: parent.width
|
|
|
|
height: parentObj.delegateHeight
|
|
|
|
|
2019-11-02 15:22:50 +01:00
|
|
|
enabled: !busy
|
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
text: qsTr("say 'ready'")
|
|
|
|
|
2020-04-17 19:57:33 +02:00
|
|
|
checked: parent.loadSetting(ScStw.ReadySoundEnableSetting, ready_del) === "true"
|
2019-10-18 16:10:41 +02:00
|
|
|
|
|
|
|
onCheckedChanged: {
|
2020-04-17 19:57:33 +02:00
|
|
|
parent.updateSetting(ScStw.ReadySoundEnableSetting, checked, ready_del)
|
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
|
|
|
|
|
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-04-17 19:57:33 +02:00
|
|
|
inputText: control.loadSetting(ScStw.ReadySoundDelaySetting, ready_delay_del)
|
2019-10-18 16:10:41 +02:00
|
|
|
|
|
|
|
onInputFinished: {
|
2020-04-17 19:57:33 +02:00
|
|
|
control.updateSetting(ScStw.ReadySoundDelaySetting, inputText, ready_delay_del)
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SmoothSwitchDelegate {
|
|
|
|
id: at_marks_del
|
|
|
|
|
2019-11-02 15:22:50 +01:00
|
|
|
property bool busy: false
|
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
width: parent.width
|
|
|
|
height: parentObj.delegateHeight
|
|
|
|
|
2019-11-02 15:22:50 +01:00
|
|
|
enabled: !busy
|
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
text: qsTr("say 'at your marks'")
|
|
|
|
|
2020-04-17 19:57:33 +02:00
|
|
|
checked: control.loadSetting(ScStw.AtYourMarksSoundEnableSetting , ready_del) === "true"
|
2019-10-18 16:10:41 +02:00
|
|
|
|
|
|
|
onCheckedChanged: {
|
2020-04-17 19:57:33 +02:00
|
|
|
parent.updateSetting(ScStw.AtYourMarksSoundEnableSetting, at_marks_del.checked, at_marks_del)
|
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
|
|
|
|
|
2019-10-18 16:10:41 +02:00
|
|
|
width: parent.width
|
|
|
|
height: parentObj.delegateHeight
|
|
|
|
|
|
|
|
text: qsTr("delay (ms)")
|
|
|
|
inputHint: qsTr("time")
|
|
|
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
|
|
|
|
2019-11-02 15:22:50 +01:00
|
|
|
enabled: !busy && at_marks_del.checked
|
2019-10-18 16:10:41 +02:00
|
|
|
|
2020-04-17 19:57:33 +02:00
|
|
|
inputText: control.loadSetting(ScStw.AtYourMarksSoundDelaySetting, at_marks_delay_del)
|
2019-10-18 16:10:41 +02:00
|
|
|
|
|
|
|
onInputFinished: {
|
2020-04-17 19:57:33 +02:00
|
|
|
control.updateSetting(ScStw.AtYourMarksSoundDelaySetting, inputText, at_marks_delay_del)
|
2019-10-18 16:10:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|