mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 20:54:25 +02:00
Closing the open tablet dialog - try harder
This commit is contained in:
parent
7598c7aaf3
commit
7d1d7f7bcd
4 changed files with 34 additions and 1 deletions
|
@ -65,6 +65,18 @@ Item {
|
|||
return false;
|
||||
}
|
||||
|
||||
function closeDialog() {
|
||||
if (openMessage != null) {
|
||||
openMessage.destroy();
|
||||
openMessage = null;
|
||||
}
|
||||
|
||||
if (openModal != null) {
|
||||
openModal.destroy();
|
||||
openModal = null;
|
||||
}
|
||||
}
|
||||
|
||||
function isUrlLoaded(url) {
|
||||
if (currentApp >= 0) {
|
||||
var currentAppUrl = tabletApps.get(currentApp).appUrl;
|
||||
|
|
|
@ -97,7 +97,8 @@ void DialogsManager::setDomainConnectionFailureVisibility(bool visible) {
|
|||
if (!hmd->getShouldShowTablet()) {
|
||||
hmd->openTablet();
|
||||
}
|
||||
} else {
|
||||
} else if (tablet->isPathLoaded(url)) {
|
||||
tablet->closeDialog();
|
||||
tablet->gotoHomeScreen();
|
||||
hmd->closeTablet();
|
||||
}
|
||||
|
|
|
@ -431,6 +431,20 @@ bool TabletProxy::isMessageDialogOpen() {
|
|||
return result.toBool();
|
||||
}
|
||||
|
||||
void TabletProxy::closeDialog() {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
bool result = false;
|
||||
QMetaObject::invokeMethod(this, "isMessageDialogOpen");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_qmlTabletRoot) {
|
||||
return;
|
||||
}
|
||||
|
||||
QMetaObject::invokeMethod(_qmlTabletRoot, "closeDialog");
|
||||
}
|
||||
|
||||
void TabletProxy::emitWebEvent(const QVariant& msg) {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QMetaObject::invokeMethod(this, "emitWebEvent", Q_ARG(QVariant, msg));
|
||||
|
|
|
@ -308,6 +308,12 @@ public:
|
|||
*/
|
||||
Q_INVOKABLE bool isMessageDialogOpen();
|
||||
|
||||
/**jsdoc
|
||||
* Close any open dialogs.
|
||||
* @function TabletProxy#closeDialog
|
||||
*/
|
||||
Q_INVOKABLE void closeDialog();
|
||||
|
||||
/**jsdoc
|
||||
* Creates a new button, adds it to this and returns it.
|
||||
* @function TabletProxy#addButton
|
||||
|
|
Loading…
Reference in a new issue