Use loadQMlSource if no stack is aviable

This commit is contained in:
Dante Ruiz 2017-03-23 17:03:24 +01:00
parent 93341556ff
commit af97c7275e
3 changed files with 6 additions and 3 deletions

View file

@ -8,7 +8,6 @@ Item {
objectName: "tabletRoot"
property string username: "Unknown user"
property var eventBridge;
property var rootMenu;
property var openModal: null;
property var openMessage: null;

View file

@ -5848,10 +5848,14 @@ void Application::showDialog(const QString& desktopURL, const QString& tabletURL
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
auto hmd = DependencyManager::get<HMDScriptingInterface>();
if (tablet->getToolbarMode() || (!hmd->getShouldShowTablet() && !isHMDMode())) {
if (tablet->getToolbarMode()) {
DependencyManager::get<OffscreenUi>()->show(desktopURL, name);
} else {
tablet->pushOntoStack(tabletURL);
if (!hmd->getShouldShowTablet() && !isHMDMode()) {
hmd->openTablet();
}
}
}

View file

@ -358,7 +358,7 @@ void TabletProxy::pushOntoStack(const QVariant& path) {
if (stack) {
QMetaObject::invokeMethod(stack, "pushSource", Q_ARG(const QVariant&, path));
} else {
qCDebug(scriptengine) << "tablet cannot push QML because _qmlTabletRoot doesn't have child stack";
loadQMLSource(path);
}
} else if (_desktopWindow) {
auto stack = _desktopWindow->asQuickItem()->findChild<QQuickItem*>("stack");