summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2019-12-29 17:36:25 -0500
committerScott Murray <scott.murray@konsulko.com>2019-12-29 17:41:28 -0500
commit89819aff7d6efae2b5b0beb5f84b492c3916ddd5 (patch)
tree33ecc249cf6eec51edc9f7c09e85522b78358612
parentd20756bac5c424c8f40c0292395d5a25029f15c3 (diff)
Display Alexa specific chrome when it is used
Add logic to key off the voiceagent name and display Alexa specific chrome (the required Alexa icon) when it is used. Bug-AGL: SPEC-3075 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Iaebfc0a79a3032a03935d7bf6f97609e6a31dd64
-rw-r--r--homescreen/qml/SpeechChrome.qml3
-rw-r--r--homescreen/qml/images/SpeechChrome/push_to_talk_alexa.pngbin0 -> 1544 bytes
-rw-r--r--homescreen/qml/images/SpeechChrome/speechchrome.qrc1
-rw-r--r--homescreen/src/chromecontroller.cpp5
-rw-r--r--homescreen/src/chromecontroller.h6
5 files changed, 13 insertions, 2 deletions
diff --git a/homescreen/qml/SpeechChrome.qml b/homescreen/qml/SpeechChrome.qml
index 911d481..036a05e 100644
--- a/homescreen/qml/SpeechChrome.qml
+++ b/homescreen/qml/SpeechChrome.qml
@@ -7,6 +7,7 @@ Item {
clip: true
property bool agentPresent: speechChromeController.agentPresent
+ property string agentName: speechChromeController.agentName
visible: agentPresent
@@ -33,7 +34,7 @@ Item {
anchors.left: parent.left
anchors.leftMargin: parent.width / 128
anchors.verticalCenter: parent.verticalCenter
- source: "./images/SpeechChrome/push_to_talk.svg"
+ source: agentName === "Alexa" ? "./images/SpeechChrome/push_to_talk_alexa.png" : "./images/SpeechChrome/push_to_talk.svg"
MouseArea {
anchors.fill: parent
diff --git a/homescreen/qml/images/SpeechChrome/push_to_talk_alexa.png b/homescreen/qml/images/SpeechChrome/push_to_talk_alexa.png
new file mode 100644
index 0000000..f45218e
--- /dev/null
+++ b/homescreen/qml/images/SpeechChrome/push_to_talk_alexa.png
Binary files differ
diff --git a/homescreen/qml/images/SpeechChrome/speechchrome.qrc b/homescreen/qml/images/SpeechChrome/speechchrome.qrc
index 42357f1..c5a9690 100644
--- a/homescreen/qml/images/SpeechChrome/speechchrome.qrc
+++ b/homescreen/qml/images/SpeechChrome/speechchrome.qrc
@@ -2,5 +2,6 @@
<qresource prefix="/images/SpeechChrome">
<file>bar.png</file>
<file>push_to_talk.svg</file>
+ <file>push_to_talk_alexa.png</file>
</qresource>
</RCC>
diff --git a/homescreen/src/chromecontroller.cpp b/homescreen/src/chromecontroller.cpp
index b604dae..34895bf 100644
--- a/homescreen/src/chromecontroller.cpp
+++ b/homescreen/src/chromecontroller.cpp
@@ -64,6 +64,11 @@ ChromeController::ChromeController(const QUrl &bindingUrl, QObject *parent) :
continue;
if (agentId.compare(agentIt.value().toString()) == 0) {
agentFound = true;
+ auto nameIt = agentObj.find(vshl::NAME_TAG);
+ if (nameIt != agentObj.constEnd()) {
+ m_voiceAgentName = nameIt.value().toString();
+ emit agentNameChanged();
+ }
break;
}
}
diff --git a/homescreen/src/chromecontroller.h b/homescreen/src/chromecontroller.h
index 2a76002..047ddd9 100644
--- a/homescreen/src/chromecontroller.h
+++ b/homescreen/src/chromecontroller.h
@@ -9,6 +9,7 @@ class ChromeController : public QObject
Q_OBJECT
Q_PROPERTY(bool agentPresent READ agentPresent NOTIFY agentPresentChanged)
+ Q_PROPERTY(QString agentName READ agentName NOTIFY agentNameChanged)
Q_PROPERTY(int chromeState READ chromeState NOTIFY chromeStateChanged)
public:
@@ -24,19 +25,22 @@ public:
explicit ChromeController(const QUrl &bindingUrl, QObject *parent = nullptr);
bool agentPresent() const { return m_agentPresent; }
int chromeState() const { return m_chromeState; }
+ QString agentName() const { return m_voiceAgentName; }
public slots:
void pushToTalk();
signals:
void agentPresentChanged();
+ void agentNameChanged();
void chromeStateChanged();
private:
void setChromeState(ChromeState state);
AglSocketWrapper *m_aglSocket;
- QString m_voiceAgentId;
+ QString m_voiceAgentId = "";
+ QString m_voiceAgentName = "";
bool m_agentPresent = false;
ChromeState m_chromeState = Idle;
};