diff --git a/gvr-interface/src/GVRMainWindow.cpp b/gvr-interface/src/GVRMainWindow.cpp index c020b94dc3..8a5731260b 100644 --- a/gvr-interface/src/GVRMainWindow.cpp +++ b/gvr-interface/src/GVRMainWindow.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #ifndef ANDROID @@ -142,6 +143,12 @@ void GVRMainWindow::showLoginDialog() { // have the acccount manager handle credentials from LoginDialog AccountManager& accountManager = AccountManager::getInstance(); connect(loginDialog, &LoginDialog::credentialsEntered, &accountManager, &AccountManager::requestAccessToken); + connect(&accountManager, &AccountManager::loginFailed, this, &GVRMainWindow::showLoginFailure); _mainLayout->addWidget(loginDialog); } + +void GVRMainWindow::showLoginFailure() { + QMessageBox::warning(this, "Login Failed", + "Could not log in with that username and password. Please try again!"); +} diff --git a/gvr-interface/src/GVRMainWindow.h b/gvr-interface/src/GVRMainWindow.h index 79017196dd..9499049073 100644 --- a/gvr-interface/src/GVRMainWindow.h +++ b/gvr-interface/src/GVRMainWindow.h @@ -31,6 +31,8 @@ public slots: void showAddressBar(); void showLoginDialog(); + void showLoginFailure(); + #if defined(ANDROID) && defined(HAVE_LIBOVR) OVR::KeyState& getBackKeyState() { return _backKeyState; } #endif diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7bccab8267..294da45af3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -341,9 +341,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : auto dialogsManager = DependencyManager::get(); connect(&accountManager, &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog); connect(&accountManager, &AccountManager::usernameChanged, this, &Application::updateWindowTitle); - - // once we have a profile in account manager make sure we generate a new keypair - connect(&accountManager, &AccountManager::profileChanged, &accountManager, &AccountManager::generateNewKeypair); // set the account manager's root URL and trigger a login request if we don't have the access token accountManager.setAuthURL(DEFAULT_NODE_AUTH_URL); diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index 3378037899..df8e226185 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -79,6 +79,9 @@ AccountManager::AccountManager() : qRegisterMetaType("QHttpMultiPart*"); connect(&_accountInfo, &DataServerAccountInfo::balanceChanged, this, &AccountManager::accountInfoBalanceChanged); + + // once we have a profile in account manager make sure we generate a new keypair + connect(this, &AccountManager::profileChanged, this, &AccountManager::generateNewKeypair); } const QString DOUBLE_SLASH_SUBSTITUTE = "slashslash";