mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 07:12:40 +02:00
Intial commit. Basically works. Need some testing
This commit is contained in:
parent
45e83906e7
commit
209de29b2a
2 changed files with 50 additions and 3 deletions
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// TabletConnectionFailureDialog.qml
|
||||
//
|
||||
// Created by Vlad Stelmahovsky on 29 Mar 2017
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
import Hifi 1.0
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Dialogs 1.2 as OriginalDialogs
|
||||
|
||||
Item {
|
||||
Component.onCompleted: {
|
||||
var object = tabletRoot.messageBox({
|
||||
icon: OriginalDialogs.StandardIcon.Warning,
|
||||
buttons: OriginalDialogs.StandardButton.Ok,
|
||||
defaultButton: OriginalDialogs.StandardButton.NoButton,
|
||||
title: "No Connection",
|
||||
text: "Unable to connect to this domain. Click the 'GO TO' button on the toolbar to visit another domain."
|
||||
});
|
||||
object.selected.connect(function(button) {
|
||||
if (button === OriginalDialogs.StandardButton.Ok) {
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
tablet.gotoHomeScreen()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -60,10 +60,25 @@ void DialogsManager::showFeed() {
|
|||
}
|
||||
|
||||
void DialogsManager::setDomainConnectionFailureVisibility(bool visible) {
|
||||
if (visible) {
|
||||
ConnectionFailureDialog::show();
|
||||
qDebug() << "DialogsManager::setDomainConnectionFailureVisibility: visible" << visible;
|
||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||
|
||||
if (tablet->getToolbarMode()) {
|
||||
if (visible) {
|
||||
ConnectionFailureDialog::show();
|
||||
} else {
|
||||
ConnectionFailureDialog::hide();
|
||||
}
|
||||
} else {
|
||||
ConnectionFailureDialog::hide();
|
||||
static const QUrl url("../../dialogs/TabletConnectionFailureDialog.qml");
|
||||
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
||||
if (visible) {
|
||||
tablet->initialScreen(url);
|
||||
if (!hmd->getShouldShowTablet()) {
|
||||
hmd->openTablet();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue