mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
creating login overlay upon startup in HMD/feedback changes
This commit is contained in:
parent
e266532888
commit
fe0bbe19d7
3 changed files with 18 additions and 15 deletions
|
@ -1214,7 +1214,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
|
||||
connect(&domainHandler, SIGNAL(domainURLChanged(QUrl)), SLOT(domainURLChanged(QUrl)));
|
||||
connect(&domainHandler, SIGNAL(redirectToErrorDomainURL(QUrl)), SLOT(goToErrorDomainURL(QUrl)));
|
||||
connect(this, SIGNAL(loginScreenStateChanged(bool)), &domainHandler, SLOT((loginScreenStateChanged(bool))));
|
||||
connect(&domainHandler, &DomainHandler::domainURLChanged, [](QUrl domainURL){
|
||||
setCrashAnnotation("domain", domainURL.toString().toStdString());
|
||||
});
|
||||
|
@ -1770,7 +1769,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
});
|
||||
|
||||
connect(offscreenUi.data(), &OffscreenUi::keyboardFocusActive, [this]() {
|
||||
initializeQml();
|
||||
#if !defined(Q_OS_ANDROID)
|
||||
// only for non-android. QML is ready to be shown at this time.
|
||||
showLoginScreen();
|
||||
#endif
|
||||
});
|
||||
|
||||
// Make sure we don't time out during slow operations at startup
|
||||
|
@ -2889,16 +2891,6 @@ void Application::showLoginScreen() {
|
|||
loginDialogPoppedUp.set(_loginDialogPoppedUp);
|
||||
}
|
||||
|
||||
void Application::initializeQml() {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "initializeQml");
|
||||
return;
|
||||
}
|
||||
#if !defined(Q_OS_ANDROID)
|
||||
showLoginScreen();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Application::initializeUi() {
|
||||
AddressBarDialog::registerType();
|
||||
ErrorDialog::registerType();
|
||||
|
@ -8498,7 +8490,8 @@ void Application::setShowBulletConstraintLimits(bool value) {
|
|||
}
|
||||
|
||||
void Application::checkReadyToCreateLoginDialogOverlay() {
|
||||
if (qApp->isHMDMode() && qApp->getLoginDialogPoppedUp() && _loginDialogOverlayID.isNull()) {
|
||||
if (qApp->isHMDMode() && qApp->getActiveDisplayPlugin()->isDisplayVisible() &&
|
||||
qApp->getLoginDialogPoppedUp() && _loginDialogOverlayID.isNull()) {
|
||||
createLoginDialogOverlay();
|
||||
_loginPointerManager.setUp();
|
||||
} else if (qApp->getLoginDialogPoppedUp()) {
|
||||
|
|
|
@ -148,7 +148,6 @@ public:
|
|||
void initializeGL();
|
||||
void initializeDisplayPlugins();
|
||||
void initializeRenderEngine();
|
||||
void initializeQml();
|
||||
void initializeUi();
|
||||
|
||||
void updateSecondaryCameraViewFrustum();
|
||||
|
|
|
@ -53,8 +53,13 @@ void LoginDialog::showWithSelection() {
|
|||
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
||||
|
||||
if (qApp->getLoginDialogPoppedUp()) {
|
||||
// user is not logged in but the login screen was displayed.
|
||||
QAction* loginAction = Menu::getInstance()->getActionForOption(MenuOption::Login);
|
||||
Q_CHECK_PTR(loginAction);
|
||||
loginAction->setEnabled(false);
|
||||
}
|
||||
if (!qApp->isHMDMode()) {
|
||||
|
||||
if (qApp->getLoginDialogPoppedUp()) {
|
||||
LoginDialog::show();
|
||||
return;
|
||||
|
@ -68,6 +73,7 @@ void LoginDialog::showWithSelection() {
|
|||
tablet->initialScreen(TABLET_LOGIN_DIALOG_URL);
|
||||
} else {
|
||||
// let Application handle creating login dialog overlay.
|
||||
qApp->checkReadyToCreateLoginDialogOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,6 +110,11 @@ bool LoginDialog::isSteamRunning() const {
|
|||
void LoginDialog::dismissLoginDialog() {
|
||||
// it'll only pop up once.
|
||||
qDebug() << "LoginDialog::dismissLoginDialog";
|
||||
|
||||
QAction* loginAction = Menu::getInstance()->getActionForOption(MenuOption::Login);
|
||||
Q_CHECK_PTR(loginAction);
|
||||
loginAction->setEnabled(true);
|
||||
|
||||
emit dismissedLoginDialog();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue