mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 21:18:06 +02:00
handle gvr-interface address lookup
This commit is contained in:
parent
17979d962f
commit
94a9bf52fa
7 changed files with 15 additions and 23 deletions
|
@ -15,7 +15,6 @@
|
|||
#include <QtWidgets/QApplication>
|
||||
|
||||
class RenderingClient;
|
||||
class GVRMainWindow;
|
||||
|
||||
#if defined(qApp)
|
||||
#undef qApp
|
||||
|
@ -26,14 +25,10 @@ class GVRInterface : public QApplication {
|
|||
Q_OBJECT
|
||||
public:
|
||||
GVRInterface(int argc, char* argv[]);
|
||||
|
||||
void setMainWindow(GVRMainWindow* mainWindow) { _mainWindow = mainWindow; }
|
||||
GVRMainWindow* getMainWindow() { return _mainWindow; }
|
||||
|
||||
|
||||
RenderingClient* getClient() { return _client; }
|
||||
|
||||
private:
|
||||
GVRMainWindow* _mainWindow;
|
||||
RenderingClient* _client;
|
||||
};
|
||||
|
||||
|
|
|
@ -9,9 +9,12 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QInputDialog>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
|
||||
#include "GVRInterface.h"
|
||||
#include <AddressManager.h>
|
||||
|
||||
#include "RenderingClient.h"
|
||||
|
||||
#include "GVRMainWindow.h"
|
||||
|
@ -31,6 +34,11 @@ GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
|||
fileMenu->addAction(goToAddress);
|
||||
helpMenu->addAction(aboutQt);
|
||||
|
||||
QObject::connect(goToAddress, &QAction::triggered, qApp->getClient(), &RenderingClient::showAddressBar);
|
||||
QObject::connect(goToAddress, &QAction::triggered, this, &GVRMainWindow::showAddressBar);
|
||||
QObject::connect(aboutQt, &QAction::triggered, qApp, &QApplication::aboutQt);
|
||||
}
|
||||
|
||||
void GVRMainWindow::showAddressBar() {
|
||||
QString addressString = QInputDialog::getText(centralWidget(), "Go to Address", "Address");
|
||||
DependencyManager::get<AddressManager>()->handleLookupString(addressString);
|
||||
}
|
|
@ -18,6 +18,8 @@ class GVRMainWindow : public QMainWindow {
|
|||
Q_OBJECT
|
||||
public:
|
||||
GVRMainWindow(QWidget* parent = 0);
|
||||
public slots:
|
||||
void showAddressBar();
|
||||
};
|
||||
|
||||
#endif // hifi_GVRMainWindow_h
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
|
||||
#include <QtWidgets/QInputDialog>
|
||||
|
||||
#include "GVRInterface.h"
|
||||
#include "GVRMainWindow.h"
|
||||
|
||||
#include "RenderingClient.h"
|
||||
|
||||
RenderingClient::RenderingClient(QObject *parent) :
|
||||
|
@ -21,9 +18,3 @@ RenderingClient::RenderingClient(QObject *parent) :
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
void RenderingClient::showAddressBar() {
|
||||
#ifdef Q_OS_ANDROID
|
||||
QString addressString = QInputDialog::getText(qApp->getMainWindow()->centralWidget(), "Go to Address", "Address");
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -19,8 +19,6 @@ class RenderingClient : public Client {
|
|||
Q_OBJECT
|
||||
public:
|
||||
RenderingClient(QObject* parent = 0);
|
||||
public slots:
|
||||
void showAddressBar();
|
||||
};
|
||||
|
||||
#endif // hifi_RenderingClient_h
|
||||
|
|
|
@ -18,7 +18,5 @@ int main(int argc, char* argv[]) {
|
|||
GVRMainWindow mainWindow;
|
||||
mainWindow.showMaximized();
|
||||
|
||||
app.setMainWindow(&mainWindow);
|
||||
|
||||
return app.exec();
|
||||
}
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "AccountManager.h"
|
||||
|
||||
const bool VERBOSE_HTTP_REQUEST_DEBUGGING = false;
|
||||
const bool VERBOSE_HTTP_REQUEST_DEBUGGING = true;
|
||||
|
||||
AccountManager& AccountManager::getInstance(bool forceReset) {
|
||||
static std::unique_ptr<AccountManager> sharedInstance(new AccountManager());
|
||||
|
@ -59,7 +59,7 @@ JSONCallbackParameters::JSONCallbackParameters(QObject* jsonCallbackReceiver, co
|
|||
}
|
||||
|
||||
AccountManager::AccountManager() :
|
||||
_authURL(),
|
||||
_authURL(DEFAULT_NODE_AUTH_URL),
|
||||
_pendingCallbackMap(),
|
||||
_accountInfo(),
|
||||
_shouldPersistToSettingsFile(true)
|
||||
|
|
Loading…
Reference in a new issue