Method to show appropriate desktop or tablet dialog

This commit is contained in:
David Rowe 2017-03-09 09:55:47 +13:00
parent 66d44ac6f0
commit 1e3c717fd4
2 changed files with 12 additions and 0 deletions

View file

@ -5862,6 +5862,16 @@ void Application::addAssetToWorldFromURL(QString url) {
request->send();
}
void Application::showDialog(const QString& desktopURL, const QString& tabletURL, const QString& name) const {
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !isHMDMode())) {
DependencyManager::get<OffscreenUi>()->show(desktopURL, name);
} else {
tablet->loadQMLSource(tabletURL);
}
}
void Application::addAssetToWorldFromURLRequestFinished() {
auto request = qobject_cast<ResourceRequest*>(sender());
auto url = request->getUrl().toString();

View file

@ -333,6 +333,8 @@ public slots:
void toggleRunningScriptsWidget() const;
Q_INVOKABLE void showAssetServerWidget(QString filePath = "");
void showDialog(const QString& desktopURL, const QString& tabletURL, const QString& name) const;
// FIXME: Move addAssetToWorld* methods to own class?
void addAssetToWorldFromURL(QString url);
void addAssetToWorldFromURLRequestFinished();