summaryrefslogtreecommitdiffstats
path: root/homescreen
diff options
context:
space:
mode:
Diffstat (limited to 'homescreen')
-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();