diff options
author | Egor Nemtsev <enemtsev@luxoft.com> | 2019-08-14 16:01:26 +0300 |
---|---|---|
committer | Egor Nemtsev <enemtsev@luxoft.com> | 2019-08-21 09:14:44 +0000 |
commit | 8d26def6d46f2836d27c976537425b7978dc45bb (patch) | |
tree | 86f4ad7b774dbfdb9b0a57e2d6b6ef05d97cd89b /app/main.qml | |
parent | 817e0d3434fd161c9b6f389d813148382b0c318e (diff) |
Make AlexaInterface object a singleton for qml
Task-number: AUTOSUITE-1163
Change-Id: Ia6d863c9fa4e3d1d61dee7221676239dd448658e
Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
Diffstat (limited to 'app/main.qml')
-rw-r--r-- | app/main.qml | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/app/main.qml b/app/main.qml index 2b84fee..2c99142 100644 --- a/app/main.qml +++ b/app/main.qml @@ -73,9 +73,8 @@ ApplicationCCWindow { httpUserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" } - AlexaInterface { - id: alexa - logLevel: AlexaInterface.Info + Connections { + target: AlexaInterface onAuthCodeChanged: { if (authCode !== "") { alexaAuth.authCode = authCode @@ -84,6 +83,9 @@ ApplicationCCWindow { onAuthUrlChanged: { alexaAuth.authUrl = authUrl } + Component.onCompleted: { + AlexaInterface.logLevel = Alexa.Debug9 + } } Header { @@ -91,7 +93,6 @@ ApplicationCCWindow { anchors.topMargin: Sizes.dp(80) anchors.horizontalCenter: parent.horizontalCenter unfoldHeader: alexaView.visible || authView.visible - alexaInterface: alexa visible: root.neptuneState === "Maximized" } @@ -105,20 +106,16 @@ ApplicationCCWindow { AlexaView { id: alexaView anchors.fill: parent - alexaInterface: alexa - visible: alexaInterface.authState === AlexaInterface.Refreshed + visible: AlexaInterface.authState === Alexa.Refreshed neptuneState: root.neptuneState } AuthView { id: authView anchors.fill: parent - alexaInterface: alexa alexaAuth: alexaAuth - visible: alexaInterface.authState !== AlexaInterface.Refreshed + visible: AlexaInterface.authState !== Alexa.Refreshed } } - - Component.onCompleted: alexa.initAlexaQMLClient() } } |