mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 12:23:24 +02:00
make login screen show up on the tablet on startup
This commit is contained in:
parent
8a678dfb04
commit
f4255735a9
3 changed files with 23 additions and 5 deletions
|
@ -47,11 +47,11 @@ 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");
|
||||
qDebug() << "[DR] -> Push login onto the tablet";
|
||||
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