diff options
author | tiansen <tian_sen@dl.cn.nexty-ele.com> | 2018-11-02 10:31:57 +0800 |
---|---|---|
committer | tiansen <tian_sen@dl.cn.nexty-ele.com> | 2018-11-02 10:31:57 +0800 |
commit | d3c564e46f7bc80575271f91b3477a47e6f4d127 (patch) | |
tree | 5c910ac3e9e5fedf7c25da5edd3e5a5f20125aea /launcher/src/main.cpp | |
parent | 471a8288f833334e38f3d999c8921c8585280dc9 (diff) |
horizontal
Diffstat (limited to 'launcher/src/main.cpp')
-rw-r--r-- | launcher/src/main.cpp | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp index 91a1d80..937e909 100644 --- a/launcher/src/main.cpp +++ b/launcher/src/main.cpp @@ -100,8 +100,6 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - AGLScreenInfo screenInfo(layoutHandler->get_scale_factor()); - if (layoutHandler->requestSurface(myname) != 0) { exit(EXIT_FAILURE); } @@ -121,21 +119,6 @@ int main(int argc, char *argv[]) HMI_DEBUG("launch", "surface %s Event_Invisible", label); }); - homescreenHandler->init(port, token.toStdString().c_str()); - - homescreenHandler->set_event_handler(QLibHomeScreen::Event_TapShortcut, [layoutHandler, myname](json_object *object){ - json_object *appnameJ = nullptr; - if(json_object_object_get_ex(object, "application_name", &appnameJ)) - { - const char *appname = json_object_get_string(appnameJ); - if(myname == appname) - { - qDebug("Surface %s got tapShortcut\n", appname); - layoutHandler->activateSurface(myname); - } - } - }); - QUrl bindingAddress; bindingAddress.setScheme(QStringLiteral("ws")); bindingAddress.setHost(QStringLiteral("localhost")); @@ -158,15 +141,29 @@ int main(int argc, char *argv[]) // mail.qml loading QQmlApplicationEngine engine; - engine.rootContext()->setContextProperty(QStringLiteral("layoutHandler"), layoutHandler); - engine.rootContext()->setContextProperty(QStringLiteral("homescreenHandler"), homescreenHandler); - engine.rootContext()->setContextProperty(QStringLiteral("launcher"), launcher); - engine.rootContext()->setContextProperty(QStringLiteral("screenInfo"), &screenInfo); + engine.rootContext()->setContextProperty("layoutHandler", layoutHandler); + engine.rootContext()->setContextProperty("homescreenHandler", homescreenHandler); + engine.rootContext()->setContextProperty("launcher", launcher); engine.load(QUrl(QStringLiteral("qrc:/Launcher.qml"))); QObject *root = engine.rootObjects().first(); QQuickWindow *window = qobject_cast<QQuickWindow *>(root); QObject::connect(window, SIGNAL(frameSwapped()), layoutHandler, SLOT(slotActivateSurface())); + homescreenHandler->init(port, token.toStdString().c_str()); + + homescreenHandler->set_event_handler(QLibHomeScreen::Event_TapShortcut, [layoutHandler, myname](json_object *object){ + json_object *appnameJ = nullptr; + if(json_object_object_get_ex(object, "application_name", &appnameJ)) + { + const char *appname = json_object_get_string(appnameJ); + if(myname == appname) + { + qDebug("Surface %s got tapShortcut\n", appname); + layoutHandler->activateSurface(myname); + } + } + }); + return a.exec(); } |