This repository has been archived on 2024-06-03. You can view files and clone it, but cannot push or open issues or pull requests.
app/qml/SettingsDialog/SettingsStartSequencePage.qml

95 lines
2.1 KiB
QML
Raw Normal View History

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 "../components"
Column {
id: control
spacing: parentObj.rowSpacing
property string title: "autostart"
property var parentObj
function updateSetting(key, val, del){
speedBackend.writeSetting(key, val)
}
function loadSetting(key, del){
return speedBackend.readSetting(key)
}
SmoothSwitchDelegate {
id: ready_del
width: parent.width
height: parentObj.delegateHeight
text: qsTr("say 'ready'")
checked: parent.loadSetting("ready_en", ready_del) === "true"
onCheckedChanged: {
parent.updateSetting("ready_en",checked, ready_del)
}
}
InputDelegate {
id: ready_delay_del
width: parent.width
height: parentObj.delegateHeight
enabled: ready_del.checked
text: qsTr("delay (ms)")
inputHint: qsTr("time")
inputMethodHints: Qt.ImhFormattedNumbersOnly
inputText: control.loadSetting("ready_delay", ready_del)
onInputFinished: {
control.updateSetting("ready_delay", inputText, ready_delay_del)
}
}
SmoothSwitchDelegate {
id: at_marks_del
width: parent.width
height: parentObj.delegateHeight
text: qsTr("say 'at your marks'")
checked: control.loadSetting("at_marks_en", ready_del) === "true"
onCheckedChanged: {
parent.updateSetting("at_marks_en",at_marks_del.checked, at_marks_del)
}
}
InputDelegate {
id: at_marks_delay_del
width: parent.width
height: parentObj.delegateHeight
text: qsTr("delay (ms)")
inputHint: qsTr("time")
inputMethodHints: Qt.ImhFormattedNumbersOnly
enabled: at_marks_del.checked
inputText: control.loadSetting("at_marks_delay", at_marks_delay_del)
onInputFinished: {
control.updateSetting("at_marks_delay", inputText, at_marks_delay_del)
}
}
}