summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2018-02-15 18:35:50 -0500
committerScott Murray <scott.murray@konsulko.com>2018-02-15 18:35:50 -0500
commit3ebb0c952333caf715a9e2a6c23360db93e54f75 (patch)
treec44a88e0f6dbdbb98b1d4a00d320f8c4429fbe47 /app
parent4eb2ac75588b2ce1f47c2b52ec3ed9ce1b674d22 (diff)
Rework to only enable the scan buttons when the radio is playing, and a tweak to make sure the scan label reverts to the original non-scanning color when a scan is interrupted by the user selecting a frequency with the slider or tune buttons. Change-Id: I5c44234891aa82e13c28c75b703039575fa2428e Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'app')
-rw-r--r--app/Radio.qml43
-rw-r--r--app/api/Binding.qml1
2 files changed, 25 insertions, 19 deletions
diff --git a/app/Radio.qml b/app/Radio.qml
index 7b7797a..78bab94 100644
--- a/app/Radio.qml
+++ b/app/Radio.qml
@@ -181,33 +181,38 @@ ApplicationWindow {
}
ImageButton {
+ id: scanDownBtn
offImage: './images/AGL_MediaPlayer_BackArrow.svg'
- Timer {
- running: parent.pressed
- triggeredOnStart: true
- interval: 100
- repeat: true
- onTriggered: {
- radio.scanDown()
- scanLabel.color = '#59FF7F'
+ states: [
+ State {
+ when: radio.state === radio.activeState
+ PropertyChanges {
+ target: scanDownBtn
+ onClicked: {
+ radio.scanDown()
+ scanLabel.color = '#59FF7F'
+ }
+ }
}
- }
+ ]
}
ImageButton {
+ id: scanUpBtn
offImage: './images/AGL_MediaPlayer_ForwardArrow.svg'
- Timer {
- running: parent.pressed
- triggeredOnStart: true
- interval: 100
- repeat: true
- onTriggered: {
- radio.scanUp()
- scanLabel.color = '#59FF7F'
+ states: [
+ State {
+ when: radio.state === radio.activeState
+ PropertyChanges {
+ target: scanUpBtn
+ onClicked: {
+ radio.scanUp()
+ scanLabel.color = '#59FF7F'
+ }
+ }
}
- }
+ ]
}
-
}
}
}
diff --git a/app/api/Binding.qml b/app/api/Binding.qml
index 7750452..ee83bb5 100644
--- a/app/api/Binding.qml
+++ b/app/api/Binding.qml
@@ -64,6 +64,7 @@ WebSocket {
sendSocketMessage("scan_stop", 'None')
scanningState = stoppedState
sendSocketMessage("frequency", { value: frequency })
+ root.stationFound()
} else {
// This update was from scanning, clear state
scanningFreqUpdate = false