From b57a3197dad42bdd7a72266aaa160341573b0627 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Sun, 29 Dec 2019 17:36:25 -0500 Subject: [PATCH] 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 Change-Id: I4bacad2e3906ee1e8221ed3e6bfe92b340d65aab --- homescreen/qml/SpeechChrome.qml | 5 +++-- .../qml/images/SpeechChrome/push_to_talk_alexa.png | Bin 0 -> 1544 bytes homescreen/qml/images/SpeechChrome/speechchrome.qrc | 1 + homescreen/src/chromecontroller.cpp | 5 +++++ homescreen/src/chromecontroller.h | 6 +++++- 5 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 homescreen/qml/images/SpeechChrome/push_to_talk_alexa.png diff --git a/homescreen/qml/SpeechChrome.qml b/homescreen/qml/SpeechChrome.qml index ab46cb6..123928c 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 @@ -54,7 +55,7 @@ Item { anchors.right: parent.right anchors.rightMargin: 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 0000000000000000000000000000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PA{JV|P?=oszfdU(Lm#cikNM&?MC3 zV!_E=oJ7$~=_=|qg6o_umLFLj^1>IGF^7|fiZ+jnWpOg4YL6pNINBKhAhS$ar~P+U z`1*vSjq!_&U~EMSfUXOAm}d;*KwSBLqnYMlf=vdH40q!=}j9HV-Q(BYld~ z9uASfwNX$e(qqUF2o)23MEKGL`D*6o|IN`_uM>H=MnoHji<9bQPU(A{EeOP((GXRj zHNI%t5e~Nv0WD4RaNC{|$4S@Lfhq7@8?$YBUWwB?`0lPHeIli8Y|HKSC3BtBJEe5w zp`~rSmbAj4rR0?=Xj+LhCT%4%|KJj7v&2HAili}^JGVsS<%&A=wSiJSX750$$djg0 zX$)@D2Y(UER|#sW+)w- zE6T>?700;fDsWx$ArV^PYkyBaQ)1kfX u`fQ-wM_s8hhVfWsTx8n2ZMlusWcdd>9+oDx5Q;4T0000 bar.png push_to_talk.svg + push_to_talk_alexa.png 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; }; -- 2.16.6