History

toolbar work to better support tablet buttons

Anthony J. Thibault committed 9 years ago

Commit 67302cb1 parent ed11eda7 files · +70 −17Browse files

Showing the changes to libraries/script-engine/src/TabletScriptingInterface.cpp (1 of 7 files). Show all

Unified · Split

libraries/script-engine/src/TabletScriptingInterface.cpp+10−1
@@ -188,6 +188,8 @@ void TabletProxy::setToolbarMode(bool toolbarMode) { · 187 unmodified lines
188 _desktopWindow = tabletRootWindow;188 _desktopWindow = tabletRootWindow;
189 QMetaObject::invokeMethod(quickItem, "setShown", Q_ARG(const QVariant&, QVariant(false)));189 QMetaObject::invokeMethod(quickItem, "setShown", Q_ARG(const QVariant&, QVariant(false)));
190 190
191 QObject::connect(quickItem, SIGNAL(windowClosed()), this, SLOT(desktopWindowClosed()));
192
191 QObject::connect(tabletRootWindow, SIGNAL(webEventReceived(QVariant)), this, SIGNAL(webEventReceived(QVariant)));193 QObject::connect(tabletRootWindow, SIGNAL(webEventReceived(QVariant)), this, SIGNAL(webEventReceived(QVariant)));
192 194
193 // forward qml surface events to interface js195 // forward qml surface events to interface js
@@ -255,6 +257,13 @@ void TabletProxy::setQmlTabletRoot(QQuickItem* qmlTabletRoot, QObject* qmlOffscr · 61 unmodified lines
255 }257 }
256 });258 });
257 259
260 if (_toolbarMode) {
261 // if someone creates the tablet in toolbar mode, make sure to display the home screen on the tablet.
262 auto loader = _qmlTabletRoot->findChild<QQuickItem*>("loader");
263 QObject::connect(loader, SIGNAL(loaded()), this, SLOT(addButtonsToHomeScreen()), Qt::DirectConnection);
264 QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(TABLET_SOURCE_URL)));
265 }
266
258 gotoHomeScreen();267 gotoHomeScreen();
259 268
260 QMetaObject::invokeMethod(_qmlTabletRoot, "setUsername", Q_ARG(const QVariant&, QVariant(getUsername())));269 QMetaObject::invokeMethod(_qmlTabletRoot, "setUsername", Q_ARG(const QVariant&, QVariant(getUsername())));
@@ -633,7 +642,7 @@ void TabletButtonProxy::editProperties(QVariantMap properties) { · 372 unmodified lines
633 }642 }
634 643
635 if (_toolbarButtonProxy) {644 if (_toolbarButtonProxy) {
636 QMetaObject::invokeMethod(_toolbarButtonProxy, "editProperties", Qt::AutoConnection, Q_ARG(QVariant, properties));645 QMetaObject::invokeMethod(_toolbarButtonProxy, "editProperties", Qt::AutoConnection, Q_ARG(QVariantMap, properties));
637 }646 }
638}647}
639 648