Only take down tablet if it was brought up

This commit is contained in:
Simon Walton 2018-06-01 10:41:08 -07:00
parent 2d9a5c62c1
commit f58e1ebdd9
2 changed files with 6 additions and 1 deletions

View file

@ -93,6 +93,7 @@ void DialogsManager::setDomainConnectionFailureVisibility(bool visible) {
static const QUrl url("dialogs/TabletConnectionFailureDialog.qml");
auto hmd = DependencyManager::get<HMDScriptingInterface>();
if (visible) {
_dialogCreatedWhileShown = tablet->property("tabletShown").toBool();
tablet->initialScreen(url);
if (!hmd->getShouldShowTablet()) {
hmd->openTablet();
@ -100,8 +101,11 @@ void DialogsManager::setDomainConnectionFailureVisibility(bool visible) {
} else if (tablet->isPathLoaded(url)) {
tablet->closeDialog();
tablet->gotoHomeScreen();
if (!_dialogCreatedWhileShown) {
hmd->closeTablet();
}
_dialogCreatedWhileShown = false;
}
}
}

View file

@ -80,6 +80,7 @@ private:
QPointer<OctreeStatsDialog> _octreeStatsDialog;
QPointer<TestingDialog> _testingDialog;
QPointer<DomainConnectionDialog> _domainConnectionDialog;
bool _dialogCreatedWhileShown { false };
bool _addressBarVisible { false };
};