- fix issues when reading settings while connecting

This commit is contained in:
Dorian Zedler 2021-01-09 23:13:45 +01:00
parent de22aa9a7b
commit 33834884e8
Signed by: dorian
GPG Key ID: 989DE36109AFA354
9 changed files with 86 additions and 37 deletions

View File

@ -166,7 +166,6 @@ ToolBar {
function getLaneState(extensions) {
var batteryWarning = false;
for(var i = 0; i < extensions.length; i++) {
console.log(JSON.stringify(extensions[i]))
if(extensions[i]["state"] !== ScStw.ExtensionConnected || extensions[i]["batteryState"] === ScStw.BatteryCritical)
return 2
if(extensions[i]["batteryState"] === ScStw.BatteryWarning)

View File

@ -92,7 +92,7 @@ Popup {
Connections {
target: root
onOpened: {
function onOpened() {
profilesStack.init()
}
}

View File

@ -190,8 +190,7 @@ Column {
width: parent.width
height: parentObj.delegateHeight
scale: 0
visible: false
visible: true
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
@ -226,44 +225,19 @@ Column {
text: "Firmware: " + speedBackend.scStwClient.getFirmwareVersion() + " API: " + speedBackend.scStwClient.getApiVersion()
}
SmoothSliderDelegate {
id: baseStationVolumeDel
property ScStwSetting setting: scStwAppSettings.getSetting(ScStwSettings.SoundVolumeSetting, ScStwSettings.KeyLevel)
text: qsTr("volume")
NextPageDelegate {
text: qsTr("settings")
width: parent.width
height: parentObj.delegateHeight * 0.8
font.pixelSize: height * 0.5
sliderValue: setting.value
onSliderFinished: {
enabled = false
setting.value = sliderValue
enabled = true
onClicked: {
parentObj.push(baseStationSettings)
}
}
SmoothSwitchDelegate {
property ScStwSetting setting: scStwAppSettings.getSetting(ScStwSettings.CompetitionModeSetting, ScStwSettings.KeyLevel)
width: parent.width
height: parentObj.delegateHeight
checked: setting.value
onCheckedChanged: {
enabled = false
setting.value = checked
enabled = true
}
text: qsTr("competition mode")
}
NextPageDelegate {
text: qsTr("extensions")

View File

@ -0,0 +1,62 @@
import QtQuick 2.12
import QtMultimedia 5.8
import QtQuick.Window 2.2
import QtQuick.Controls 2.12
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: baseStationSettings
property var parentObj
property string title: "Bs settings"
width: parentObj.width
SmoothSliderDelegate {
id: baseStationVolumeDel
property ScStwSetting setting: scStwAppSettings.getSetting(ScStwSettings.SoundVolumeSetting, ScStwSettings.KeyLevel)
text: qsTr("volume")
width: parent.width
height: parentObj.delegateHeight
font.pixelSize: height * 0.5
sliderValue: setting.readonlyValue
onSliderFinished: {
enabled = false
setting.value = sliderValue
enabled = true
}
}
SmoothSwitchDelegate {
property ScStwSetting setting: scStwAppSettings.getSetting(ScStwSettings.CompetitionModeSetting, ScStwSettings.KeyLevel)
width: parent.width
height: parentObj.delegateHeight
checked: setting.readonlyValue
onClicked: {
enabled = false
setting.value = checked
enabled = true
}
text: qsTr("competition mode")
}
}

View File

@ -57,6 +57,14 @@ StackView {
}
}
Component {
id: baseStationSettings
SettingsBaseStationSettingsPage {
parentObj: control
}
}
/*-----Custom animations-----*/
pushEnter: Transition {
NumberAnimation {

View File

@ -94,8 +94,13 @@ DelayButton {
Connections {
target: control
onProgressChanged: canvas.requestPaint()
onOldStartProgressChanged: canvas.requestPaint()
function onProgressChanged() {
canvas.requestPaint()
}
function onOldStartProgressChanged() {
canvas.requestPaint()
}
}
onPaint: {

View File

@ -43,7 +43,7 @@ ItemDelegate {
background: Rectangle {
id: backgroundRect
color: control.down ? Qt.darker(control.color, 1.3) : control.color
color: control.down ? appTheme.theme.colors.delegatePressed : appTheme.theme.colors.delegateBackground
radius: height * 0.3

View File

@ -29,5 +29,6 @@
<file>components/StateIndicator.qml</file>
<file>components/BatteryIndicator.qml</file>
<file>components/ExtensionOverview.qml</file>
<file>SettingsDialog/SettingsBaseStationSettingsPage.qml</file>
</qresource>
</RCC>

@ -1 +1 @@
Subproject commit 92fae096726f559cf36a87816ab97093db555d8b
Subproject commit d37c5646f02712b8c88e98fc540c78158fca0cc0