Merge pull request from danteruiz/interstitalMerged

handle unable to connect to domain case
This commit is contained in:
Wayne Chen 2018-09-10 17:23:50 -07:00 committed by GitHub
commit 60a5b0eeaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -346,6 +346,7 @@ public slots:
bool importEntities(const QString& url);
void updateThreadPoolCount() const;
void updateSystemTabletMode();
void goToErrorDomainURL(QUrl errorDomainURL);
Q_INVOKABLE void loadDialog();
Q_INVOKABLE void loadScriptURLDialog() const;
@ -474,7 +475,6 @@ private slots:
void setSessionUUID(const QUuid& sessionUUID) const;
void domainURLChanged(QUrl domainURL);
void goToErrorDomainURL(QUrl errorDomainURL);
void updateWindowTitle() const;
void nodeAdded(SharedNodePointer node) const;
void nodeActivated(SharedNodePointer node);

View file

@ -11,16 +11,19 @@
#include "ConnectionMonitor.h"
#include "Application.h"
#include "ui/DialogsManager.h"
#include <DependencyManager.h>
#include <DomainHandler.h>
#include <AddressManager.h>
#include <NodeList.h>
// Because the connection monitor is created at startup, the time we wait on initial load
// should be longer to allow the application to initialize.
static const int ON_INITIAL_LOAD_DISPLAY_AFTER_DISCONNECTED_FOR_X_MS = 10000;
static const int DISPLAY_AFTER_DISCONNECTED_FOR_X_MS = 5000;
static const QString ERROR_DOMAIN_URL = "file:///~/serverless/redirect.json";
void ConnectionMonitor::init() {
// Connect to domain disconnected message
@ -38,6 +41,7 @@ void ConnectionMonitor::init() {
connect(&_timer, &QTimer::timeout, this, []() {
qDebug() << "ConnectionMonitor: Showing connection failure window";
qApp->goToErrorDomainURL(REDIRECT_HIFI_ADDRESS);
});
}