mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 20:56:52 +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>
|
#include <QtWidgets/QApplication>
|
||||||
|
|
||||||
class RenderingClient;
|
class RenderingClient;
|
||||||
class GVRMainWindow;
|
|
||||||
|
|
||||||
#if defined(qApp)
|
#if defined(qApp)
|
||||||
#undef qApp
|
#undef qApp
|
||||||
|
@ -26,14 +25,10 @@ class GVRInterface : public QApplication {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GVRInterface(int argc, char* argv[]);
|
GVRInterface(int argc, char* argv[]);
|
||||||
|
|
||||||
void setMainWindow(GVRMainWindow* mainWindow) { _mainWindow = mainWindow; }
|
|
||||||
GVRMainWindow* getMainWindow() { return _mainWindow; }
|
|
||||||
|
|
||||||
RenderingClient* getClient() { return _client; }
|
RenderingClient* getClient() { return _client; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GVRMainWindow* _mainWindow;
|
|
||||||
RenderingClient* _client;
|
RenderingClient* _client;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,12 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// 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 <QtWidgets/QMenuBar>
|
||||||
|
|
||||||
#include "GVRInterface.h"
|
#include <AddressManager.h>
|
||||||
|
|
||||||
#include "RenderingClient.h"
|
#include "RenderingClient.h"
|
||||||
|
|
||||||
#include "GVRMainWindow.h"
|
#include "GVRMainWindow.h"
|
||||||
|
@ -31,6 +34,11 @@ GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
||||||
fileMenu->addAction(goToAddress);
|
fileMenu->addAction(goToAddress);
|
||||||
helpMenu->addAction(aboutQt);
|
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);
|
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
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GVRMainWindow(QWidget* parent = 0);
|
GVRMainWindow(QWidget* parent = 0);
|
||||||
|
public slots:
|
||||||
|
void showAddressBar();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_GVRMainWindow_h
|
#endif // hifi_GVRMainWindow_h
|
||||||
|
|
|
@ -11,9 +11,6 @@
|
||||||
|
|
||||||
#include <QtWidgets/QInputDialog>
|
#include <QtWidgets/QInputDialog>
|
||||||
|
|
||||||
#include "GVRInterface.h"
|
|
||||||
#include "GVRMainWindow.h"
|
|
||||||
|
|
||||||
#include "RenderingClient.h"
|
#include "RenderingClient.h"
|
||||||
|
|
||||||
RenderingClient::RenderingClient(QObject *parent) :
|
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
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
RenderingClient(QObject* parent = 0);
|
RenderingClient(QObject* parent = 0);
|
||||||
public slots:
|
|
||||||
void showAddressBar();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_RenderingClient_h
|
#endif // hifi_RenderingClient_h
|
||||||
|
|
|
@ -18,7 +18,5 @@ int main(int argc, char* argv[]) {
|
||||||
GVRMainWindow mainWindow;
|
GVRMainWindow mainWindow;
|
||||||
mainWindow.showMaximized();
|
mainWindow.showMaximized();
|
||||||
|
|
||||||
app.setMainWindow(&mainWindow);
|
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#include "AccountManager.h"
|
#include "AccountManager.h"
|
||||||
|
|
||||||
const bool VERBOSE_HTTP_REQUEST_DEBUGGING = false;
|
const bool VERBOSE_HTTP_REQUEST_DEBUGGING = true;
|
||||||
|
|
||||||
AccountManager& AccountManager::getInstance(bool forceReset) {
|
AccountManager& AccountManager::getInstance(bool forceReset) {
|
||||||
static std::unique_ptr<AccountManager> sharedInstance(new AccountManager());
|
static std::unique_ptr<AccountManager> sharedInstance(new AccountManager());
|
||||||
|
@ -59,7 +59,7 @@ JSONCallbackParameters::JSONCallbackParameters(QObject* jsonCallbackReceiver, co
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountManager::AccountManager() :
|
AccountManager::AccountManager() :
|
||||||
_authURL(),
|
_authURL(DEFAULT_NODE_AUTH_URL),
|
||||||
_pendingCallbackMap(),
|
_pendingCallbackMap(),
|
||||||
_accountInfo(),
|
_accountInfo(),
|
||||||
_shouldPersistToSettingsFile(true)
|
_shouldPersistToSettingsFile(true)
|
||||||
|
|
Loading…
Reference in a new issue