From 4eb2ac75588b2ce1f47c2b52ec3ed9ce1b674d22 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 21 Dec 2017 19:39:18 -0500 Subject: Minor robustness and UI improvements Changes include: - Change the 'SCAN' label color when scanning. This visually signals to the user that scanning is taking place, which is useful with the Kingfisher Si4689 radio where scanning jumps to a found station. - Update the frequency when scanning signals a station is found. This improves behavior when using the Kingfisher radio, where the frequency update from the binding can fall prey to a race with the scanning state change in the QML. - Explicitly prevent triggering another scan while one is in progress. This is more of a general robustness fix to prevent unnecessary calls to the binding. It does help avoid potential issues with the Kingfisher radio where we really cannot interrupt a scan at present. Change-Id: I08825c7f51d354a20b38f647e72e4535bca37bd9 Signed-off-by: Scott Murray --- app/Radio.qml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'app/Radio.qml') diff --git a/app/Radio.qml b/app/Radio.qml index f812af1..7b7797a 100644 --- a/app/Radio.qml +++ b/app/Radio.qml @@ -30,7 +30,10 @@ ApplicationWindow { property string title onBandChanged: frequency = minimumFrequency - onStationFound: title = stationId + onStationFound: { + title = stationId + scanLabel.color = '#FFFFFF' + } onFrequencyChanged: { title = '' slider.value = frequency @@ -172,6 +175,7 @@ ApplicationWindow { Item { Layout.fillWidth: true } Label { + id: scanLabel //Layout.fillWidth: true text: 'SCAN' } @@ -183,7 +187,10 @@ ApplicationWindow { triggeredOnStart: true interval: 100 repeat: true - onTriggered: radio.scanDown() + onTriggered: { + radio.scanDown() + scanLabel.color = '#59FF7F' + } } } @@ -194,7 +201,10 @@ ApplicationWindow { triggeredOnStart: true interval: 100 repeat: true - onTriggered: radio.scanUp() + onTriggered: { + radio.scanUp() + scanLabel.color = '#59FF7F' + } } } -- cgit 1.2.3-korg