mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 16:23:39 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into blue
This commit is contained in:
commit
daa9136b34
25 changed files with 533 additions and 183 deletions
|
@ -110,7 +110,7 @@ Item {
|
|||
}
|
||||
|
||||
function pullFreshValues() {
|
||||
if (Audio.getRecording()) {
|
||||
if (AudioScriptingInterface.getRecording()) {
|
||||
updateRecordingLabel();
|
||||
}
|
||||
|
||||
|
@ -129,14 +129,14 @@ Item {
|
|||
_wavFilePath = _wavFilePath.replace(/[\-:]|\.\d*Z$/g, "").replace("T", "-") + ".wav";
|
||||
// Using controller recording default directory
|
||||
_wavFilePath = Recording.getDefaultRecordingSaveDirectory() + _wavFilePath;
|
||||
if (!Audio.startRecording(_wavFilePath)) {
|
||||
if (!AudioScriptingInterface.startRecording(_wavFilePath)) {
|
||||
Messages.sendMessage("Hifi-Notifications", JSON.stringify({message:"Error creating: "+_wavFilePath}));
|
||||
updateRecordingUI(false);
|
||||
}
|
||||
}
|
||||
|
||||
function stopRecording() {
|
||||
Audio.stopRecording();
|
||||
AudioScriptingInterface.stopRecording();
|
||||
setRecordingLabelOpacity(0.0);
|
||||
Messages.sendMessage("Hifi-Notifications", JSON.stringify({message:"Saved: "+_wavFilePath}));
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ Item {
|
|||
}
|
||||
|
||||
function toggleRecording() {
|
||||
if (Audio.getRecording()) {
|
||||
if (AudioScriptingInterface.getRecording()) {
|
||||
updateRecordingUI(false);
|
||||
stopRecording();
|
||||
} else {
|
||||
|
|
|
@ -26,7 +26,7 @@ Rectangle {
|
|||
HifiConstants { id: hifi; }
|
||||
|
||||
property var eventBridge;
|
||||
property string title: "Audio Settings - " + Audio.context;
|
||||
property string title: "Audio Settings - " + AudioScriptingInterface.context;
|
||||
signal sendToScript(var message);
|
||||
|
||||
color: hifi.colors.baseGray;
|
||||
|
@ -37,7 +37,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
|
||||
property bool isVR: Audio.context === "VR"
|
||||
property bool isVR: AudioScriptingInterface.context === "VR"
|
||||
property real rightMostInputLevelPos: 0
|
||||
//placeholder for control sizes and paddings
|
||||
//recalculates dynamically in case of UI size is changed
|
||||
|
@ -72,17 +72,17 @@ Rectangle {
|
|||
property bool showPeaks: true;
|
||||
|
||||
function enablePeakValues() {
|
||||
Audio.devices.input.peakValuesEnabled = true;
|
||||
Audio.devices.input.peakValuesEnabledChanged.connect(function(enabled) {
|
||||
AudioScriptingInterface.devices.input.peakValuesEnabled = true;
|
||||
AudioScriptingInterface.devices.input.peakValuesEnabledChanged.connect(function(enabled) {
|
||||
if (!enabled && root.showPeaks) {
|
||||
Audio.devices.input.peakValuesEnabled = true;
|
||||
AudioScriptingInterface.devices.input.peakValuesEnabled = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function disablePeakValues() {
|
||||
root.showPeaks = false;
|
||||
Audio.devices.input.peakValuesEnabled = false;
|
||||
AudioScriptingInterface.devices.input.peakValuesEnabled = false;
|
||||
}
|
||||
|
||||
Component.onCompleted: enablePeakValues();
|
||||
|
@ -117,10 +117,10 @@ Rectangle {
|
|||
text: qsTr("Mute microphone");
|
||||
spacing: margins.sizeCheckBox - boxSize
|
||||
isRedCheck: true;
|
||||
checked: Audio.muted;
|
||||
checked: AudioScriptingInterface.muted;
|
||||
onClicked: {
|
||||
Audio.muted = checked;
|
||||
checked = Qt.binding(function() { return Audio.muted; }); // restore binding
|
||||
AudioScriptingInterface.muted = checked;
|
||||
checked = Qt.binding(function() { return AudioScriptingInterface.muted; }); // restore binding
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -130,10 +130,10 @@ Rectangle {
|
|||
AudioControls.CheckBox {
|
||||
spacing: muteMic.spacing
|
||||
text: qsTr("Enable noise reduction");
|
||||
checked: Audio.noiseReduction;
|
||||
checked: AudioScriptingInterface.noiseReduction;
|
||||
onClicked: {
|
||||
Audio.noiseReduction = checked;
|
||||
checked = Qt.binding(function() { return Audio.noiseReduction; }); // restore binding
|
||||
AudioScriptingInterface.noiseReduction = checked;
|
||||
checked = Qt.binding(function() { return AudioScriptingInterface.noiseReduction; }); // restore binding
|
||||
}
|
||||
}
|
||||
AudioControls.CheckBox {
|
||||
|
@ -184,7 +184,7 @@ Rectangle {
|
|||
spacing: 4;
|
||||
snapMode: ListView.SnapToItem;
|
||||
clip: true;
|
||||
model: Audio.devices.input;
|
||||
model: AudioScriptingInterface.devices.input;
|
||||
delegate: Item {
|
||||
width: rightMostInputLevelPos
|
||||
height: margins.sizeCheckBox > checkBoxInput.implicitHeight ?
|
||||
|
@ -204,7 +204,7 @@ Rectangle {
|
|||
text: devicename
|
||||
onPressed: {
|
||||
if (!checked) {
|
||||
Audio.setInputDevice(info, bar.currentIndex === 1);
|
||||
AudioScriptingInterface.setInputDevice(info, bar.currentIndex === 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ Rectangle {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: ((bar.currentIndex === 1 && isVR) ||
|
||||
(bar.currentIndex === 0 && !isVR)) &&
|
||||
Audio.devices.input.peakValuesAvailable;
|
||||
AudioScriptingInterface.devices.input.peakValuesAvailable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ Rectangle {
|
|||
spacing: 4;
|
||||
snapMode: ListView.SnapToItem;
|
||||
clip: true;
|
||||
model: Audio.devices.output;
|
||||
model: AudioScriptingInterface.devices.output;
|
||||
delegate: Item {
|
||||
width: rightMostInputLevelPos
|
||||
height: margins.sizeCheckBox > checkBoxOutput.implicitHeight ?
|
||||
|
@ -273,7 +273,7 @@ Rectangle {
|
|||
text: devicename
|
||||
onPressed: {
|
||||
if (!checked) {
|
||||
Audio.setOutputDevice(info, bar.currentIndex === 1);
|
||||
AudioScriptingInterface.setOutputDevice(info, bar.currentIndex === 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ Rectangle {
|
|||
verticalCenter: parent.verticalCenter;
|
||||
}
|
||||
|
||||
visible: Audio.muted;
|
||||
visible: AudioScriptingInterface.muted;
|
||||
color: colors.muted;
|
||||
|
||||
text: "MUTED";
|
||||
|
|
|
@ -17,7 +17,7 @@ import QtGraphicalEffects 1.0
|
|||
import TabletScriptingInterface 1.0
|
||||
|
||||
Rectangle {
|
||||
readonly property var level: Audio.inputLevel;
|
||||
readonly property var level: AudioScriptingInterface.inputLevel;
|
||||
|
||||
property bool standalone: false;
|
||||
property var dragTarget: null;
|
||||
|
@ -60,7 +60,7 @@ Rectangle {
|
|||
hoverEnabled: true;
|
||||
scrollGestureEnabled: false;
|
||||
onClicked: {
|
||||
Audio.muted = !Audio.muted;
|
||||
AudioScriptingInterface.muted = !AudioScriptingInterface.muted;
|
||||
Tablet.playSound(TabletEnums.ButtonClick);
|
||||
}
|
||||
drag.target: dragTarget;
|
||||
|
@ -82,7 +82,7 @@ Rectangle {
|
|||
readonly property string red: colors.muted;
|
||||
readonly property string fill: "#55000000";
|
||||
readonly property string border: standalone ? "#80FFFFFF" : "#55FFFFFF";
|
||||
readonly property string icon: Audio.muted ? muted : unmuted;
|
||||
readonly property string icon: AudioScriptingInterface.muted ? muted : unmuted;
|
||||
}
|
||||
|
||||
Item {
|
||||
|
@ -103,7 +103,7 @@ Rectangle {
|
|||
readonly property string mutedIcon: "../../../icons/tablet-icons/mic-mute-i.svg";
|
||||
|
||||
id: image;
|
||||
source: Audio.muted ? mutedIcon : unmutedIcon;
|
||||
source: AudioScriptingInterface.muted ? mutedIcon : unmutedIcon;
|
||||
|
||||
width: 30;
|
||||
height: 30;
|
||||
|
@ -126,9 +126,9 @@ Rectangle {
|
|||
Item {
|
||||
id: status;
|
||||
|
||||
readonly property string color: Audio.muted ? colors.muted : colors.unmuted;
|
||||
readonly property string color: AudioScriptingInterface.muted ? colors.muted : colors.unmuted;
|
||||
|
||||
visible: Audio.muted;
|
||||
visible: AudioScriptingInterface.muted;
|
||||
|
||||
anchors {
|
||||
left: parent.left;
|
||||
|
@ -147,7 +147,7 @@ Rectangle {
|
|||
|
||||
color: parent.color;
|
||||
|
||||
text: Audio.muted ? "MUTED" : "MUTE";
|
||||
text: AudioScriptingInterface.muted ? "MUTED" : "MUTE";
|
||||
font.pointSize: 12;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,9 +27,9 @@ RowLayout {
|
|||
}
|
||||
function playSound() {
|
||||
// FIXME: MyAvatar is not properly exposed to QML; MyAvatar.qmlPosition is a stopgap
|
||||
// FIXME: Audio.playSystemSound should not require position
|
||||
// FIXME: AudioScriptingInterface.playSystemSound should not require position
|
||||
if (sample === null && !isPlaying) {
|
||||
sample = Audio.playSystemSound(sound, MyAvatar.qmlPosition);
|
||||
sample = AudioScriptingInterface.playSystemSound(sound, MyAvatar.qmlPosition);
|
||||
isPlaying = true;
|
||||
sample.finished.connect(reset);
|
||||
}
|
||||
|
|
|
@ -72,10 +72,14 @@ StackView {
|
|||
Component { id: tabletWebView; TabletWebView {} }
|
||||
Component.onCompleted: {
|
||||
updateLocationText(false);
|
||||
addressLine.focus = !HMD.active;
|
||||
root.parentChanged.connect(center);
|
||||
center();
|
||||
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
|
||||
Qt.callLater(function() {
|
||||
addressBarDialog.keyboardEnabled = HMD.active;
|
||||
addressLine.forceActiveFocus();
|
||||
})
|
||||
}
|
||||
Component.onDestruction: {
|
||||
root.parentChanged.disconnect(center);
|
||||
|
|
|
@ -48,11 +48,15 @@ Item {
|
|||
}
|
||||
|
||||
function pushSource(path) {
|
||||
d.push(Qt.resolvedUrl(path));
|
||||
d.currentItem.sendToScript.connect(tabletMenu.sendToScript);
|
||||
d.push(Qt.resolvedUrl("../../" + path));
|
||||
if (d.currentItem.sendToScript !== undefined) {
|
||||
d.currentItem.sendToScript.connect(tabletMenu.sendToScript);
|
||||
}
|
||||
d.currentItem.focus = true;
|
||||
d.currentItem.forceActiveFocus();
|
||||
breadcrumbText.text = d.currentItem.title;
|
||||
if (d.currentItem.title !== undefined) {
|
||||
breadcrumbText.text = d.currentItem.title;
|
||||
}
|
||||
if (typeof bgNavBar !== "undefined") {
|
||||
d.currentItem.y = bgNavBar.height;
|
||||
d.currentItem.height -= bgNavBar.height;
|
||||
|
|
BIN
interface/resources/styles/filter.png
Normal file
BIN
interface/resources/styles/filter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 244 B |
|
@ -67,8 +67,22 @@ QPushButton#revealLogButton {
|
|||
font-size: 11px;
|
||||
}
|
||||
|
||||
QPushButton#showAllButton {
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
background-color: #333333;
|
||||
color: #BBBBBB;
|
||||
border-width: 0;
|
||||
border-radius: 9px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
QCheckBox {
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
text-align: center;
|
||||
color: #3d3d3d;
|
||||
border-width: 0;
|
||||
border-radius: 9px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
QCheckBox::indicator:unchecked {
|
||||
|
@ -77,4 +91,25 @@ QCheckBox::indicator:unchecked {
|
|||
|
||||
QCheckBox::indicator:checked {
|
||||
image: url(styles/checked.svg);
|
||||
}
|
||||
|
||||
QComboBox {
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
text-align: center;
|
||||
background-color: #CCCCCC;
|
||||
color: #3d3d3d;
|
||||
border-width: 0;
|
||||
border-radius: 9px;
|
||||
font-size: 11px;
|
||||
padding-left: 7px;
|
||||
}
|
||||
|
||||
QComboBox::drop-down {
|
||||
border-width: 0px;
|
||||
padding-right: 7px;
|
||||
}
|
||||
|
||||
QComboBox::down-arrow {
|
||||
image: url(styles/filter.png);
|
||||
border-width: 0px;
|
||||
}
|
|
@ -154,7 +154,6 @@
|
|||
#include "scripting/Audio.h"
|
||||
#include "networking/CloseEventSender.h"
|
||||
#include "scripting/TestScriptingInterface.h"
|
||||
#include "scripting/AccountScriptingInterface.h"
|
||||
#include "scripting/AssetMappingsScriptingInterface.h"
|
||||
#include "scripting/ClipboardScriptingInterface.h"
|
||||
#include "scripting/DesktopScriptingInterface.h"
|
||||
|
@ -1443,7 +1442,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
connect(audioIO.data(), &AudioClient::noiseGateClosed, audioScriptingInterface.data(), &AudioScriptingInterface::noiseGateClosed);
|
||||
connect(audioIO.data(), &AudioClient::inputReceived, audioScriptingInterface.data(), &AudioScriptingInterface::inputReceived);
|
||||
|
||||
|
||||
this->installEventFilter(this);
|
||||
|
||||
#ifdef HAVE_DDE
|
||||
|
@ -1467,8 +1465,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
applicationUpdater->checkForUpdate();
|
||||
}
|
||||
|
||||
// Now that menu is initialized we can sync myAvatar with it's state.
|
||||
myAvatar->updateMotionBehaviorFromMenu();
|
||||
Menu::getInstance()->setIsOptionChecked(MenuOption::ActionMotorControl, true);
|
||||
|
||||
// FIXME spacemouse code still needs cleanup
|
||||
#if 0
|
||||
|
@ -2320,9 +2317,10 @@ void Application::initializeUi() {
|
|||
|
||||
setupPreferences();
|
||||
|
||||
// For some reason there is already an "Application" object in the QML context,
|
||||
// though I can't find it. Hence, "ApplicationInterface"
|
||||
surfaceContext->setContextProperty("Audio", DependencyManager::get<AudioScriptingInterface>().data());
|
||||
// in Qt 5.10.0 there is already an "Audio" object in the QML context
|
||||
// though I failed to find it (from QtMultimedia??). So.. let it be "AudioScriptingInterface"
|
||||
surfaceContext->setContextProperty("AudioScriptingInterface", DependencyManager::get<AudioScriptingInterface>().data());
|
||||
|
||||
surfaceContext->setContextProperty("AudioStats", DependencyManager::get<AudioClient>()->getStats().data());
|
||||
surfaceContext->setContextProperty("AudioScope", DependencyManager::get<AudioScope>().data());
|
||||
|
||||
|
@ -2373,7 +2371,7 @@ void Application::initializeUi() {
|
|||
surfaceContext->setContextProperty("SoundCache", DependencyManager::get<SoundCache>().data());
|
||||
surfaceContext->setContextProperty("InputConfiguration", DependencyManager::get<InputConfiguration>().data());
|
||||
|
||||
surfaceContext->setContextProperty("Account", AccountScriptingInterface::getInstance());
|
||||
surfaceContext->setContextProperty("Account", GlobalServicesScriptingInterface::getInstance());
|
||||
surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface);
|
||||
surfaceContext->setContextProperty("GlobalServices", GlobalServicesScriptingInterface::getInstance());
|
||||
surfaceContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
|
||||
|
@ -5740,7 +5738,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe
|
|||
scriptEngine->registerGlobalObject("ModelCache", DependencyManager::get<ModelCache>().data());
|
||||
scriptEngine->registerGlobalObject("SoundCache", DependencyManager::get<SoundCache>().data());
|
||||
|
||||
scriptEngine->registerGlobalObject("Account", AccountScriptingInterface::getInstance());
|
||||
scriptEngine->registerGlobalObject("Account", GlobalServicesScriptingInterface::getInstance());
|
||||
scriptEngine->registerGlobalObject("DialogsManager", _dialogsManagerScriptingInterface);
|
||||
|
||||
scriptEngine->registerGlobalObject("GlobalServices", GlobalServicesScriptingInterface::getInstance());
|
||||
|
@ -6143,7 +6141,7 @@ void Application::showAssetServerWidget(QString filePath) {
|
|||
if (!hmd->getShouldShowTablet() && !isHMDMode()) {
|
||||
DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload);
|
||||
} else {
|
||||
static const QUrl url("../../hifi/dialogs/TabletAssetServer.qml");
|
||||
static const QUrl url("hifi/dialogs/TabletAssetServer.qml");
|
||||
tablet->pushOntoStack(url);
|
||||
}
|
||||
}
|
||||
|
@ -6716,7 +6714,7 @@ void Application::loadLODToolsDialog() {
|
|||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||
dialogsManager->lodTools();
|
||||
} else {
|
||||
tablet->pushOntoStack("../../hifi/dialogs/TabletLODTools.qml");
|
||||
tablet->pushOntoStack("hifi/dialogs/TabletLODTools.qml");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6728,7 +6726,7 @@ void Application::loadEntityStatisticsDialog() {
|
|||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||
dialogsManager->octreeStatsDetails();
|
||||
} else {
|
||||
tablet->pushOntoStack("../../hifi/dialogs/TabletEntityStatistics.qml");
|
||||
tablet->pushOntoStack("hifi/dialogs/TabletEntityStatistics.qml");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6739,7 +6737,7 @@ void Application::loadDomainConnectionDialog() {
|
|||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||
dialogsManager->showDomainConnectionDialog();
|
||||
} else {
|
||||
tablet->pushOntoStack("../../hifi/dialogs/TabletDCDialog.qml");
|
||||
tablet->pushOntoStack("hifi/dialogs/TabletDCDialog.qml");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ Menu::Menu() {
|
|||
action = addActionToQMenuAndActionHash(avatarMenu, MenuOption::Attachments);
|
||||
connect(action, &QAction::triggered, [] {
|
||||
qApp->showDialog(QString("hifi/dialogs/AttachmentsDialog.qml"),
|
||||
QString("../../hifi/tablet/TabletAttachmentsDialog.qml"), "AttachmentsDialog");
|
||||
QString("hifi/tablet/TabletAttachmentsDialog.qml"), "AttachmentsDialog");
|
||||
});
|
||||
|
||||
// Avatar > Size
|
||||
|
@ -309,13 +309,13 @@ Menu::Menu() {
|
|||
action = addActionToQMenuAndActionHash(settingsMenu, MenuOption::Preferences, Qt::CTRL | Qt::Key_Comma, nullptr, nullptr, QAction::PreferencesRole);
|
||||
connect(action, &QAction::triggered, [] {
|
||||
qApp->showDialog(QString("hifi/dialogs/GeneralPreferencesDialog.qml"),
|
||||
QString("../../hifi/tablet/TabletGeneralPreferences.qml"), "GeneralPreferencesDialog");
|
||||
QString("hifi/tablet/TabletGeneralPreferences.qml"), "GeneralPreferencesDialog");
|
||||
});
|
||||
|
||||
action = addActionToQMenuAndActionHash(settingsMenu, "Audio...");
|
||||
connect(action, &QAction::triggered, [] {
|
||||
static const QUrl widgetUrl("hifi/dialogs/Audio.qml");
|
||||
static const QUrl tabletUrl("../../hifi/audio/Audio.qml");
|
||||
static const QUrl tabletUrl("hifi/audio/Audio.qml");
|
||||
static const QString name("AudioDialog");
|
||||
qApp->showDialog(widgetUrl, tabletUrl, name);
|
||||
});
|
||||
|
@ -324,14 +324,14 @@ Menu::Menu() {
|
|||
action = addActionToQMenuAndActionHash(settingsMenu, "Avatar...");
|
||||
connect(action, &QAction::triggered, [] {
|
||||
qApp->showDialog(QString("hifi/dialogs/AvatarPreferencesDialog.qml"),
|
||||
QString("../../hifi/tablet/TabletAvatarPreferences.qml"), "AvatarPreferencesDialog");
|
||||
QString("hifi/tablet/TabletAvatarPreferences.qml"), "AvatarPreferencesDialog");
|
||||
});
|
||||
|
||||
// Settings > LOD...
|
||||
action = addActionToQMenuAndActionHash(settingsMenu, "LOD...");
|
||||
connect(action, &QAction::triggered, [] {
|
||||
qApp->showDialog(QString("hifi/dialogs/LodPreferencesDialog.qml"),
|
||||
QString("../../hifi/tablet/TabletLodPreferences.qml"), "LodPreferencesDialog");
|
||||
QString("hifi/tablet/TabletLodPreferences.qml"), "LodPreferencesDialog");
|
||||
});
|
||||
|
||||
action = addActionToQMenuAndActionHash(settingsMenu, "Controller Settings...");
|
||||
|
@ -364,7 +364,7 @@ Menu::Menu() {
|
|||
action = addActionToQMenuAndActionHash(developerMenu, "Graphics...");
|
||||
connect(action, &QAction::triggered, [] {
|
||||
qApp->showDialog(QString("hifi/dialogs/GraphicsPreferencesDialog.qml"),
|
||||
QString("../../hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog");
|
||||
QString("hifi/tablet/TabletGraphicsPreferences.qml"), "GraphicsPreferencesDialog");
|
||||
});
|
||||
|
||||
// Developer > UI >>>
|
||||
|
@ -589,8 +589,8 @@ Menu::Menu() {
|
|||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderDetailedCollision, 0, false,
|
||||
avatar.get(), SLOT(setEnableDebugDrawDetailedCollision(bool)));
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ActionMotorControl,
|
||||
Qt::CTRL | Qt::SHIFT | Qt::Key_K, true, avatar.get(), SLOT(updateMotionBehaviorFromMenu()),
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ActionMotorControl, 0, true,
|
||||
avatar.get(), SLOT(updateMotionBehaviorFromMenu()),
|
||||
UNSPECIFIED_POSITION, "Developer");
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ScriptedMotorControl, 0, true,
|
||||
|
@ -615,7 +615,7 @@ Menu::Menu() {
|
|||
action = addActionToQMenuAndActionHash(networkMenu, MenuOption::Networking);
|
||||
connect(action, &QAction::triggered, [] {
|
||||
qApp->showDialog(QString("hifi/dialogs/NetworkingPreferencesDialog.qml"),
|
||||
QString("../../hifi/tablet/TabletNetworkingPreferences.qml"), "NetworkingPreferencesDialog");
|
||||
QString("hifi/tablet/TabletNetworkingPreferences.qml"), "NetworkingPreferencesDialog");
|
||||
});
|
||||
addActionToQMenuAndActionHash(networkMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()));
|
||||
addActionToQMenuAndActionHash(networkMenu, MenuOption::ClearDiskCache, 0,
|
||||
|
@ -676,7 +676,7 @@ Menu::Menu() {
|
|||
action = addActionToQMenuAndActionHash(audioDebugMenu, "Buffers...");
|
||||
connect(action, &QAction::triggered, [] {
|
||||
qApp->showDialog(QString("hifi/dialogs/AudioBuffers.qml"),
|
||||
QString("../../hifi/tablet/TabletAudioBuffers.qml"), "AudioBuffersDialog");
|
||||
QString("hifi/tablet/TabletAudioBuffers.qml"), "AudioBuffersDialog");
|
||||
});
|
||||
|
||||
auto audioIO = DependencyManager::get<AudioClient>();
|
||||
|
|
|
@ -12,47 +12,25 @@
|
|||
#include "AccountManager.h"
|
||||
|
||||
#include "AccountScriptingInterface.h"
|
||||
#include "GlobalServicesScriptingInterface.h"
|
||||
|
||||
AccountScriptingInterface* AccountScriptingInterface::getInstance() {
|
||||
static AccountScriptingInterface sharedInstance;
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
QObject::connect(accountManager.data(), &AccountManager::profileChanged,
|
||||
&sharedInstance, &AccountScriptingInterface::usernameChanged);
|
||||
QObject::connect(accountManager.data(), &AccountManager::usernameChanged,
|
||||
&sharedInstance, &AccountScriptingInterface::onUsernameChanged);
|
||||
return &sharedInstance;
|
||||
}
|
||||
|
||||
bool AccountScriptingInterface::isLoggedIn() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
return accountManager->isLoggedIn();
|
||||
}
|
||||
|
||||
bool AccountScriptingInterface::checkAndSignalForAccessToken() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
return accountManager->checkAndSignalForAccessToken();
|
||||
return GlobalServicesScriptingInterface::getInstance()->isLoggedIn();
|
||||
}
|
||||
|
||||
void AccountScriptingInterface::logOut() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
return accountManager->logout();
|
||||
GlobalServicesScriptingInterface::getInstance()->logOut();
|
||||
}
|
||||
|
||||
AccountScriptingInterface::AccountScriptingInterface(QObject *parent): QObject(parent) {
|
||||
m_loggedIn = isLoggedIn();
|
||||
emit loggedInChanged(m_loggedIn);
|
||||
}
|
||||
|
||||
void AccountScriptingInterface::onUsernameChanged(QString username) {
|
||||
m_loggedIn = (username != QString());
|
||||
emit loggedInChanged(m_loggedIn);
|
||||
bool AccountScriptingInterface::loggedIn() const {
|
||||
return GlobalServicesScriptingInterface::getInstance()->loggedIn();
|
||||
}
|
||||
|
||||
QString AccountScriptingInterface::getUsername() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
if (accountManager->isLoggedIn()) {
|
||||
return accountManager->getAccountInfo().getUsername();
|
||||
} else {
|
||||
return "Unknown user";
|
||||
}
|
||||
return GlobalServicesScriptingInterface::getInstance()->getUsername();
|
||||
}
|
||||
|
|
|
@ -17,18 +17,12 @@
|
|||
class AccountScriptingInterface : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QString username READ getUsername NOTIFY usernameChanged)
|
||||
Q_PROPERTY(bool loggedIn READ loggedIn NOTIFY loggedInChanged)
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Account
|
||||
* @property username {String} username if user is logged in, otherwise it returns "Unknown user"
|
||||
*/
|
||||
|
||||
public:
|
||||
|
||||
Q_PROPERTY(QUrl metaverseServerURL READ getMetaverseServerURL)
|
||||
QUrl getMetaverseServerURL() { return DependencyManager::get<AccountManager>()->getMetaverseServerURL(); }
|
||||
Q_PROPERTY(QString username READ getUsername)
|
||||
Q_PROPERTY(bool loggedIn READ loggedIn)
|
||||
|
||||
signals:
|
||||
|
||||
|
@ -56,21 +50,11 @@ public slots:
|
|||
* @return {bool} true when user is logged into the High Fidelity metaverse.
|
||||
*/
|
||||
bool isLoggedIn();
|
||||
bool checkAndSignalForAccessToken();
|
||||
void logOut();
|
||||
|
||||
public:
|
||||
AccountScriptingInterface(QObject* parent = nullptr);
|
||||
bool loggedIn() const {
|
||||
return m_loggedIn;
|
||||
}
|
||||
|
||||
private slots:
|
||||
void onUsernameChanged(QString username);
|
||||
|
||||
private:
|
||||
bool m_loggedIn { false };
|
||||
|
||||
AccountScriptingInterface(QObject* parent = nullptr) {}
|
||||
bool loggedIn() const;
|
||||
};
|
||||
|
||||
#endif // hifi_AccountScriptingInterface_h
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
GlobalServicesScriptingInterface::GlobalServicesScriptingInterface() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
connect(accountManager.data(), &AccountManager::usernameChanged, this, &GlobalServicesScriptingInterface::myUsernameChanged);
|
||||
connect(accountManager.data(), &AccountManager::usernameChanged, this, &GlobalServicesScriptingInterface::onUsernameChanged);
|
||||
connect(accountManager.data(), &AccountManager::logoutComplete, this, &GlobalServicesScriptingInterface::loggedOut);
|
||||
connect(accountManager.data(), &AccountManager::loginComplete, this, &GlobalServicesScriptingInterface::connected);
|
||||
|
||||
|
@ -31,11 +31,14 @@ GlobalServicesScriptingInterface::GlobalServicesScriptingInterface() {
|
|||
auto discoverabilityManager = DependencyManager::get<DiscoverabilityManager>();
|
||||
connect(discoverabilityManager.data(), &DiscoverabilityManager::discoverabilityModeChanged,
|
||||
this, &GlobalServicesScriptingInterface::discoverabilityModeChanged);
|
||||
|
||||
_loggedIn = isLoggedIn();
|
||||
emit loggedInChanged(_loggedIn);
|
||||
}
|
||||
|
||||
GlobalServicesScriptingInterface::~GlobalServicesScriptingInterface() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
disconnect(accountManager.data(), &AccountManager::usernameChanged, this, &GlobalServicesScriptingInterface::myUsernameChanged);
|
||||
disconnect(accountManager.data(), &AccountManager::usernameChanged, this, &GlobalServicesScriptingInterface::onUsernameChanged);
|
||||
disconnect(accountManager.data(), &AccountManager::logoutComplete, this, &GlobalServicesScriptingInterface::loggedOut);
|
||||
disconnect(accountManager.data(), &AccountManager::loginComplete, this, &GlobalServicesScriptingInterface::connected);
|
||||
}
|
||||
|
@ -45,8 +48,28 @@ GlobalServicesScriptingInterface* GlobalServicesScriptingInterface::getInstance(
|
|||
return &sharedInstance;
|
||||
}
|
||||
|
||||
const QString& GlobalServicesScriptingInterface::getUsername() const {
|
||||
return DependencyManager::get<AccountManager>()->getAccountInfo().getUsername();
|
||||
const QString GlobalServicesScriptingInterface::getUsername() const {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
if (accountManager->isLoggedIn()) {
|
||||
return accountManager->getAccountInfo().getUsername();
|
||||
} else {
|
||||
return "Unknown user";
|
||||
}
|
||||
}
|
||||
|
||||
bool GlobalServicesScriptingInterface::isLoggedIn() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
return accountManager->isLoggedIn();
|
||||
}
|
||||
|
||||
bool GlobalServicesScriptingInterface::checkAndSignalForAccessToken() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
return accountManager->checkAndSignalForAccessToken();
|
||||
}
|
||||
|
||||
void GlobalServicesScriptingInterface::logOut() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
return accountManager->logout();
|
||||
}
|
||||
|
||||
void GlobalServicesScriptingInterface::loggedOut() {
|
||||
|
@ -77,6 +100,12 @@ void GlobalServicesScriptingInterface::discoverabilityModeChanged(Discoverabilit
|
|||
emit findableByChanged(DiscoverabilityManager::findableByString(discoverabilityMode));
|
||||
}
|
||||
|
||||
void GlobalServicesScriptingInterface::onUsernameChanged(const QString& username) {
|
||||
_loggedIn = (username != QString());
|
||||
emit myUsernameChanged(username);
|
||||
emit loggedInChanged(_loggedIn);
|
||||
}
|
||||
|
||||
DownloadInfoResult::DownloadInfoResult() :
|
||||
downloading(QList<float>()),
|
||||
pending(0.0f)
|
||||
|
|
|
@ -35,17 +35,25 @@ void DownloadInfoResultFromScriptValue(const QScriptValue& object, DownloadInfoR
|
|||
class GlobalServicesScriptingInterface : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QString username READ getUsername)
|
||||
Q_PROPERTY(QString username READ getUsername NOTIFY myUsernameChanged)
|
||||
Q_PROPERTY(bool loggedIn READ loggedIn NOTIFY loggedInChanged)
|
||||
Q_PROPERTY(QString findableBy READ getFindableBy WRITE setFindableBy NOTIFY findableByChanged)
|
||||
Q_PROPERTY(QUrl metaverseServerURL READ getMetaverseServerURL)
|
||||
|
||||
public:
|
||||
static GlobalServicesScriptingInterface* getInstance();
|
||||
|
||||
const QString& getUsername() const;
|
||||
const QString getUsername() const;
|
||||
bool loggedIn() const { return _loggedIn; }
|
||||
QUrl getMetaverseServerURL() { return DependencyManager::get<AccountManager>()->getMetaverseServerURL(); }
|
||||
|
||||
public slots:
|
||||
DownloadInfoResult getDownloadInfo();
|
||||
void updateDownloadInfo();
|
||||
|
||||
bool isLoggedIn();
|
||||
bool checkAndSignalForAccessToken();
|
||||
void logOut();
|
||||
|
||||
private slots:
|
||||
void loggedOut();
|
||||
|
@ -55,18 +63,22 @@ private slots:
|
|||
void setFindableBy(const QString& discoverabilityMode);
|
||||
void discoverabilityModeChanged(Discoverability::Mode discoverabilityMode);
|
||||
|
||||
void onUsernameChanged(const QString& username);
|
||||
|
||||
signals:
|
||||
void connected();
|
||||
void disconnected(const QString& reason);
|
||||
void myUsernameChanged(const QString& username);
|
||||
void downloadInfoChanged(DownloadInfoResult info);
|
||||
void findableByChanged(const QString& discoverabilityMode);
|
||||
void loggedInChanged(bool loggedIn);
|
||||
|
||||
private:
|
||||
GlobalServicesScriptingInterface();
|
||||
~GlobalServicesScriptingInterface();
|
||||
|
||||
bool _downloading;
|
||||
bool _loggedIn{ false };
|
||||
};
|
||||
|
||||
#endif // hifi_GlobalServicesScriptingInterface_h
|
||||
|
|
|
@ -16,11 +16,10 @@
|
|||
#include <QPlainTextEdit>
|
||||
#include <QTextCursor>
|
||||
#include <QPushButton>
|
||||
#include <QSyntaxHighlighter>
|
||||
|
||||
#include <PathUtils.h>
|
||||
|
||||
const int TOP_BAR_HEIGHT = 46;
|
||||
const int TOP_BAR_HEIGHT = 124;
|
||||
const int INITIAL_WIDTH = 720;
|
||||
const int INITIAL_HEIGHT = 480;
|
||||
const int MINIMAL_WIDTH = 700;
|
||||
|
@ -34,21 +33,6 @@ const QColor HIGHLIGHT_COLOR = QColor("#3366CC");
|
|||
const QColor BOLD_COLOR = QColor("#445c8c");
|
||||
const QString BOLD_PATTERN = "\\[\\d*\\/.*:\\d*:\\d*\\]";
|
||||
|
||||
class Highlighter : public QSyntaxHighlighter {
|
||||
public:
|
||||
Highlighter(QTextDocument* parent = nullptr);
|
||||
void setBold(int indexToBold);
|
||||
QString keyword;
|
||||
|
||||
protected:
|
||||
void highlightBlock(const QString& text) override;
|
||||
|
||||
private:
|
||||
QTextCharFormat boldFormat;
|
||||
QTextCharFormat keywordFormat;
|
||||
|
||||
};
|
||||
|
||||
BaseLogDialog::BaseLogDialog(QWidget* parent) : QDialog(parent, Qt::Window) {
|
||||
setWindowTitle("Base Log");
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
@ -77,7 +61,7 @@ void BaseLogDialog::initControls() {
|
|||
_searchButton->setGeometry(_leftPad, ELEMENT_MARGIN, SEARCH_BUTTON_WIDTH, ELEMENT_HEIGHT);
|
||||
_leftPad += SEARCH_BUTTON_WIDTH;
|
||||
_searchButton->show();
|
||||
connect(_searchButton, SIGNAL(clicked()), SLOT(handleSearchButton()));
|
||||
connect(_searchButton, &QPushButton::clicked, this, &BaseLogDialog::handleSearchButton);
|
||||
|
||||
_searchTextBox = new QLineEdit(this);
|
||||
// disable blue outline in Mac
|
||||
|
@ -85,8 +69,8 @@ void BaseLogDialog::initControls() {
|
|||
_searchTextBox->setGeometry(_leftPad, ELEMENT_MARGIN, SEARCH_TEXT_WIDTH, ELEMENT_HEIGHT);
|
||||
_leftPad += SEARCH_TEXT_WIDTH + BUTTON_MARGIN;
|
||||
_searchTextBox->show();
|
||||
connect(_searchTextBox, SIGNAL(textChanged(QString)), SLOT(handleSearchTextChanged(QString)));
|
||||
connect(_searchTextBox, SIGNAL(returnPressed()), SLOT(toggleSearchNext()));
|
||||
connect(_searchTextBox, &QLineEdit::textChanged, this, &BaseLogDialog::handleSearchTextChanged);
|
||||
connect(_searchTextBox, &QLineEdit::returnPressed, this, &BaseLogDialog::toggleSearchNext);
|
||||
|
||||
_searchPrevButton = new QPushButton(this);
|
||||
_searchPrevButton->setObjectName("searchPrevButton");
|
||||
|
@ -94,7 +78,7 @@ void BaseLogDialog::initControls() {
|
|||
_searchPrevButton->setText("Prev");
|
||||
_leftPad += SEARCH_TOGGLE_BUTTON_WIDTH + BUTTON_MARGIN;
|
||||
_searchPrevButton->show();
|
||||
connect(_searchPrevButton, SIGNAL(clicked()), SLOT(toggleSearchPrev()));
|
||||
connect(_searchPrevButton, &QPushButton::clicked, this, &BaseLogDialog::toggleSearchPrev);
|
||||
|
||||
_searchNextButton = new QPushButton(this);
|
||||
_searchNextButton->setObjectName("searchNextButton");
|
||||
|
@ -102,16 +86,16 @@ void BaseLogDialog::initControls() {
|
|||
_searchNextButton->setText("Next");
|
||||
_leftPad += SEARCH_TOGGLE_BUTTON_WIDTH + CHECKBOX_MARGIN;
|
||||
_searchNextButton->show();
|
||||
connect(_searchNextButton, SIGNAL(clicked()), SLOT(toggleSearchNext()));
|
||||
connect(_searchNextButton, &QPushButton::clicked, this, &BaseLogDialog::toggleSearchNext);
|
||||
|
||||
_logTextBox = new QPlainTextEdit(this);
|
||||
_logTextBox->setReadOnly(true);
|
||||
_logTextBox->show();
|
||||
_highlighter = new Highlighter(_logTextBox->document());
|
||||
connect(_logTextBox, SIGNAL(selectionChanged()), SLOT(updateSelection()));
|
||||
connect(_logTextBox, &QPlainTextEdit::selectionChanged, this, &BaseLogDialog::updateSelection);
|
||||
}
|
||||
|
||||
void BaseLogDialog::showEvent(QShowEvent* event) {
|
||||
void BaseLogDialog::showEvent(QShowEvent* event) {
|
||||
showLogData();
|
||||
}
|
||||
|
||||
|
@ -132,15 +116,12 @@ void BaseLogDialog::handleSearchButton() {
|
|||
}
|
||||
|
||||
void BaseLogDialog::handleSearchTextChanged(QString searchText) {
|
||||
if (searchText.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QTextCursor cursor = _logTextBox->textCursor();
|
||||
|
||||
if (cursor.hasSelection()) {
|
||||
QString selectedTerm = cursor.selectedText();
|
||||
if (selectedTerm == searchText) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158,6 +139,10 @@ void BaseLogDialog::handleSearchTextChanged(QString searchText) {
|
|||
_highlighter->rehighlight();
|
||||
}
|
||||
|
||||
void BaseLogDialog::clearSearch() {
|
||||
_searchTextBox->setText("");
|
||||
}
|
||||
|
||||
void BaseLogDialog::toggleSearchPrev() {
|
||||
QTextCursor searchCursor = _logTextBox->textCursor();
|
||||
if (searchCursor.hasSelection()) {
|
||||
|
|
|
@ -13,17 +13,33 @@
|
|||
#define hifi_BaseLogDialog_h
|
||||
|
||||
#include <QDialog>
|
||||
#include <QSyntaxHighlighter>
|
||||
|
||||
const int ELEMENT_MARGIN = 7;
|
||||
const int ELEMENT_HEIGHT = 32;
|
||||
const int CHECKBOX_MARGIN = 12;
|
||||
const int CHECKBOX_WIDTH = 140;
|
||||
const int CHECKBOX_WIDTH = 110;
|
||||
const int COMBOBOX_WIDTH = 160;
|
||||
const int BUTTON_MARGIN = 8;
|
||||
|
||||
class QPushButton;
|
||||
class QLineEdit;
|
||||
class QPlainTextEdit;
|
||||
class Highlighter;
|
||||
|
||||
class Highlighter : public QSyntaxHighlighter {
|
||||
public:
|
||||
Highlighter(QTextDocument* parent = nullptr);
|
||||
void setBold(int indexToBold);
|
||||
QString keyword;
|
||||
|
||||
protected:
|
||||
void highlightBlock(const QString& text) override;
|
||||
|
||||
private:
|
||||
QTextCharFormat boldFormat;
|
||||
QTextCharFormat keywordFormat;
|
||||
|
||||
};
|
||||
|
||||
class BaseLogDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
@ -33,7 +49,7 @@ public:
|
|||
~BaseLogDialog();
|
||||
|
||||
public slots:
|
||||
void appendLogLine(QString logLine);
|
||||
virtual void appendLogLine(QString logLine);
|
||||
|
||||
private slots:
|
||||
void updateSelection();
|
||||
|
@ -43,21 +59,22 @@ private slots:
|
|||
void toggleSearchNext();
|
||||
|
||||
protected:
|
||||
int _leftPad { 0 };
|
||||
int _leftPad{ 0 };
|
||||
QString _searchTerm;
|
||||
QPlainTextEdit* _logTextBox{ nullptr };
|
||||
Highlighter* _highlighter{ nullptr };
|
||||
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
void showEvent(QShowEvent* event) override;
|
||||
virtual QString getCurrentLog() = 0;
|
||||
void clearSearch();
|
||||
|
||||
private:
|
||||
QPushButton* _searchButton { nullptr };
|
||||
QLineEdit* _searchTextBox { nullptr };
|
||||
QPlainTextEdit* _logTextBox { nullptr };
|
||||
QPushButton* _searchPrevButton { nullptr };
|
||||
QPushButton* _searchNextButton { nullptr };
|
||||
QString _searchTerm;
|
||||
Highlighter* _highlighter { nullptr };
|
||||
|
||||
QPushButton* _searchButton{ nullptr };
|
||||
QLineEdit* _searchTextBox{ nullptr };
|
||||
QPushButton* _searchPrevButton{ nullptr };
|
||||
QPushButton* _searchNextButton{ nullptr };
|
||||
|
||||
void initControls();
|
||||
void showLogData();
|
||||
};
|
||||
|
|
|
@ -13,48 +13,287 @@
|
|||
|
||||
#include <QCheckBox>
|
||||
#include <QPushButton>
|
||||
#include <QComboBox>
|
||||
#include <QPlainTextEdit>
|
||||
|
||||
#include <shared/AbstractLoggerInterface.h>
|
||||
|
||||
const int REVEAL_BUTTON_WIDTH = 122;
|
||||
const int CLEAR_FILTER_BUTTON_WIDTH = 80;
|
||||
const int MARGIN_LEFT = 25;
|
||||
const int DEBUG_CHECKBOX_WIDTH = 70;
|
||||
const int INFO_CHECKBOX_WIDTH = 65;
|
||||
const int CRITICAL_CHECKBOX_WIDTH = 85;
|
||||
const int WARNING_CHECKBOX_WIDTH = 80;
|
||||
const int SUPPRESS_CHECKBOX_WIDTH = 87;
|
||||
const int FATAL_CHECKBOX_WIDTH = 70;
|
||||
const int UNKNOWN_CHECKBOX_WIDTH = 80;
|
||||
const int SECOND_ROW = ELEMENT_MARGIN + ELEMENT_MARGIN + ELEMENT_HEIGHT;
|
||||
const int THIRD_ROW = SECOND_ROW + ELEMENT_MARGIN + ELEMENT_HEIGHT;
|
||||
const QString DEBUG_TEXT = "[DEBUG]";
|
||||
const QString INFO_TEXT = "[INFO]";
|
||||
const QString CRITICAL_TEXT = "[CRITICAL]";
|
||||
const QString WARNING_TEXT = "[WARNING]";
|
||||
const QString FATAL_TEXT = "[FATAL]";
|
||||
const QString SUPPRESS_TEXT = "[SUPPRESS]";
|
||||
const QString UNKNOWN_TEXT = "[UNKNOWN]";
|
||||
|
||||
LogDialog::LogDialog(QWidget* parent, AbstractLoggerInterface* logger) : BaseLogDialog(parent) {
|
||||
_logger = logger;
|
||||
setWindowTitle("Log");
|
||||
|
||||
_extraDebuggingBox = new QCheckBox("Extra debugging", this);
|
||||
_extraDebuggingBox->setGeometry(_leftPad, ELEMENT_MARGIN, CHECKBOX_WIDTH, ELEMENT_HEIGHT);
|
||||
if (_logger->extraDebugging()) {
|
||||
_extraDebuggingBox->setCheckState(Qt::Checked);
|
||||
}
|
||||
_extraDebuggingBox->show();
|
||||
connect(_extraDebuggingBox, SIGNAL(stateChanged(int)), SLOT(handleExtraDebuggingCheckbox(int)));
|
||||
|
||||
_revealLogButton = new QPushButton("Reveal log file", this);
|
||||
// set object name for css styling
|
||||
_revealLogButton->setObjectName("revealLogButton");
|
||||
_revealLogButton->show();
|
||||
connect(_revealLogButton, SIGNAL(clicked()), SLOT(handleRevealButton()));
|
||||
connect(_revealLogButton, &QPushButton::clicked, this, &LogDialog::handleRevealButton);
|
||||
|
||||
connect(_logger, SIGNAL(logReceived(QString)), this, SLOT(appendLogLine(QString)), Qt::QueuedConnection);
|
||||
connect(_logger, &AbstractLoggerInterface::logReceived, this, &LogDialog::appendLogLine);
|
||||
|
||||
_leftPad = MARGIN_LEFT;
|
||||
_debugPrintBox = new QCheckBox("DEBUG", this);
|
||||
_debugPrintBox->setGeometry(_leftPad, SECOND_ROW, DEBUG_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
|
||||
if (_logger->debugPrint()) {
|
||||
_debugPrintBox->setCheckState(Qt::Checked);
|
||||
}
|
||||
_debugPrintBox->show();
|
||||
connect(_debugPrintBox, &QCheckBox::stateChanged, this, &LogDialog::handleDebugPrintBox);
|
||||
|
||||
_leftPad += DEBUG_CHECKBOX_WIDTH + BUTTON_MARGIN;
|
||||
_infoPrintBox = new QCheckBox("INFO", this);
|
||||
_infoPrintBox->setGeometry(_leftPad, SECOND_ROW, INFO_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
|
||||
if (_logger->infoPrint()) {
|
||||
_infoPrintBox->setCheckState(Qt::Checked);
|
||||
}
|
||||
_infoPrintBox->show();
|
||||
connect(_infoPrintBox, &QCheckBox::stateChanged, this, &LogDialog::handleInfoPrintBox);
|
||||
|
||||
_leftPad += INFO_CHECKBOX_WIDTH + BUTTON_MARGIN;
|
||||
_criticalPrintBox = new QCheckBox("CRITICAL", this);
|
||||
_criticalPrintBox->setGeometry(_leftPad, SECOND_ROW, CRITICAL_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
|
||||
if (_logger->criticalPrint()) {
|
||||
_criticalPrintBox->setCheckState(Qt::Checked);
|
||||
}
|
||||
_criticalPrintBox->show();
|
||||
connect(_criticalPrintBox, &QCheckBox::stateChanged, this, &LogDialog::handleCriticalPrintBox);
|
||||
|
||||
_leftPad += CRITICAL_CHECKBOX_WIDTH + BUTTON_MARGIN;
|
||||
_warningPrintBox = new QCheckBox("WARNING", this);
|
||||
_warningPrintBox->setGeometry(_leftPad, SECOND_ROW, WARNING_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
|
||||
if (_logger->warningPrint()) {
|
||||
_warningPrintBox->setCheckState(Qt::Checked);
|
||||
}
|
||||
_warningPrintBox->show();
|
||||
connect(_warningPrintBox, &QCheckBox::stateChanged, this, &LogDialog::handleWarningPrintBox);
|
||||
|
||||
_leftPad += WARNING_CHECKBOX_WIDTH + BUTTON_MARGIN;
|
||||
_suppressPrintBox = new QCheckBox("SUPPRESS", this);
|
||||
_suppressPrintBox->setGeometry(_leftPad, SECOND_ROW, SUPPRESS_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
|
||||
if (_logger->suppressPrint()) {
|
||||
_suppressPrintBox->setCheckState(Qt::Checked);
|
||||
}
|
||||
_suppressPrintBox->show();
|
||||
connect(_suppressPrintBox, &QCheckBox::stateChanged, this, &LogDialog::handleSuppressPrintBox);
|
||||
|
||||
_leftPad += SUPPRESS_CHECKBOX_WIDTH + BUTTON_MARGIN;
|
||||
_fatalPrintBox = new QCheckBox("FATAL", this);
|
||||
_fatalPrintBox->setGeometry(_leftPad, SECOND_ROW, FATAL_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
|
||||
if (_logger->fatalPrint()) {
|
||||
_fatalPrintBox->setCheckState(Qt::Checked);
|
||||
}
|
||||
_fatalPrintBox->show();
|
||||
connect(_fatalPrintBox, &QCheckBox::stateChanged, this, &LogDialog::handleFatalPrintBox);
|
||||
|
||||
_leftPad += FATAL_CHECKBOX_WIDTH + BUTTON_MARGIN;
|
||||
_unknownPrintBox = new QCheckBox("UNKNOWN", this);
|
||||
_unknownPrintBox->setGeometry(_leftPad, SECOND_ROW, UNKNOWN_CHECKBOX_WIDTH, ELEMENT_HEIGHT);
|
||||
if (_logger->unknownPrint()) {
|
||||
_unknownPrintBox->setCheckState(Qt::Checked);
|
||||
}
|
||||
_unknownPrintBox->show();
|
||||
connect(_unknownPrintBox, &QCheckBox::stateChanged, this, &LogDialog::handleUnknownPrintBox);
|
||||
|
||||
_leftPad = MARGIN_LEFT;
|
||||
_filterDropdown = new QComboBox(this);
|
||||
_filterDropdown->setGeometry(_leftPad, THIRD_ROW, COMBOBOX_WIDTH, ELEMENT_HEIGHT);
|
||||
_filterDropdown->addItem("No secondary filter...");
|
||||
_filterDropdown->addItem("default");
|
||||
_filterDropdown->addItem("hifi.audio");
|
||||
_filterDropdown->addItem("hifi.audioclient");
|
||||
_filterDropdown->addItem("hifi.animation");
|
||||
_filterDropdown->addItem("hifi.avatars");
|
||||
_filterDropdown->addItem("hifi.commerce");
|
||||
_filterDropdown->addItem("hifi.controllers");
|
||||
_filterDropdown->addItem("hifi.entities");
|
||||
_filterDropdown->addItem("hifi.gl");
|
||||
_filterDropdown->addItem("hifi.gpu.gl");
|
||||
_filterDropdown->addItem("hifi.interface");
|
||||
_filterDropdown->addItem("hifi.interface.deadlock");
|
||||
_filterDropdown->addItem("hifi.modelformat");
|
||||
_filterDropdown->addItem("hifi.networking");
|
||||
_filterDropdown->addItem("hifi.networking.resource");
|
||||
_filterDropdown->addItem("hifi.plugins");
|
||||
_filterDropdown->addItem("hifi.render");
|
||||
_filterDropdown->addItem("hifi.scriptengine");
|
||||
_filterDropdown->addItem("hifi.scriptengine.module");
|
||||
_filterDropdown->addItem("hifi.scriptengine.script");
|
||||
_filterDropdown->addItem("hifi.shared");
|
||||
_filterDropdown->addItem("hifi.ui");
|
||||
_filterDropdown->addItem("qml");
|
||||
connect(_filterDropdown, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &LogDialog::handleFilterDropdownChanged);
|
||||
|
||||
_extraDebuggingBox = new QCheckBox("Extra debugging", this);
|
||||
if (_logger->extraDebugging()) {
|
||||
_extraDebuggingBox->setCheckState(Qt::Checked);
|
||||
}
|
||||
_extraDebuggingBox->show();
|
||||
connect(_extraDebuggingBox, &QCheckBox::stateChanged, this, &LogDialog::handleExtraDebuggingCheckbox);
|
||||
|
||||
_clearFilterButton = new QPushButton("Clear Filters", this);
|
||||
// set object name for css styling
|
||||
_clearFilterButton->setObjectName("showAllButton");
|
||||
_clearFilterButton->show();
|
||||
connect(_clearFilterButton, &QPushButton::clicked, this, &LogDialog::handleClearFilterButton);
|
||||
handleClearFilterButton();
|
||||
}
|
||||
|
||||
void LogDialog::resizeEvent(QResizeEvent* event) {
|
||||
BaseLogDialog::resizeEvent(event);
|
||||
_revealLogButton->setGeometry(width() - ELEMENT_MARGIN - REVEAL_BUTTON_WIDTH,
|
||||
ELEMENT_MARGIN,
|
||||
REVEAL_BUTTON_WIDTH,
|
||||
ELEMENT_HEIGHT);
|
||||
ELEMENT_MARGIN,
|
||||
REVEAL_BUTTON_WIDTH,
|
||||
ELEMENT_HEIGHT);
|
||||
_clearFilterButton->setGeometry(width() - ELEMENT_MARGIN - CLEAR_FILTER_BUTTON_WIDTH,
|
||||
THIRD_ROW,
|
||||
CLEAR_FILTER_BUTTON_WIDTH,
|
||||
ELEMENT_HEIGHT);
|
||||
_extraDebuggingBox->setGeometry(width() - ELEMENT_MARGIN - COMBOBOX_WIDTH - ELEMENT_MARGIN - CLEAR_FILTER_BUTTON_WIDTH,
|
||||
THIRD_ROW,
|
||||
COMBOBOX_WIDTH,
|
||||
ELEMENT_HEIGHT);
|
||||
}
|
||||
|
||||
void LogDialog::handleRevealButton() {
|
||||
_logger->locateLog();
|
||||
}
|
||||
|
||||
void LogDialog::handleClearFilterButton() {
|
||||
_logger->setExtraDebugging(false);
|
||||
_extraDebuggingBox->setCheckState(Qt::Unchecked);
|
||||
_logger->setDebugPrint(false);
|
||||
_debugPrintBox->setCheckState(Qt::Unchecked);
|
||||
_logger->setInfoPrint(false);
|
||||
_infoPrintBox->setCheckState(Qt::Unchecked);
|
||||
_logger->setCriticalPrint(true);
|
||||
_criticalPrintBox->setCheckState(Qt::Checked);
|
||||
_logger->setWarningPrint(true);
|
||||
_warningPrintBox->setCheckState(Qt::Checked);
|
||||
_logger->setSuppressPrint(true);
|
||||
_suppressPrintBox->setCheckState(Qt::Checked);
|
||||
_logger->setFatalPrint(true);
|
||||
_fatalPrintBox->setCheckState(Qt::Checked);
|
||||
_logger->setUnknownPrint(true);
|
||||
_unknownPrintBox->setCheckState(Qt::Checked);
|
||||
clearSearch();
|
||||
_filterDropdown->setCurrentIndex(0);
|
||||
printLogFile();
|
||||
}
|
||||
|
||||
void LogDialog::handleExtraDebuggingCheckbox(int state) {
|
||||
_logger->setExtraDebugging(state != 0);
|
||||
}
|
||||
|
||||
void LogDialog::handleDebugPrintBox(int state) {
|
||||
_logger->setDebugPrint(state != 0);
|
||||
printLogFile();
|
||||
}
|
||||
|
||||
void LogDialog::handleInfoPrintBox(int state) {
|
||||
_logger->setInfoPrint(state != 0);
|
||||
printLogFile();
|
||||
}
|
||||
|
||||
void LogDialog::handleCriticalPrintBox(int state) {
|
||||
_logger->setCriticalPrint(state != 0);
|
||||
printLogFile();
|
||||
}
|
||||
|
||||
void LogDialog::handleWarningPrintBox(int state) {
|
||||
_logger->setWarningPrint(state != 0);
|
||||
printLogFile();
|
||||
}
|
||||
|
||||
void LogDialog::handleSuppressPrintBox(int state) {
|
||||
_logger->setSuppressPrint(state != 0);
|
||||
printLogFile();
|
||||
}
|
||||
|
||||
void LogDialog::handleFatalPrintBox(int state) {
|
||||
_logger->setFatalPrint(state != 0);
|
||||
printLogFile();
|
||||
}
|
||||
|
||||
void LogDialog::handleUnknownPrintBox(int state) {
|
||||
_logger->setUnknownPrint(state != 0);
|
||||
printLogFile();
|
||||
}
|
||||
|
||||
void LogDialog::handleFilterDropdownChanged(int selection) {
|
||||
if (selection != 0) {
|
||||
_filterSelection = "[" + _filterDropdown->currentText() + "]";
|
||||
} else {
|
||||
_filterSelection = "";
|
||||
}
|
||||
printLogFile();
|
||||
}
|
||||
|
||||
QString LogDialog::getCurrentLog() {
|
||||
return _logger->getLogData();
|
||||
}
|
||||
|
||||
void LogDialog::appendLogLine(QString logLine) {
|
||||
if (logLine.contains(_searchTerm, Qt::CaseInsensitive) &&
|
||||
logLine.contains(_filterSelection, Qt::CaseSensitive)) {
|
||||
int indexToBold = _logTextBox->document()->characterCount();
|
||||
_highlighter->setBold(indexToBold);
|
||||
|
||||
if (logLine.contains(DEBUG_TEXT, Qt::CaseSensitive)) {
|
||||
if (_logger->debugPrint()) {
|
||||
_logTextBox->appendPlainText(logLine.trimmed());
|
||||
}
|
||||
} else if (logLine.contains(INFO_TEXT, Qt::CaseSensitive)) {
|
||||
if (_logger->infoPrint()) {
|
||||
_logTextBox->appendPlainText(logLine.trimmed());
|
||||
}
|
||||
} else if (logLine.contains(CRITICAL_TEXT, Qt::CaseSensitive)) {
|
||||
if (_logger->criticalPrint()) {
|
||||
_logTextBox->appendPlainText(logLine.trimmed());
|
||||
}
|
||||
} else if (logLine.contains(WARNING_TEXT, Qt::CaseSensitive)) {
|
||||
if (_logger->warningPrint()) {
|
||||
_logTextBox->appendPlainText(logLine.trimmed());
|
||||
}
|
||||
} else if (logLine.contains(SUPPRESS_TEXT, Qt::CaseSensitive)) {
|
||||
if (_logger->suppressPrint()) {
|
||||
_logTextBox->appendPlainText(logLine.trimmed());
|
||||
}
|
||||
} else if (logLine.contains(FATAL_TEXT, Qt::CaseSensitive)) {
|
||||
if (_logger->fatalPrint()) {
|
||||
_logTextBox->appendPlainText(logLine.trimmed());
|
||||
}
|
||||
} else {
|
||||
if (_logger->unknownPrint()) {
|
||||
_logTextBox->appendPlainText(logLine.trimmed());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LogDialog::printLogFile() {
|
||||
_logTextBox->clear();
|
||||
QString log = getCurrentLog();
|
||||
QStringList logList = log.split('\n');
|
||||
for (const auto& message : logList) {
|
||||
appendLogLine(message);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
class QCheckBox;
|
||||
class QPushButton;
|
||||
class QComboBox;
|
||||
class QResizeEvent;
|
||||
class AbstractLoggerInterface;
|
||||
|
||||
|
@ -25,17 +26,40 @@ class LogDialog : public BaseLogDialog {
|
|||
public:
|
||||
LogDialog(QWidget* parent, AbstractLoggerInterface* logger);
|
||||
|
||||
public slots:
|
||||
void appendLogLine(QString logLine) override;
|
||||
|
||||
private slots:
|
||||
void handleRevealButton();
|
||||
void handleExtraDebuggingCheckbox(int);
|
||||
void handleDebugPrintBox(int);
|
||||
void handleInfoPrintBox(int);
|
||||
void handleCriticalPrintBox(int);
|
||||
void handleWarningPrintBox(int);
|
||||
void handleSuppressPrintBox(int);
|
||||
void handleFatalPrintBox(int);
|
||||
void handleUnknownPrintBox(int);
|
||||
void handleFilterDropdownChanged(int);
|
||||
void handleClearFilterButton();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
QString getCurrentLog() override;
|
||||
|
||||
void printLogFile();
|
||||
|
||||
private:
|
||||
QCheckBox* _extraDebuggingBox;
|
||||
QPushButton* _revealLogButton;
|
||||
QPushButton* _clearFilterButton;
|
||||
QCheckBox* _debugPrintBox;
|
||||
QCheckBox* _infoPrintBox;
|
||||
QCheckBox* _criticalPrintBox;
|
||||
QCheckBox* _warningPrintBox;
|
||||
QCheckBox* _suppressPrintBox;
|
||||
QCheckBox* _fatalPrintBox;
|
||||
QCheckBox* _unknownPrintBox;
|
||||
QComboBox* _filterDropdown;
|
||||
QString _filterSelection;
|
||||
|
||||
AbstractLoggerInterface* _logger;
|
||||
};
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include <UserActivityLoggerScriptingInterface.h>
|
||||
#include <AbstractViewStateInterface.h>
|
||||
#include <AddressManager.h>
|
||||
#include "scripting/AccountScriptingInterface.h"
|
||||
#include "scripting/HMDScriptingInterface.h"
|
||||
#include "scripting/AssetMappingsScriptingInterface.h"
|
||||
#include "scripting/MenuScriptingInterface.h"
|
||||
|
@ -193,8 +192,12 @@ void Web3DOverlay::setupQmlSurface() {
|
|||
|
||||
_webSurface->getSurfaceContext()->setContextProperty("offscreenFlags", flags);
|
||||
_webSurface->getSurfaceContext()->setContextProperty("AddressManager", DependencyManager::get<AddressManager>().data());
|
||||
_webSurface->getSurfaceContext()->setContextProperty("Account", AccountScriptingInterface::getInstance());
|
||||
_webSurface->getSurfaceContext()->setContextProperty("Audio", DependencyManager::get<AudioScriptingInterface>().data());
|
||||
_webSurface->getSurfaceContext()->setContextProperty("Account", GlobalServicesScriptingInterface::getInstance());
|
||||
|
||||
// in Qt 5.10.0 there is already an "Audio" object in the QML context
|
||||
// though I failed to find it (from QtMultimedia??). So.. let it be "AudioScriptingInterface"
|
||||
_webSurface->getSurfaceContext()->setContextProperty("AudioScriptingInterface", DependencyManager::get<AudioScriptingInterface>().data());
|
||||
|
||||
_webSurface->getSurfaceContext()->setContextProperty("AudioStats", DependencyManager::get<AudioClient>()->getStats().data());
|
||||
_webSurface->getSurfaceContext()->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
|
||||
_webSurface->getSurfaceContext()->setContextProperty("fileDialogHelper", new FileDialogHelper());
|
||||
|
@ -514,7 +517,6 @@ void Web3DOverlay::setProperties(const QVariantMap& properties) {
|
|||
*
|
||||
* @property {string} url - The URL of the Web page to display.
|
||||
* @property {string} scriptURL="" - The URL of a JavaScript file to inject into the Web page.
|
||||
* @property {Vec2} resolution - <strong>Deprecated:</strong> This property has been removed.
|
||||
* @property {number} dpi=30 - The dots per inch to display the Web page at, on the overlay.
|
||||
* @property {Vec2} dimensions=1,1 - The size of the overlay to display the Web page on, in meters. Synonyms:
|
||||
* <code>scale</code>, <code>size</code>.
|
||||
|
@ -605,4 +607,4 @@ Web3DOverlay* Web3DOverlay::createClone() const {
|
|||
|
||||
void Web3DOverlay::emitScriptEvent(const QVariant& message) {
|
||||
QMetaObject::invokeMethod(this, "scriptEventReceived", Q_ARG(QVariant, message));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,21 @@ public:
|
|||
AbstractLoggerInterface(QObject* parent = NULL);
|
||||
~AbstractLoggerInterface();
|
||||
inline bool extraDebugging() { return _extraDebugging; }
|
||||
inline void setExtraDebugging(bool debugging) { _extraDebugging = debugging; }
|
||||
inline bool debugPrint() { return _debugPrint; }
|
||||
inline bool infoPrint() { return _infoPrint; }
|
||||
inline bool criticalPrint() { return _criticalPrint; }
|
||||
inline bool warningPrint() { return _warningPrint; }
|
||||
inline bool suppressPrint() { return _suppressPrint; }
|
||||
inline bool fatalPrint() { return _fatalPrint; }
|
||||
inline bool unknownPrint() { return _unknownPrint; }
|
||||
inline void setExtraDebugging(bool extraDebugging) { _extraDebugging = extraDebugging; }
|
||||
inline void setDebugPrint(bool debugPrint) { _debugPrint = debugPrint; }
|
||||
inline void setInfoPrint(bool infoPrint) { _infoPrint = infoPrint; }
|
||||
inline void setCriticalPrint(bool criticalPrint) { _criticalPrint = criticalPrint; }
|
||||
inline void setWarningPrint(bool warningPrint) { _warningPrint = warningPrint; }
|
||||
inline void setSuppressPrint(bool suppressPrint) { _suppressPrint = suppressPrint; }
|
||||
inline void setFatalPrint(bool fatalPrint) { _fatalPrint = fatalPrint; }
|
||||
inline void setUnknownPrint(bool unknownPrint) { _unknownPrint = unknownPrint; }
|
||||
|
||||
virtual void addMessage(const QString&) = 0;
|
||||
virtual QString getLogData() = 0;
|
||||
|
@ -36,6 +50,13 @@ signals:
|
|||
|
||||
private:
|
||||
bool _extraDebugging{ false };
|
||||
bool _debugPrint{ false };
|
||||
bool _infoPrint{ false };
|
||||
bool _criticalPrint{ true };
|
||||
bool _warningPrint{ true };
|
||||
bool _suppressPrint{ true };
|
||||
bool _fatalPrint{ true };
|
||||
bool _unknownPrint{ true };
|
||||
};
|
||||
|
||||
#endif // hifi_AbstractLoggerInterface_h
|
||||
|
|
|
@ -261,15 +261,18 @@ HifiEntityUI.prototype = {
|
|||
addSection: function (parent, section, properties, index) {
|
||||
var self = this;
|
||||
|
||||
var sectionDivHeader = document.createElement("div");
|
||||
var title = document.createElement("label");
|
||||
var sectionDivHeader = document.createElement("fieldset");
|
||||
var title = document.createElement("legend");
|
||||
var dropDown = document.createElement("span");
|
||||
|
||||
dropDown.className = "arrow";
|
||||
sectionDivHeader.className = "section-header";
|
||||
sectionDivHeader.className = "major";
|
||||
title.className = "section-header";
|
||||
title.id = section + "-section";
|
||||
title.innerHTML = section;
|
||||
title.appendChild(dropDown);
|
||||
sectionDivHeader.appendChild(title);
|
||||
sectionDivHeader.appendChild(dropDown);
|
||||
|
||||
var collapsed = index !== 0;
|
||||
|
||||
dropDown.innerHTML = collapsed ? "L" : "M";
|
||||
|
@ -292,7 +295,7 @@ HifiEntityUI.prototype = {
|
|||
}
|
||||
}
|
||||
sectionDivBody.appendChild(animationWrapper);
|
||||
parent.appendChild(sectionDivBody);
|
||||
sectionDivHeader.appendChild(sectionDivBody);
|
||||
_.defer(function () {
|
||||
var height = (animationWrapper.clientHeight) + "px";
|
||||
if (collapsed) {
|
||||
|
@ -303,7 +306,7 @@ HifiEntityUI.prototype = {
|
|||
sectionDivBody.style.maxHeight = height;
|
||||
}
|
||||
|
||||
sectionDivHeader.onclick = function () {
|
||||
title.onclick = function () {
|
||||
collapsed = !collapsed;
|
||||
if (collapsed) {
|
||||
sectionDivBody.classList.remove("visible");
|
||||
|
@ -314,7 +317,7 @@ HifiEntityUI.prototype = {
|
|||
}
|
||||
// sectionDivBody.style.display = collapsed ? "none": "block";
|
||||
dropDown.innerHTML = collapsed ? "L" : "M";
|
||||
sectionDivHeader.setAttribute("collapsed", collapsed);
|
||||
title.setAttribute("collapsed", collapsed);
|
||||
};
|
||||
});
|
||||
},
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,8 +30,8 @@
|
|||
<link rel="stylesheet" type="text/css" href="particle-style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="particle-explorer">
|
||||
<div class="section-header">
|
||||
<div id="properties-list">
|
||||
<div class="section-header" id="main-header">
|
||||
<label> Particle Explorer </label>
|
||||
</div>
|
||||
<!-- This will be filled by the script! -->
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Reworked by Menithal on 20/5/2017
|
||||
// Reworked by Daniela Fontes and Artur Gomes (Mimicry) on 12/18/2017
|
||||
//
|
||||
// Web app side of the App - contains GUI.
|
||||
// This is an example of a new, easy way to do two way bindings between dynamically created GUI and in-world entities.
|
||||
|
@ -17,7 +18,7 @@
|
|||
|
||||
(function () {
|
||||
|
||||
var root = document.getElementById("particle-explorer");
|
||||
var root = document.getElementById("properties-list");
|
||||
|
||||
window.onload = function () {
|
||||
var ui = new HifiEntityUI(root);
|
||||
|
@ -51,6 +52,7 @@
|
|||
}
|
||||
};
|
||||
textarea.oninput = textarea.onchange;
|
||||
document.getElementById("show-properties-button").value = "Hide Properties";
|
||||
} else {
|
||||
textarea.onchange = function () {};
|
||||
textarea.oninput = textarea.onchange;
|
||||
|
@ -60,6 +62,7 @@
|
|||
insertZone.parentNode.clientHeight + "px";
|
||||
document.getElementById("export-properties-button").setAttribute("disabled", true);
|
||||
document.getElementById("import-properties-button").setAttribute("disabled", true);
|
||||
document.getElementById("show-properties-button").value = "Show Properties";
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue