From 8d4b3274086f658d7cd2bfa344491bfeb66b1a1e Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Fri, 7 Jun 2019 10:22:09 +0900 Subject: add sendtohud --- launcher/qml/Launcher.qml | 3 ++- launcher/src/homescreenhandler.cpp | 12 ++++++++++++ launcher/src/homescreenhandler.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/launcher/qml/Launcher.qml b/launcher/qml/Launcher.qml index bab1933..034e05a 100644 --- a/launcher/qml/Launcher.qml +++ b/launcher/qml/Launcher.qml @@ -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) { diff --git a/launcher/src/homescreenhandler.cpp b/launcher/src/homescreenhandler.cpp index fb85cbd..2450ccb 100644 --- a/launcher/src/homescreenhandler.cpp +++ b/launcher/src/homescreenhandler.cpp @@ -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(); diff --git a/launcher/src/homescreenhandler.h b/launcher/src/homescreenhandler.h index e612331..a34a2a9 100644 --- a/launcher/src/homescreenhandler.h +++ b/launcher/src/homescreenhandler.h @@ -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); -- cgit 1.2.3-korg