From 380a16f9ddd46b477c1292cdc71ca421a94742fc Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Fri, 26 May 2017 17:11:32 -0400 Subject: [PATCH] use SYSTEM_TABLET static --- interface/src/Application.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f7628ee240..99b8573917 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -245,6 +245,8 @@ Setting::Handle maxOctreePacketsPerSecond("maxOctreePPS", DEFAULT_MAX_OCTRE static const QString MARKETPLACE_CDN_HOSTNAME = "mpassets.highfidelity.com"; +static const QString SYSTEM_TABLET = "com.highfidelity.interface.tablet.system"; + const QHash Application::_acceptedExtensions { { SVO_EXTENSION, &Application::importSVOFromURL }, { SVO_JSON_EXTENSION, &Application::importSVOFromURL }, @@ -1523,7 +1525,7 @@ QString Application::getUserAgent() { void Application::toggleTabletUI() const { auto tabletScriptingInterface = DependencyManager::get(); auto hmd = DependencyManager::get(); - TabletProxy* tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); + TabletProxy* tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); bool messageOpen = tablet->isMessageDialogOpen(); if (!messageOpen || (messageOpen && !hmd->getShouldShowTablet())) { auto HMD = DependencyManager::get(); @@ -2295,7 +2297,7 @@ void Application::showHelp() { queryString.addQueryItem("handControllerName", handControllerName); queryString.addQueryItem("defaultTab", defaultTab); auto tabletScriptingInterface = DependencyManager::get(); - TabletProxy* tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); + TabletProxy* tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); tablet->gotoWebScreen(INFO_HELP_PATH + "?" + queryString.toString()); //InfoView::show(INFO_HELP_PATH, false, queryString.toString()); } @@ -5766,7 +5768,7 @@ void Application::toggleRunningScriptsWidget() const { auto scriptEngines = DependencyManager::get(); bool scriptsRunning = !scriptEngines->getRunningScripts().isEmpty(); auto tabletScriptingInterface = DependencyManager::get(); - auto tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); + auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); if (tablet->getToolbarMode() || false == scriptsRunning) { static const QUrl url("hifi/dialogs/RunningScripts.qml"); @@ -5815,7 +5817,7 @@ void Application::showAssetServerWidget(QString filePath) { } }; auto tabletScriptingInterface = DependencyManager::get(); - auto tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); + auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); auto hmd = DependencyManager::get(); if (tablet->getToolbarMode()) { DependencyManager::get()->show(url, "AssetServer", startUpload); @@ -5852,7 +5854,7 @@ void Application::addAssetToWorldFromURL(QString url) { void Application::showDialog(const QString& desktopURL, const QString& tabletURL, const QString& name) const { auto tabletScriptingInterface = DependencyManager::get(); - auto tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); + auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); auto hmd = DependencyManager::get(); if (tablet->getToolbarMode()) { DependencyManager::get()->show(desktopURL, name); @@ -6348,7 +6350,7 @@ void Application::loadScriptURLDialog() const { void Application::loadLODToolsDialog() { auto tabletScriptingInterface = DependencyManager::get(); - auto tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); + auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !isHMDMode())) { auto dialogsManager = DependencyManager::get(); dialogsManager->lodTools(); @@ -6360,7 +6362,7 @@ void Application::loadLODToolsDialog() { void Application::loadEntityStatisticsDialog() { auto tabletScriptingInterface = DependencyManager::get(); - auto tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); + auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !isHMDMode())) { auto dialogsManager = DependencyManager::get(); dialogsManager->octreeStatsDetails(); @@ -6371,7 +6373,7 @@ void Application::loadEntityStatisticsDialog() { void Application::loadDomainConnectionDialog() { auto tabletScriptingInterface = DependencyManager::get(); - auto tablet = dynamic_cast(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system")); + auto tablet = dynamic_cast(tabletScriptingInterface->getTablet(SYSTEM_TABLET)); if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !isHMDMode())) { auto dialogsManager = DependencyManager::get(); dialogsManager->showDomainConnectionDialog();