cant call gotohomescreen when tablet is closed
Showing the changes to libraries/script-engine/src/TabletScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -287,7 +287,8 @@ void TabletProxy::setQmlTabletRoot(QQuickItem* qmlTabletRoot, QObject* qmlOffscr · 286 unmodified lines | ||
| 287 | 287 | QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, QVariant(TABLET_SOURCE_URL))); |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | − gotoHomeScreen(); | |
| 290 | + // force to the tablet to go to the homescreen | |
| 291 | + loadHomeScreen(true); | |
| 291 | 292 | |
| 292 | 293 | QMetaObject::invokeMethod(_qmlTabletRoot, "setUsername", Q_ARG(const QVariant&, QVariant(getUsername()))); |
| 293 | 294 | |
| @@ -305,6 +306,9 @@ void TabletProxy::setQmlTabletRoot(QQuickItem* qmlTabletRoot, QObject* qmlOffscr · 11 unmodified lines | ||
| 305 | 306 | } |
| 306 | 307 | } |
| 307 | 308 | |
| 309 | +void TabletProxy::gotoHomeScreen() { | |
| 310 | + loadHomeScreen(false); | |
| 311 | +} | |
| 308 | 312 | void TabletProxy::gotoMenuScreen(const QString& submenu) { |
| 309 | 313 | |
| 310 | 314 | QObject* root = nullptr; |
| @@ -388,8 +392,8 @@ void TabletProxy::popFromStack() { · 77 unmodified lines | ||
| 388 | 392 | } |
| 389 | 393 | } |
| 390 | 394 | |
| 391 | −void TabletProxy::gotoHomeScreen() { | |
| 392 | − if (_state != State::Home) { | |
| 395 | +void TabletProxy::loadHomeScreen(bool forceOntoHomeScreen) { | |
| 396 | + if (_state != State::Home && ( _state != State::Uninitialized || forceOntoHomeScreen)) { | |
| 393 | 397 | if (!_toolbarMode && _qmlTabletRoot) { |
| 394 | 398 | auto loader = _qmlTabletRoot->findChild<QQuickItem*>("loader"); |
| 395 | 399 | QObject::connect(loader, SIGNAL(loaded()), this, SLOT(addButtonsToHomeScreen()), Qt::DirectConnection); |