summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-07-10 12:29:52 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-07-10 12:32:09 +0900
commitb4db06287bc997ded71deab50ff0ff5889b09e1f (patch)
tree541af9f97391f5a71da4ebd16d65229173b44c3c
parent63e7ab867c75ac550b923815955e6dae3f0da984 (diff)
Change WindowManager Event Visible to ScreenUpdated
WindowManager had change the event visible from broadcast to private. So HomeScreen can not use it for block shortcut icon areas. Using ScreenUpdated instead of Visible. Change-Id: Iae11e8abe8531397dccb7797274980b99b7a35bc Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
-rw-r--r--homescreen/src/main.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp
index fbb430f..19bb0d3 100644
--- a/homescreen/src/main.cpp
+++ b/homescreen/src/main.cpp
@@ -104,15 +104,15 @@ int main(int argc, char *argv[])
layoutHandler->endDraw(QString("HomeScreen"));
});
- layoutHandler->set_event_handler(QLibWindowmanager::Event_Visible, [layoutHandler, launcher](json_object *object) {
- QString label = QString(json_object_get_string( json_object_object_get(object, "drawing_name") ));
- qDebug() << label;
- QMetaObject::invokeMethod(launcher, "setCurrent", Qt::QueuedConnection, Q_ARG(QString, label == "HomeScreen" ? "Home" : label));
- });
-
- layoutHandler->set_event_handler(QLibWindowmanager::Event_Invisible, [layoutHandler, launcher](json_object *object) {
- const char* label = json_object_get_string( json_object_object_get(object, "drawing_name") );
- HMI_DEBUG("HomeScreen", "surface %s Event_Invisible", label);
+ layoutHandler->set_event_handler(QLibWindowmanager::Event_ScreenUpdated, [layoutHandler, launcher](json_object *object) {
+ json_object *jarray = json_object_object_get(object, "ids");
+ int arrLen = json_object_array_length(jarray);
+ for( int idx = 0; idx < arrLen; idx++)
+ {
+ QString label = QString(json_object_get_string( json_object_array_get_idx(jarray, idx) ));
+ HMI_DEBUG("HomeScreen","Event_ScreenUpdated application: %s.", label.toStdString().c_str());
+ QMetaObject::invokeMethod(launcher, "setCurrent", Qt::QueuedConnection, Q_ARG(QString, label));
+ }
});
HomescreenHandler* homescreenHandler = new HomescreenHandler();