aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--homescreen/qml/ShortcutIcon.qml28
-rw-r--r--homescreen/qml/TopArea.qml2
-rw-r--r--homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.pngbin951359 -> 27317 bytes
-rw-r--r--homescreen/qml/images/Shortcut/blank_active.svg153
-rw-r--r--homescreen/qml/images/TopSection_NoText_NoIcons-01.pngbin0 -> 16553 bytes
-rw-r--r--homescreen/qml/images/TopSection_NoText_NoIcons-01.svg55
-rw-r--r--homescreen/qml/images/fullscreen.pngbin1633 -> 1098 bytes
-rw-r--r--homescreen/qml/images/images.qrc2
-rw-r--r--homescreen/qml/images/normal.pngbin1626 -> 937 bytes
-rw-r--r--homescreen/qml/images/normal_disable.pngbin1721 -> 911 bytes
-rw-r--r--homescreen/src/homescreenconnect.cpp34
-rw-r--r--homescreen/src/homescreenconnect.h6
12 files changed, 126 insertions, 154 deletions
diff --git a/homescreen/qml/ShortcutIcon.qml b/homescreen/qml/ShortcutIcon.qml
index e891c99..d5abb1e 100644
--- a/homescreen/qml/ShortcutIcon.qml
+++ b/homescreen/qml/ShortcutIcon.qml
@@ -67,6 +67,10 @@ MouseArea {
}
Image {
id: sourceIcon
+ anchors.topMargin: 21
+ anchors.bottomMargin: 41
+ anchors.leftMargin: 30
+ anchors.rightMargin: 30
anchors.fill: parent
source: isBlank ? null : root.icon
}
@@ -79,18 +83,18 @@ MouseArea {
}
}
- Label {
- id: name
- y: 160
- width: root.width - 10
- font.pixelSize: 15
- font.letterSpacing: 5
- // wrapMode: Text.WordWrap
- anchors.horizontalCenter: parent.horizontalCenter
- horizontalAlignment: Text.AlignHCenter
- color: "white"
- text: qsTr((root.name === "launcher" ? "home" : root.name).toUpperCase())
- }
+// Label {
+// id: name
+// y: 160
+// width: root.width - 10
+// font.pixelSize: 15
+// font.letterSpacing: 5
+// // wrapMode: Text.WordWrap
+// anchors.horizontalCenter: parent.horizontalCenter
+// horizontalAlignment: Text.AlignHCenter
+// color: "white"
+// text: qsTr((root.name === "launcher" ? "home" : root.name).toUpperCase())
+// }
states: [
State {
diff --git a/homescreen/qml/TopArea.qml b/homescreen/qml/TopArea.qml
index 2a75cf8..9cff3ed 100644
--- a/homescreen/qml/TopArea.qml
+++ b/homescreen/qml/TopArea.qml
@@ -22,7 +22,7 @@ import QtQuick.Controls 2.0
Image {
width: 1920
height: 218
- source: './images/TopSection_NoText_NoIcons-01.svg'
+ source: './images/TopSection_NoText_NoIcons-01.png'
fillMode: Image.PreserveAspectCrop
RowLayout {
diff --git a/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png b/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png
index a4e026c..e6cd3f2 100644
--- a/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png
+++ b/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png
Binary files differ
diff --git a/homescreen/qml/images/Shortcut/blank_active.svg b/homescreen/qml/images/Shortcut/blank_active.svg
index 0b63bc9..9eb8a30 100644
--- a/homescreen/qml/images/Shortcut/blank_active.svg
+++ b/homescreen/qml/images/Shortcut/blank_active.svg
@@ -2,12 +2,12 @@
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
- xmlns:i="&amp;ns_ai;"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
@@ -17,84 +17,73 @@
viewBox="0 0 195 216.8"
style="enable-background:new 0 0 195 216.8;"
xml:space="preserve"
- sodipodi:docname="sdl_usb_active.svg"
- inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
- id="metadata3773"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs3771" /><sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1920"
- inkscape:window-height="1018"
- id="namedview3769"
- showgrid="false"
- inkscape:zoom="3.8560885"
- inkscape:cx="97.5"
- inkscape:cy="108.4"
- inkscape:window-x="-8"
- inkscape:window-y="-8"
- inkscape:window-maximized="1"
- inkscape:current-layer="g3764" />
-<style
- type="text/css"
- id="style3750">
- .st0{fill:#0DF9FF;}
- .st1{fill:url(#Active_2_1_);}
- .st2{fill:#FFFFFF;}
- .st3{font-family:'Roboto-Regular';}
- .st4{font-size:11px;}
- .st5{letter-spacing:2;}
- .st6{fill:url(#SVGID_1_);}
- .st7{fill:url(#SVGID_2_);}
- .st8{fill:url(#SVGID_3_);}
- .st9{fill:url(#SVGID_4_);}
- .st10{fill:url(#SVGID_5_);}
-</style>
-<switch
- id="switch3766">
- <g
- i:extraneous="self"
- id="g3764">
- <rect
- id="Active_1"
- y="214.3"
- transform="matrix(-1 -1.224647e-16 1.224647e-16 -1 195.8833 431.0468)"
- class="st0"
- width="195.9"
- height="2.4" />
- <linearGradient
- id="Active_2_1_"
- gradientUnits="userSpaceOnUse"
- x1="97.9416"
- y1="236.9585"
- x2="97.9416"
- y2="-68.5304">
- <stop
- offset="0"
- style="stop-color:#0DF9FF"
- id="stop3753" />
- <stop
- offset="9.208472e-02"
- style="stop-color:#0DF9FF;stop-opacity:0.853"
- id="stop3755" />
- <stop
- offset="0.6264"
- style="stop-color:#0DF9FF;stop-opacity:0"
- id="stop3757" />
- </linearGradient>
- <rect
- id="Active_2"
- class="st1"
- width="195.9"
- height="214.3" />
-
- </g>
-</switch>
-</svg> \ No newline at end of file
+ inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
+ sodipodi:docname="blank_active.svg"><metadata
+ id="metadata61"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs59" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1018"
+ id="namedview57"
+ showgrid="false"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:zoom="2.1771217"
+ inkscape:cx="179.59844"
+ inkscape:cy="95.18051"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Home"><sodipodi:guide
+ position="52.936865,144.9161"
+ orientation="0,1"
+ id="guide4189"
+ inkscape:locked="false" /><sodipodi:guide
+ position="66.027543,153.29873"
+ orientation="1,0"
+ id="guide4191"
+ inkscape:locked="false" /><sodipodi:guide
+ position="34.449153,79.00339"
+ orientation="0,1"
+ id="guide4193"
+ inkscape:locked="false" /><sodipodi:guide
+ position="132.05509,117.35678"
+ orientation="1,0"
+ id="guide4195"
+ inkscape:locked="false" /><sodipodi:guide
+ position="98.9839,162.94449"
+ orientation="1,0"
+ id="guide4266"
+ inkscape:locked="false" /><sodipodi:guide
+ position="67.290679,111.95975"
+ orientation="0,1"
+ id="guide4268"
+ inkscape:locked="false" /></sodipodi:namedview><style
+ type="text/css"
+ id="style3">
+ .st0{fill:#FFFFFF;}
+ .st1{font-family:'Roboto-Regular';}
+ .st2{font-size:11px;}
+ .st3{letter-spacing:2;}
+ .st4{fill:url(#SVGID_1_);}
+ .st5{fill:url(#SVGID_2_);}
+ .st6{fill:url(#SVGID_3_);}
+ .st7{fill:url(#SVGID_4_);}
+ .st8{fill:url(#SVGID_5_);}
+</style><image
+ width="196"
+ height="11"
+ preserveAspectRatio="none"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAAAKCAYAAAA6o/XfAAAACXBIWXMAAAsSAAALEgHS3X78AAAA zElEQVRYhe2YSw6DMAxEJw7cozfpVXrkXgfIp3KCwKVRq+68mCdZM/EnEopXBAAPSLwhzoDMQJxO bbkJYdd2tv7ICSCha9xVjDf18KM+nBfTpzmRYW/4UX+b1zv16zWUEIzHwJv+Yd8f88Oey7xSNarR CpTdFxP2nC+1XFFzMbXStUX5ogVIA596rdpzOvPdVyBlIK3Atn5o3ZYzp/7oWTC1hQTuIMQBwkcg nuBCEldwIYkruJDEFVxI4gouJHEFF5K4Qv9DPvkkxAUAXgP7fBBsdQEGAAAAAElFTkSuQmCC "
+ id="image544"
+ x="0"
+ y="179" /></svg> \ No newline at end of file
diff --git a/homescreen/qml/images/TopSection_NoText_NoIcons-01.png b/homescreen/qml/images/TopSection_NoText_NoIcons-01.png
new file mode 100644
index 0000000..9b405fe
--- /dev/null
+++ b/homescreen/qml/images/TopSection_NoText_NoIcons-01.png
Binary files differ
diff --git a/homescreen/qml/images/TopSection_NoText_NoIcons-01.svg b/homescreen/qml/images/TopSection_NoText_NoIcons-01.svg
deleted file mode 100644
index 6841001..0000000
--- a/homescreen/qml/images/TopSection_NoText_NoIcons-01.svg
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
- <!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
- <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
- <!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
- <!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
- <!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
- <!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
- <!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
-]>
-<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1080 217.9"
- style="enable-background:new 0 0 1080 217.9;" xml:space="preserve">
-<style type="text/css">
- .st0{opacity:0.9;fill:#1B1A1D;}
- .st1{opacity:0.9;fill:#27232B;}
- .st2{fill:none;stroke:url(#SVGID_1_);stroke-miterlimit:10;}
- .st3{fill:none;stroke:url(#SVGID_2_);stroke-miterlimit:10;}
- .st4{fill:none;stroke:url(#SVGID_3_);stroke-miterlimit:10;}
- .st5{fill:none;stroke:url(#SVGID_4_);stroke-miterlimit:10;}
- .st6{opacity:0.9;fill:none;stroke:#545157;stroke-miterlimit:10;}
-</style>
-<switch>
- <g i:extraneous="self">
- <rect class="st0" width="784.8" height="214.3"/>
- <rect x="784.8" y="0" class="st1" width="295.2" height="214.3"/>
- <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="391.5756" y1="107.1501" x2="392.5756" y2="107.1501">
- <stop offset="0.4644" style="stop-color:#000000"/>
- <stop offset="0.4741" style="stop-color:#4D4B51"/>
- </linearGradient>
- <line class="st2" x1="392.1" y1="214.3" x2="392.1" y2="0"/>
- <linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="195.6923" y1="107.1501" x2="196.6923" y2="107.1501">
- <stop offset="0.4644" style="stop-color:#000000"/>
- <stop offset="0.4741" style="stop-color:#4D4B51"/>
- </linearGradient>
- <line class="st3" x1="196.2" y1="214.3" x2="196.2" y2="0"/>
- <linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="587.4589" y1="107.1501" x2="588.4589" y2="107.1501">
- <stop offset="0.4644" style="stop-color:#000000"/>
- <stop offset="0.4741" style="stop-color:#4D4B51"/>
- </linearGradient>
- <line class="st4" x1="588" y1="214.3" x2="588" y2="0"/>
- <linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="783.3421" y1="107.1501" x2="784.3421" y2="107.1501">
- <stop offset="0.4644" style="stop-color:#000000"/>
- <stop offset="0.4741" style="stop-color:#4D4B51"/>
- </linearGradient>
- <line class="st5" x1="783.8" y1="214.3" x2="783.8" y2="0"/>
- <g>
- <line class="st6" x1="815.1" y1="132" x2="983.5" y2="132"/>
- </g>
- <line class="st6" x1="1004.4" y1="-1.1" x2="1004.4" y2="213.2"/>
- </g>
-</switch>
-</svg>
diff --git a/homescreen/qml/images/fullscreen.png b/homescreen/qml/images/fullscreen.png
index f56a13c..4c96652 100644
--- a/homescreen/qml/images/fullscreen.png
+++ b/homescreen/qml/images/fullscreen.png
Binary files differ
diff --git a/homescreen/qml/images/images.qrc b/homescreen/qml/images/images.qrc
index 2e09cc9..ccd87eb 100644
--- a/homescreen/qml/images/images.qrc
+++ b/homescreen/qml/images/images.qrc
@@ -1,6 +1,6 @@
<RCC>
<qresource prefix="/images">
- <file>TopSection_NoText_NoIcons-01.svg</file>
+ <file>TopSection_NoText_NoIcons-01.png</file>
<file>Utility_Logo_Background-01.svg</file>
<file>Utility_Logo_Grey-01.svg</file>
<file>Utility_Music_Background-01.png</file>
diff --git a/homescreen/qml/images/normal.png b/homescreen/qml/images/normal.png
index 92dee7a..53295fc 100644
--- a/homescreen/qml/images/normal.png
+++ b/homescreen/qml/images/normal.png
Binary files differ
diff --git a/homescreen/qml/images/normal_disable.png b/homescreen/qml/images/normal_disable.png
index f191241..f1609e2 100644
--- a/homescreen/qml/images/normal_disable.png
+++ b/homescreen/qml/images/normal_disable.png
Binary files differ
diff --git a/homescreen/src/homescreenconnect.cpp b/homescreen/src/homescreenconnect.cpp
index 19ccc08..7279994 100644
--- a/homescreen/src/homescreenconnect.cpp
+++ b/homescreen/src/homescreenconnect.cpp
@@ -30,6 +30,7 @@ static const char API[] = "alexa-voiceagent";
static const char CARLACLIENTAPI[] = "carlaclient";
const string vshl_core_event = "{\"events\": []}";
const string vshl_core_refreshevent = "{\"refresh_token\": \"ws\"}";
+static const int RETRYCOUNT = 60;
const std::vector<std::string> HomescreenConnect::event_lists {
std::string("alexa-voiceagent/voice_cbl_codepair_received_event"),
@@ -64,6 +65,7 @@ HomescreenConnect::HomescreenConnect(QObject *parent) :
QObject(parent)
{
timer = new QTimer(this);
+ retrytimer = new QTimer(this);
}
HomescreenConnect::~HomescreenConnect()
@@ -84,6 +86,8 @@ int HomescreenConnect::init(int port, const string& token)
connect(timer,SIGNAL(timeout()),this,SLOT(subscribe()));
connect(this,SIGNAL(stopTimer()),this,SLOT(stopGetCode()));
+ connect(this,SIGNAL(retryStart()),this,SLOT(startTimer()));
+ connect(retrytimer,SIGNAL(timeout()),this,SLOT(resendCode()));
if(port > 0 && token.size() > 0)
{
mport = port;
@@ -229,8 +233,10 @@ void HomescreenConnect::on_event(void *closure, const char *event, struct afb_ws
QString codestr = codestr2.left(6);
emit showInformation(QString(QLatin1String(warnginfo)));
std::string str = codestr.toStdString();
- if(send_code(str.c_str())){
- HMI_ERROR("HomescreenConnect", "send_code error.");
+ amazonCode = str.c_str();
+ if(send_code(amazonCode)){
+ emit retryStart();
+ HMI_ERROR("HomescreenConnect", "send_code error.");
}
emit stopTimer();
}
@@ -246,12 +252,34 @@ int HomescreenConnect::send_code(const char *str)
int ret = afb_wsj1_call_j(sp_websock, CARLACLIENTAPI, "set_amazon_code", obj, _on_reply_static, this);
if (ret < 0) {
- HMI_ERROR("HomescreenConnect","Failed to call set_amazon_code verb");
+ retrycount++;
+ HMI_ERROR("HomescreenConnect","Failed to call set_amazon_code verb");
+ }else{
+ retrycount = 0;
}
return ret;
}
+void HomescreenConnect::resendCode(void)
+{
+ HMI_DEBUG("HomescreenConnect"," resendCode,%s",amazonCode);
+ if(send_code(amazonCode)){
+ if(retrycount >= RETRYCOUNT){
+ retrycount = 0;
+ retrytimer->stop();
+ HMI_ERROR("HomescreenConnect", "resend_code 60s timeout.");
+ }
+ }else{
+ retrytimer->stop();
+ }
+}
+
+void HomescreenConnect::startTimer(void)
+{
+ retrytimer->start(1000);
+}
+
void HomescreenConnect::stopGetCode(void)
{
timer->stop();
diff --git a/homescreen/src/homescreenconnect.h b/homescreen/src/homescreenconnect.h
index badc86a..8504992 100644
--- a/homescreen/src/homescreenconnect.h
+++ b/homescreen/src/homescreenconnect.h
@@ -51,9 +51,12 @@ signals:
void statusChanged(bool status);
void showInformation(QString info);
void stopTimer(void);
+ void retryStart(void);
private slots:
void subscribe(void);
void stopGetCode(void);
+ void resendCode(void);
+ void startTimer(void);
private:
int initialize_websocket(void);
@@ -65,7 +68,10 @@ private:
std::string muri;
int mport = 2000;
std::string mtoken = "hs";
+ const char *amazonCode;
QTimer *timer;
+ QTimer *retrytimer;
+ int retrycount;
};
#endif // HOMESCREENCONNECT_H