mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 05:27:07 +02:00
Merge pull request #10018 from druiz17/tablet-login
Show login screen in tablet at startup if not logged in and connecting to a domain that requires login
This commit is contained in:
commit
9c990b0358
3 changed files with 22 additions and 5 deletions
|
@ -47,11 +47,10 @@ void LoginDialog::showWithSelection()
|
|||
if (tablet->getToolbarMode()) {
|
||||
LoginDialog::show();
|
||||
} else {
|
||||
if (!hmd->getShouldShowTablet() && !qApp->isHMDMode()) {
|
||||
LoginDialog::show();
|
||||
} else {
|
||||
static const QUrl url("../../dialogs/TabletLoginDialog.qml");
|
||||
tablet->pushOntoStack(url);
|
||||
static const QUrl url("../../dialogs/TabletLoginDialog.qml");
|
||||
tablet->initialScreen(url);
|
||||
if (!hmd->getShouldShowTablet()) {
|
||||
hmd->openTablet();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -250,6 +250,15 @@ static QString getUsername() {
|
|||
}
|
||||
}
|
||||
|
||||
void TabletProxy::initialScreen(const QVariant& url) {
|
||||
if (getQmlTablet()) {
|
||||
pushOntoStack(url);
|
||||
} else {
|
||||
_initialScreen = true;
|
||||
_initialPath = url;
|
||||
}
|
||||
}
|
||||
|
||||
bool TabletProxy::isMessageDialogOpen() {
|
||||
if (_qmlTabletRoot) {
|
||||
QVariant result;
|
||||
|
@ -299,6 +308,11 @@ void TabletProxy::setQmlTabletRoot(QQuickItem* qmlTabletRoot, QObject* qmlOffscr
|
|||
QMetaObject::invokeMethod(_qmlTabletRoot, "setUsername", Q_ARG(const QVariant&, QVariant(getUsername())));
|
||||
}
|
||||
});
|
||||
|
||||
if (_initialScreen) {
|
||||
pushOntoStack(_initialPath);
|
||||
_initialScreen = false;
|
||||
}
|
||||
} else {
|
||||
removeButtonsFromHomeScreen();
|
||||
_state = State::Uninitialized;
|
||||
|
|
|
@ -97,6 +97,8 @@ public:
|
|||
bool getToolbarMode() const { return _toolbarMode; }
|
||||
void setToolbarMode(bool toolbarMode);
|
||||
|
||||
void initialScreen(const QVariant& url);
|
||||
|
||||
/**jsdoc
|
||||
* transition to the home screen
|
||||
* @function TabletProxy#gotoHomeScreen
|
||||
|
@ -213,6 +215,8 @@ protected:
|
|||
void addButtonsToToolbar();
|
||||
void removeButtonsFromToolbar();
|
||||
|
||||
bool _initialScreen { false };
|
||||
QVariant _initialPath { "" };
|
||||
QString _name;
|
||||
std::mutex _mutex;
|
||||
std::vector<QSharedPointer<TabletButtonProxy>> _tabletButtonProxies;
|
||||
|
|
Loading…
Reference in a new issue