Add console to menu

This commit is contained in:
Ryan Huffman 2014-05-26 09:58:06 -07:00
parent c362731226
commit 3d28cff9df
2 changed files with 19 additions and 0 deletions

View file

@ -78,6 +78,7 @@ Menu::Menu() :
_faceshiftEyeDeflection(DEFAULT_FACESHIFT_EYE_DEFLECTION),
_frustumDrawMode(FRUSTUM_DRAW_MODE_ALL),
_viewFrustumOffset(DEFAULT_FRUSTUM_OFFSET),
_jsConsole(NULL),
_octreeStatsDialog(NULL),
_lodToolsDialog(NULL),
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
@ -222,6 +223,12 @@ Menu::Menu() :
_chatWindow = new ChatWindow(Application::getInstance()->getWindow());
#endif
addActionToQMenuAndActionHash(toolsMenu,
MenuOption::Console,
Qt::CTRL | Qt::Key_QuoteLeft,
this,
SLOT(showConsole()));
QMenu* viewMenu = addMenu("View");
addCheckableActionToQMenuAndActionHash(viewMenu,
@ -1195,6 +1202,14 @@ void Menu::toggleChat() {
#endif
}
void Menu::showConsole() {
QMainWindow* mainWindow = Application::getInstance()->getWindow();
if (!_jsConsole) {
_jsConsole = new JSConsole(mainWindow);
}
_jsConsole->setVisible(!_jsConsole->isVisible());
}
void Menu::audioMuteToggled() {
QAction *muteAction = _actionHash.value(MenuOption::MuteAudio);
muteAction->setChecked(Application::getInstance()->getAudio()->getMuted());

View file

@ -26,6 +26,7 @@
#include "location/LocationManager.h"
#include "ui/PreferencesDialog.h"
#include "ui/ChatWindow.h"
#include "ui/JSConsole.h"
#include "ui/ScriptEditorWindow.h"
const float ADJUST_LOD_DOWN_FPS = 40.0;
@ -187,6 +188,7 @@ private slots:
void showMetavoxelEditor();
void showScriptEditor();
void showChat();
void showConsole();
void toggleChat();
void audioMuteToggled();
void namedLocationCreated(LocationManager::NamedLocationCreateResponse response);
@ -241,6 +243,7 @@ private:
QPointer<MetavoxelEditor> _MetavoxelEditor;
QPointer<ScriptEditorWindow> _ScriptEditor;
QPointer<ChatWindow> _chatWindow;
JSConsole* _jsConsole;
OctreeStatsDialog* _octreeStatsDialog;
LodToolsDialog* _lodToolsDialog;
int _maxVoxels;
@ -297,6 +300,7 @@ namespace MenuOption {
const QString CollideWithParticles = "Collide With Particles";
const QString CollideWithVoxels = "Collide With Voxels";
const QString Collisions = "Collisions";
const QString Console = "Console...";
const QString DecreaseAvatarSize = "Decrease Avatar Size";
const QString DecreaseVoxelSize = "Decrease Voxel Size";
const QString DisableAutoAdjustLOD = "Disable Automatically Adjusting LOD";