add sendtohud
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>
Fri, 7 Jun 2019 01:22:09 +0000 (10:22 +0900)
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>
Fri, 7 Jun 2019 01:22:09 +0000 (10:22 +0900)
launcher/qml/Launcher.qml
launcher/src/homescreenhandler.cpp
launcher/src/homescreenhandler.h

index bab1933..034e05a 100644 (file)
@@ -166,7 +166,8 @@ ApplicationWindow {
                             console.log("sendAppToMeter", currentId)
                             homescreenHandler.sendAppToMeter(currentId)
                         } else if (loc.mouseX >= 270 && loc.mouseX < 540 ) {
-
+                            console.log("sendAppToHud", currentId)
+                            homescreenHandler.sendAppToHud(currentId)
                         } else if (loc.mouseX >= 540 && loc.mouseX < 810 ) {
 
                         } else if (loc.mouseX >= 810) {
index fb85cbd..2450ccb 100644 (file)
@@ -210,6 +210,18 @@ void HomescreenHandler::sendAppToMeter(QString application_id)
     mp_qhs->showWindow(application_id.section('@', 0, 0).toStdString().c_str(), j_json);
 }
 
+void HomescreenHandler::sendAppToHud(QString application_id)
+{
+    HMI_DEBUG("Launcher","sendAppToHud %s", application_id.toStdString().c_str());
+    struct json_object* j_json = json_object_new_object();
+    struct json_object* value;
+    value = json_object_new_string("hud.normal.full");
+    json_object_object_add(j_json, "area", value);
+
+    mp_qhs->showWindow(application_id.section('@', 0, 0).toStdString().c_str(), j_json);
+}
+
+
 void HomescreenHandler::getRunnables(void)
 {
     mp_qhs->getRunnables();
index e612331..a34a2a9 100644 (file)
@@ -41,6 +41,7 @@ public:
     Q_INVOKABLE void registerShortcut(QString shortcut_id, QString shortcut_name, QString position);
     Q_INVOKABLE int uninstallApplication(QString application_id);
     Q_INVOKABLE void sendAppToMeter(QString application_id);
+    Q_INVOKABLE void sendAppToHud(QString application_id);
 
     void onRep(struct json_object* reply_contents);