Пример #1
0
void LoginDialog::showWithSelection() {
    auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
    auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
    auto hmd = DependencyManager::get<HMDScriptingInterface>();

    if (!qApp->isHMDMode()) {
        if (qApp->getLoginDialogPoppedUp()) {
            LoginDialog::show();
            return;
        } else {
            if (!tablet->isPathLoaded(TABLET_LOGIN_DIALOG_URL)) {
                tablet->loadQMLSource(TABLET_LOGIN_DIALOG_URL);
            }
        }
    } else {
        if (!qApp->getLoginDialogPoppedUp()) {
            tablet->initialScreen(TABLET_LOGIN_DIALOG_URL);
        } else {
            qApp->createLoginDialogOverlay();
        }
    }

    if (!hmd->getShouldShowTablet()) {
        hmd->openTablet();
    }
}
Пример #2
0
void DialogsManager::hideAddressBar() {
    auto hmd = DependencyManager::get<HMDScriptingInterface>();
    auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
    auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));

    if (tablet->isPathLoaded(TABLET_ADDRESS_DIALOG)) {
        tablet->gotoHomeScreen();
        hmd->closeTablet();
    }
    qApp->setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
    setAddressBarVisible(false);
}
Пример #3
0
void DialogsManager::toggleAddressBar() {
    auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
    auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));

    const bool addressBarLoaded = tablet->isPathLoaded(TABLET_ADDRESS_DIALOG);

    if (_addressBarVisible || addressBarLoaded) {
        hideAddressBar();
    } else {
        showAddressBar();
    }
}
Пример #4
0
void DialogsManager::showAddressBar() {
    auto hmd = DependencyManager::get<HMDScriptingInterface>();
    auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
    auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));

    if (!tablet->isPathLoaded(TABLET_ADDRESS_DIALOG)) {
        tablet->loadQMLSource(TABLET_ADDRESS_DIALOG);
    }
    if (!hmd->getShouldShowTablet()) {
        hmd->openTablet();
    }
    qApp->setKeyboardFocusOverlay(hmd->getCurrentTabletScreenID());
    setAddressBarVisible(true);
}
Пример #5
0
bool AvatarPackager::open() {
    const auto packageModelDialogCreated = [=](QQmlContext* context, QObject* newObject) {
        context->setContextProperty("AvatarPackagerCore", this);
    };

    static const QString SYSTEM_TABLET = "com.highfidelity.interface.tablet.system";
    auto tablet = dynamic_cast<TabletProxy*>(DependencyManager::get<TabletScriptingInterface>()->getTablet(SYSTEM_TABLET));

    if (tablet->getToolbarMode()) {
        static const QUrl url{ "hifi/AvatarPackagerWindow.qml" };
        DependencyManager::get<OffscreenUi>()->show(url, "AvatarPackager", packageModelDialogCreated);
        return true;
    }

    static const QUrl url{ "hifi/tablet/AvatarPackager.qml" };
    if (!tablet->isPathLoaded(url)) {
        tablet->getTabletSurface()->getSurfaceContext()->setContextProperty("AvatarPackagerCore", this);
        tablet->pushOntoStack(url);
        return true;
    }

    return false;
}