History

Merge branch 'master' of https://github.com/highfidelity/hifi into 20143

Stojce committed 12 years ago

Commit 1debad32 parents 9be107c 4e7e96436 files · +1298 −792Browse files

Showing the changes to interface/src/Application.cpp (1 of 36 files). Show all

Unified · Split

interface/src/Application.cpp+50−5
@@ -55,6 +55,8 @@ · 54 unmodified lines
55#include <AccountManager.h>55#include <AccountManager.h>
56#include <AudioInjector.h>56#include <AudioInjector.h>
57#include <EntityScriptingInterface.h>57#include <EntityScriptingInterface.h>
58#include <HFActionEvent.h>
59#include <HFBackEvent.h>
58#include <LocalVoxelsList.h>60#include <LocalVoxelsList.h>
59#include <Logging.h>61#include <Logging.h>
60#include <NetworkAccessManager.h>62#include <NetworkAccessManager.h>
@@ -67,14 +69,16 @@ · 6 unmodified lines
67#include <UUID.h>69#include <UUID.h>
68 70
69#include "Application.h"71#include "Application.h"
70#include "ui/DataWebDialog.h"
71#include "InterfaceVersion.h"72#include "InterfaceVersion.h"
72#include "Menu.h"73#include "Menu.h"
73#include "ModelUploader.h"74#include "ModelUploader.h"
74#include "Util.h"75#include "Util.h"
76
77#include "devices/Leapmotion.h"
75#include "devices/MIDIManager.h"78#include "devices/MIDIManager.h"
76#include "devices/OculusManager.h"79#include "devices/OculusManager.h"
77#include "devices/TV3DManager.h"80#include "devices/TV3DManager.h"
81
78#include "renderer/ProgramObject.h"82#include "renderer/ProgramObject.h"
79 83
80#include "scripting/AccountScriptingInterface.h"84#include "scripting/AccountScriptingInterface.h"
@@ -87,12 +91,12 @@ · 6 unmodified lines
87#include "scripting/SettingsScriptingInterface.h"91#include "scripting/SettingsScriptingInterface.h"
88#include "scripting/WindowScriptingInterface.h"92#include "scripting/WindowScriptingInterface.h"
89 93
94#include "ui/DataWebDialog.h"
90#include "ui/InfoView.h"95#include "ui/InfoView.h"
91#include "ui/Snapshot.h"96#include "ui/Snapshot.h"
92#include "ui/Stats.h"97#include "ui/Stats.h"
93#include "ui/TextRenderer.h"98#include "ui/TextRenderer.h"
94 99
95#include "devices/Leapmotion.h"
96 100
97using namespace std;101using namespace std;
98 102
@@ -136,6 +140,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 37 unmodified lines
136 _glWidget(new GLCanvas()),140 _glWidget(new GLCanvas()),
137 _nodeThread(new QThread(this)),141 _nodeThread(new QThread(this)),
138 _datagramProcessor(),142 _datagramProcessor(),
143 _undoStack(),
144 _undoStackScriptingInterface(&_undoStack),
139 _frameCount(0),145 _frameCount(0),
140 _fps(60.0f),146 _fps(60.0f),
141 _justStarted(true),147 _justStarted(true),
@@ -172,8 +178,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 30 unmodified lines
172 _nodeBoundsDisplay(this),178 _nodeBoundsDisplay(this),
173 _previousScriptLocation(),179 _previousScriptLocation(),
174 _applicationOverlay(),180 _applicationOverlay(),
175 _undoStack(),
176 _undoStackScriptingInterface(&_undoStack),
177 _runningScriptsWidget(NULL),181 _runningScriptsWidget(NULL),
178 _runningScriptsWidgetWasVisible(false),182 _runningScriptsWidgetWasVisible(false),
179 _trayIcon(new QSystemTrayIcon(_window)),183 _trayIcon(new QSystemTrayIcon(_window)),
@@ -835,6 +839,10 @@ bool Application::event(QEvent* event) { · 655 unmodified lines
835 return false;839 return false;
836 }840 }
837 841
842 if (HFActionEvent::types().contains(event->type())) {
843 _controllerScriptingInterface.handleMetaEvent(static_cast<HFMetaEvent*>(event));
844 }
845
838 return QApplication::event(event);846 return QApplication::event(event);
839}847}
840 848
@@ -1109,9 +1117,23 @@ void Application::keyPressEvent(QKeyEvent* event) { · 268 unmodified lines
1109 case Qt::Key_Equal:1117 case Qt::Key_Equal:
1110 _myAvatar->resetSize();1118 _myAvatar->resetSize();
1111 break;1119 break;
1112 case Qt::Key_Escape:1120 case Qt::Key_Space: {
1121 // this starts an HFActionEvent
1122 HFActionEvent startActionEvent(HFActionEvent::startType(), getViewportCenter());
1123 sendEvent(this, &startActionEvent);
1124
1125 break;
1126 }
1127 case Qt::Key_Escape: {
1113 OculusManager::abandonCalibration();1128 OculusManager::abandonCalibration();
1129
1130 // this starts the HFCancelEvent
1131 HFBackEvent startBackEvent(HFBackEvent::startType());
1132 sendEvent(this, &startBackEvent);
1133
1114 break;1134 break;
1135 }
1136
1115 default:1137 default:
1116 event->ignore();1138 event->ignore();
1117 break;1139 break;
@@ -1182,6 +1204,20 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 64 unmodified lines
1182 case Qt::Key_Alt:1204 case Qt::Key_Alt:
1183 _myAvatar->clearDriveKeys();1205 _myAvatar->clearDriveKeys();
1184 break;1206 break;
1207 case Qt::Key_Space: {
1208 // this ends the HFActionEvent
1209 HFActionEvent endActionEvent(HFActionEvent::endType(), getViewportCenter());
1210 sendEvent(this, &endActionEvent);
1211
1212 break;
1213 }
1214 case Qt::Key_Escape: {
1215 // this ends the HFCancelEvent
1216 HFBackEvent endBackEvent(HFBackEvent::endType());
1217 sendEvent(this, &endBackEvent);
1218
1219 break;
1220 }
1185 default:1221 default:
1186 event->ignore();1222 event->ignore();
1187 break;1223 break;
@@ -1254,6 +1290,10 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { · 66 unmodified lines
1254 // stop propagation1290 // stop propagation
1255 return;1291 return;
1256 }1292 }
1293
1294 // nobody handled this - make it an action event on the _window object
1295 HFActionEvent actionEvent(HFActionEvent::startType(), event->localPos());
1296 sendEvent(this, &actionEvent);
1257 1297
1258 } else if (event->button() == Qt::RightButton) {1298 } else if (event->button() == Qt::RightButton) {
1259 // right click items here1299 // right click items here
@@ -1274,12 +1314,17 @@ void Application::mouseReleaseEvent(QMouseEvent* event, unsigned int deviceID) { · 14 unmodified lines
1274 _mouseX = event->x();1314 _mouseX = event->x();
1275 _mouseY = event->y();1315 _mouseY = event->y();
1276 _mousePressed = false;1316 _mousePressed = false;
1317
1277 checkBandwidthMeterClick();1318 checkBandwidthMeterClick();
1278 if (Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {1319 if (Menu::getInstance()->isOptionChecked(MenuOption::Stats)) {
1279 // let's set horizontal offset to give stats some margin to mirror1320 // let's set horizontal offset to give stats some margin to mirror
1280 int horizontalOffset = MIRROR_VIEW_WIDTH;1321 int horizontalOffset = MIRROR_VIEW_WIDTH;
1281 Stats::getInstance()->checkClick(_mouseX, _mouseY, _mouseDragStartedX, _mouseDragStartedY, horizontalOffset);1322 Stats::getInstance()->checkClick(_mouseX, _mouseY, _mouseDragStartedX, _mouseDragStartedY, horizontalOffset);
1282 }1323 }
1324
1325 // fire an action end event
1326 HFActionEvent actionEvent(HFActionEvent::endType(), event->localPos());
1327 sendEvent(this, &actionEvent);
1283 }1328 }
1284 }1329 }
1285}1330}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t