- 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) { function getLaneState(extensions) {
var batteryWarning = false; var batteryWarning = false;
for(var i = 0; i < extensions.length; i++) { 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) if(extensions[i]["state"] !== ScStw.ExtensionConnected || extensions[i]["batteryState"] === ScStw.BatteryCritical)
return 2 return 2
if(extensions[i]["batteryState"] === ScStw.BatteryWarning) if(extensions[i]["batteryState"] === ScStw.BatteryWarning)

View file

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

View file

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

View file

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

View file

@ -43,7 +43,7 @@ ItemDelegate {
background: Rectangle { background: Rectangle {
id: backgroundRect 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 radius: height * 0.3

View file

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

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