Add onscreen title in replyShowWindow 55/20555/2 halibut 7.99.1 7.99.2 7.99.3 8.0.0 8.0.1 8.0.2 8.0.3 8.0.4 8.0.5 8.0.6 8.99.1 8.99.2 8.99.3 8.99.4 8.99.5 halibut/7.99.1 halibut/7.99.2 halibut/7.99.3 halibut/8.0.0 halibut/8.0.1 halibut/8.0.2 halibut/8.0.3 halibut/8.0.4 halibut/8.0.5 halibut/8.0.6 halibut_7.99.1 halibut_7.99.2 halibut_7.99.3 halibut_8.0.0 halibut_8.0.1 halibut_8.0.2 halibut_8.0.3 halibut_8.0.4 halibut_8.0.5 halibut_8.0.6 icefish/8.99.1 icefish/8.99.2 icefish/8.99.3 icefish/8.99.4 icefish/8.99.5 icefish_8.99.1 icefish_8.99.2 icefish_8.99.3 icefish_8.99.4 icefish_8.99.5
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Tue, 12 Mar 2019 07:56:03 +0000 (15:56 +0800)
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Thu, 14 Mar 2019 05:37:08 +0000 (13:37 +0800)
Only set buttonName information in replyShowWindow isn't enough
for application who have two onscreens with same button name.
So add onscreen title into replayShowWindow.

Bug-AGL: SPEC-1967

Change-Id: Ia695ed6d14ee49e6342f7600fdb2800da8b518c6
Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
app/Onscreen.qml
app/eventhandler.cpp
app/eventhandler.h

index cfad090..5e53f98 100644 (file)
@@ -96,7 +96,7 @@ Rectangle {
                 text: btn1Name
                 onReleased: {
                     btn1.highlighted = false
-                    eventHandler.onScreenReply(btn1.text)
+                    eventHandler.onScreenReply(title.text, btn1.text)
                 }
                 onPressed: {
                     btn1.highlighted = true
@@ -113,7 +113,7 @@ Rectangle {
                 text: btn2Name
                 onReleased: {
                     btn2.highlighted = false
-                    eventHandler.onScreenReply(btn2.text)
+                    eventHandler.onScreenReply(title.text, btn2.text)
                 }
                 onPressed: {
                     btn2.highlighted = true
@@ -130,7 +130,7 @@ Rectangle {
                 text: btn3Name
                 onReleased: {
                     btn3.highlighted = false
-                    eventHandler.onScreenReply(btn3.text)
+                    eventHandler.onScreenReply(title.text, btn3.text)
                 }
                 onPressed: {
                     btn3.highlighted = true
index c33022a..ff8617d 100644 (file)
@@ -29,6 +29,7 @@
 const char _myrole[] = "on_screen";
 const char _parameter[] = "parameter";
 const char _replyto[] = "replyto";
+const char _onscreen_title[] = "onscreenTitle";
 const char _button_name[] = "buttonName";
 const char _drawing_name[] = "drawing_name";
 const char _application_id[] = "application_id";
@@ -180,12 +181,13 @@ void EventHandler::deactivateWindow()
     }
 }
 
-void EventHandler::onScreenReply(const QString &btn_name)
+void EventHandler::onScreenReply(const QString &ons_title, const QString &btn_name)
 {
-    HMI_DEBUG(APP_ID, "EventHandler::onScreenReply(),btn_name=%s", btn_name.toStdString().c_str());
+    HMI_DEBUG(APP_ID, "ons_title=%s btn_name=%s", ons_title.toStdString().c_str(), btn_name.toStdString().c_str());
     emit this->hideOnScreen();
 
     struct json_object* j_param = json_object_new_object();
+    json_object_object_add(j_param, _onscreen_title, json_object_new_string(ons_title.toStdString().c_str()));
     json_object_object_add(j_param, _button_name, json_object_new_string(btn_name.toStdString().c_str()));
     mp_hs->replyShowWindow(m_dsp.first.toStdString().c_str(), j_param);
 }
index 567c8a9..bb75d9b 100644 (file)
@@ -45,7 +45,7 @@ public:
     static void onRep_static(struct json_object* reply_contents);
 
     Q_INVOKABLE void deactivateWindow();
-    Q_INVOKABLE void onScreenReply(const QString &btn_name);
+    Q_INVOKABLE void onScreenReply(const QString &ons_title, const QString &btn_name);
 
 signals:
     void updateModel(QVariant data);