History

better way to determine if we can go to the homescreen

Dante Ruiz committed 9 years ago

Commit 6acf2341 parent 656720a2 files · +8 −3Browse files

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

Unified · Split

libraries/script-engine/src/TabletScriptingInterface.cpp+7−3
@@ -275,7 +275,8 @@ void TabletProxy::setQmlTabletRoot(QQuickItem* qmlTabletRoot, QObject* qmlOffscr · 274 unmodified lines
275275 QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(TABLET_SOURCE_URL)));
276276 }
277277
278− gotoHomeScreen();
278+ // force to the tablet to go to the homescreen
279+ gotoHomeScreen(true);
279280
280281 QMetaObject::invokeMethod(_qmlTabletRoot, "setUsername", Q_ARG(const QVariant&, QVariant(getUsername())));
281282
@@ -293,6 +294,9 @@ void TabletProxy::setQmlTabletRoot(QQuickItem* qmlTabletRoot, QObject* qmlOffscr · 11 unmodified lines
293294 }
294295 }
295296
297+void TabletProxy::gotoHomeScreen() {
298+ gotoHomeScreen(false);
299+}
296300 void TabletProxy::gotoMenuScreen(const QString& submenu) {
297301
298302 QObject* root = nullptr;
@@ -334,8 +338,8 @@ void TabletProxy::loadQMLSource(const QVariant& path) { · 35 unmodified lines
334338 }
335339 }
336340
337−void TabletProxy::gotoHomeScreen() {
338− if (_state != State::Home || _state != State::Uninitialized) {
341+void TabletProxy::gotoHomeScreen(bool forceOntoHomeScreen) {
342+ if (_state != State::Home && ( _state != State::Uninitialized || forceOntoHomeScreen)) {
339343 if (!_toolbarMode && _qmlTabletRoot) {
340344 auto loader = _qmlTabletRoot->findChild<QQuickItem*>("loader");
341345 QObject::connect(loader, SIGNAL(loaded()), this, SLOT(addButtonsToHomeScreen()), Qt::DirectConnection);