From 17979d962f57cb0cbe55122a282e50df8a866dc1 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 20 Jan 2015 14:26:32 -0800 Subject: [PATCH] hookup basic input dialog for address bar --- CMakeLists.txt.user.18 | 1084 +++++++++++++++++++++++++ gvr-interface/src/GVRInterface.cpp | 7 +- gvr-interface/src/GVRInterface.h | 17 + gvr-interface/src/GVRMainWindow.cpp | 9 +- gvr-interface/src/GVRMainWindow.h | 2 +- gvr-interface/src/RenderingClient.cpp | 29 + gvr-interface/src/RenderingClient.h | 26 + gvr-interface/src/client.cpp | 24 + gvr-interface/src/client.h | 23 + gvr-interface/src/main.cpp | 2 + 10 files changed, 1218 insertions(+), 5 deletions(-) create mode 100644 CMakeLists.txt.user.18 create mode 100644 gvr-interface/src/RenderingClient.cpp create mode 100644 gvr-interface/src/RenderingClient.h create mode 100644 gvr-interface/src/client.cpp create mode 100644 gvr-interface/src/client.h diff --git a/CMakeLists.txt.user.18 b/CMakeLists.txt.user.18 new file mode 100644 index 0000000000..ef53a33704 --- /dev/null +++ b/CMakeLists.txt.user.18 @@ -0,0 +1,1084 @@ + + + + + + EnvironmentId + {c787df28-2a1c-4631-b1bf-6fbdcb11138b} + + + ProjectExplorer.Project.ActiveTarget + 1 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + {047669de-9257-42d9-91d4-aa940d298051} + 0 + 0 + 1 + + false + /Users/birarda/code/hifi/checkouts/qt-android-build + + + + + false + + true + Make + + CMakeProjectManager.MakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + + clean + + true + + true + Make + + CMakeProjectManager.MakeStep + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + all + + CMakeProjectManager.CMakeBuildConfiguration + + 1 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + assignment-client + + false + + 2 + + assignment-client (disabled) + + CMakeProjectManager.CMakeRunConfiguration.assignment-client + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + gvr-interface + + false + + 2 + + gvr-interface + + CMakeProjectManager.CMakeRunConfiguration.gvr-interface + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + physics-tests + + false + + 2 + + physics-tests (disabled) + + CMakeProjectManager.CMakeRunConfiguration.physics-tests + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + shared-tests + + false + + 2 + + shared-tests (disabled) + + CMakeProjectManager.CMakeRunConfiguration.shared-tests + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + bitstream2json + + false + + 2 + + bitstream2json (disabled) + + CMakeProjectManager.CMakeRunConfiguration.bitstream2json + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + json2bitstream + + false + + 2 + + json2bitstream (disabled) + + CMakeProjectManager.CMakeRunConfiguration.json2bitstream + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + mtc + + false + + 2 + + mtc (disabled) + + CMakeProjectManager.CMakeRunConfiguration.mtc + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + voxel-edit + + false + + 2 + + voxel-edit (disabled) + + CMakeProjectManager.CMakeRunConfiguration.voxel-edit + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + domain-server + + false + + 2 + + domain-server (disabled) + + CMakeProjectManager.CMakeRunConfiguration.domain-server + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + ice-server + + false + + 2 + + ice-server (disabled) + + CMakeProjectManager.CMakeRunConfiguration.ice-server + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + interface + + false + + 2 + + interface (disabled) + + CMakeProjectManager.CMakeRunConfiguration.interface + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + audio-tests + + false + + 2 + + audio-tests (disabled) + + CMakeProjectManager.CMakeRunConfiguration.audio-tests + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + jitter-tests + + false + + 2 + + jitter-tests (disabled) + + CMakeProjectManager.CMakeRunConfiguration.jitter-tests + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + metavoxel-tests + + false + + 2 + + metavoxel-tests (disabled) + + CMakeProjectManager.CMakeRunConfiguration.metavoxel-tests + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + networking-tests + + false + + 2 + + networking-tests (disabled) + + CMakeProjectManager.CMakeRunConfiguration.networking-tests + 3768 + false + true + false + false + true + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + octree-tests + + false + + 2 + + octree-tests (disabled) + + CMakeProjectManager.CMakeRunConfiguration.octree-tests + 3768 + false + true + false + false + true + + 16 + + + + ProjectExplorer.Project.Target.1 + + Android for armeabi-v7a (GCC 4.9, Qt 5.3.2) + Android for armeabi-v7a (GCC 4.9, Qt 5.3.2) + {62878afa-e9f1-4a0e-88df-0e6e0e2a52f1} + 0 + 0 + 0 + + false + /Users/birarda/code/hifi/checkouts/qt-android-cmake + + + + + all + + false + + true + Make + + CMakeProjectManager.MakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + + clean + + true + + true + Make + + CMakeProjectManager.MakeStep + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Default + Default + CMakeProjectManager.CMakeBuildConfiguration + + 1 + + + + true + Deploy to Android device + + Qt4ProjectManager.AndroidDeployQtStep + true + + 1 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy to Android device + Deploy to Android device + Qt4ProjectManager.AndroidDeployConfiguration2 + + 1 + + + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + gvr-interface + + false + + 2 + + gvr-interface + + CMakeProjectManager.CMakeRunConfiguration.gvr-interface + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 2 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/gvr-interface/src/GVRInterface.cpp b/gvr-interface/src/GVRInterface.cpp index acf9083434..c3b7a85b01 100644 --- a/gvr-interface/src/GVRInterface.cpp +++ b/gvr-interface/src/GVRInterface.cpp @@ -11,10 +11,13 @@ #include +#include "GVRMainWindow.h" +#include "RenderingClient.h" + #include "GVRInterface.h" GVRInterface::GVRInterface(int argc, char* argv[]) : QApplication(argc, argv) { - -} \ No newline at end of file + _client = new RenderingClient(this); +} diff --git a/gvr-interface/src/GVRInterface.h b/gvr-interface/src/GVRInterface.h index de820a35db..ca829243fd 100644 --- a/gvr-interface/src/GVRInterface.h +++ b/gvr-interface/src/GVRInterface.h @@ -14,10 +14,27 @@ #include +class RenderingClient; +class GVRMainWindow; + +#if defined(qApp) +#undef qApp +#endif +#define qApp (static_cast(QApplication::instance())) + 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; }; #endif // hifi_GVRInterface_h diff --git a/gvr-interface/src/GVRMainWindow.cpp b/gvr-interface/src/GVRMainWindow.cpp index b58246e278..f7ca322cfe 100644 --- a/gvr-interface/src/GVRMainWindow.cpp +++ b/gvr-interface/src/GVRMainWindow.cpp @@ -9,12 +9,16 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include #include +#include "GVRInterface.h" +#include "RenderingClient.h" + #include "GVRMainWindow.h" -GVRMainWindow::GVRMainWindow() { +GVRMainWindow::GVRMainWindow(QWidget* parent) : + QMainWindow(parent) +{ QMenu *fileMenu = new QMenu("File"); QMenu *helpMenu = new QMenu("Help"); @@ -27,5 +31,6 @@ GVRMainWindow::GVRMainWindow() { fileMenu->addAction(goToAddress); helpMenu->addAction(aboutQt); + QObject::connect(goToAddress, &QAction::triggered, qApp->getClient(), &RenderingClient::showAddressBar); QObject::connect(aboutQt, &QAction::triggered, qApp, &QApplication::aboutQt); } diff --git a/gvr-interface/src/GVRMainWindow.h b/gvr-interface/src/GVRMainWindow.h index 6590638d43..55f291965b 100644 --- a/gvr-interface/src/GVRMainWindow.h +++ b/gvr-interface/src/GVRMainWindow.h @@ -17,7 +17,7 @@ class GVRMainWindow : public QMainWindow { Q_OBJECT public: - GVRMainWindow(); + GVRMainWindow(QWidget* parent = 0); }; #endif // hifi_GVRMainWindow_h diff --git a/gvr-interface/src/RenderingClient.cpp b/gvr-interface/src/RenderingClient.cpp new file mode 100644 index 0000000000..90ac027708 --- /dev/null +++ b/gvr-interface/src/RenderingClient.cpp @@ -0,0 +1,29 @@ +// +// RenderingClient.cpp +// gvr-interface/src +// +// Created by Stephen Birarda on 1/20/15. +// Copyright 2013 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 +// + +#include + +#include "GVRInterface.h" +#include "GVRMainWindow.h" + +#include "RenderingClient.h" + +RenderingClient::RenderingClient(QObject *parent) : + Client(parent) +{ + +} + +void RenderingClient::showAddressBar() { +#ifdef Q_OS_ANDROID + QString addressString = QInputDialog::getText(qApp->getMainWindow()->centralWidget(), "Go to Address", "Address"); +#endif +} diff --git a/gvr-interface/src/RenderingClient.h b/gvr-interface/src/RenderingClient.h new file mode 100644 index 0000000000..c0665dc947 --- /dev/null +++ b/gvr-interface/src/RenderingClient.h @@ -0,0 +1,26 @@ +// +// RenderingClient.h +// gvr-interface/src +// +// Created by Stephen Birarda on 1/20/15. +// Copyright 2013 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 +// + + +#ifndef hifi_RenderingClient_h +#define hifi_RenderingClient_h + +#include "Client.h" + +class RenderingClient : public Client { + Q_OBJECT +public: + RenderingClient(QObject* parent = 0); +public slots: + void showAddressBar(); +}; + +#endif // hifi_RenderingClient_h diff --git a/gvr-interface/src/client.cpp b/gvr-interface/src/client.cpp new file mode 100644 index 0000000000..61de226741 --- /dev/null +++ b/gvr-interface/src/client.cpp @@ -0,0 +1,24 @@ +// +// Client.cpp +// gvr-interface/src +// +// Created by Stephen Birarda on 1/20/15. +// Copyright 2013 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 +// + +#include +#include + +#include "Client.h" + +Client::Client(QObject* parent) : + QObject(parent) +{ + DependencyManager::set(); + + // setup the NodeList for this client + auto nodeList = DependencyManager::set(NodeType::Agent, 0); +} diff --git a/gvr-interface/src/client.h b/gvr-interface/src/client.h new file mode 100644 index 0000000000..8ab14b8964 --- /dev/null +++ b/gvr-interface/src/client.h @@ -0,0 +1,23 @@ +// +// Client.h +// gvr-interface/src +// +// Created by Stephen Birarda on 1/20/15. +// Copyright 2013 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 +// + +#ifndef hifi_Client_h +#define hifi_Client_h + +#include + +class Client : public QObject { + Q_OBJECT +public: + Client(QObject* parent = 0); +}; + +#endif // hifi_Client_h diff --git a/gvr-interface/src/main.cpp b/gvr-interface/src/main.cpp index 5fa5390df0..081a82e167 100644 --- a/gvr-interface/src/main.cpp +++ b/gvr-interface/src/main.cpp @@ -18,5 +18,7 @@ int main(int argc, char* argv[]) { GVRMainWindow mainWindow; mainWindow.showMaximized(); + app.setMainWindow(&mainWindow); + return app.exec(); } \ No newline at end of file