mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
working menu item
This commit is contained in:
parent
10c054165f
commit
3eecba77f2
6 changed files with 78 additions and 1 deletions
|
@ -589,7 +589,9 @@ Menu::Menu() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Developer >> Tests >>>
|
||||||
|
MenuWrapper* testMenu = developerMenu->addMenu("Tests");
|
||||||
|
addActionToQMenuAndActionHash(testMenu, MenuOption::RunClientScriptTests, 0, dialogsManager.data(), SLOT(showTestingResults()));
|
||||||
|
|
||||||
// Developer > Timing >>>
|
// Developer > Timing >>>
|
||||||
MenuWrapper* timingMenu = developerMenu->addMenu("Timing");
|
MenuWrapper* timingMenu = developerMenu->addMenu("Timing");
|
||||||
|
|
|
@ -172,6 +172,7 @@ namespace MenuOption {
|
||||||
const QString ResetAvatarSize = "Reset Avatar Size";
|
const QString ResetAvatarSize = "Reset Avatar Size";
|
||||||
const QString ResetSensors = "Reset Sensors";
|
const QString ResetSensors = "Reset Sensors";
|
||||||
const QString RunningScripts = "Running Scripts...";
|
const QString RunningScripts = "Running Scripts...";
|
||||||
|
const QString RunClientScriptTests = "Run Client Script Tests";
|
||||||
const QString RunTimingTests = "Run Timing Tests";
|
const QString RunTimingTests = "Run Timing Tests";
|
||||||
const QString ScriptEditor = "Script Editor...";
|
const QString ScriptEditor = "Script Editor...";
|
||||||
const QString ScriptedMotorControl = "Enable Scripted Motor Control";
|
const QString ScriptedMotorControl = "Enable Scripted Motor Control";
|
||||||
|
|
|
@ -158,6 +158,15 @@ void DialogsManager::showScriptEditor() {
|
||||||
_scriptEditor->raise();
|
_scriptEditor->raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogsManager::showTestingResults() {
|
||||||
|
if (!_testingDialog) {
|
||||||
|
_testingDialog = new TestingDialog(qApp->getWindow());
|
||||||
|
connect(_testingDialog, SIGNAL(closed()), _testingDialog, SLOT(deleteLater()));
|
||||||
|
}
|
||||||
|
_testingDialog->show();
|
||||||
|
_testingDialog->raise();
|
||||||
|
}
|
||||||
|
|
||||||
void DialogsManager::showDomainConnectionDialog() {
|
void DialogsManager::showDomainConnectionDialog() {
|
||||||
// if the dialog already exists we delete it so the connection data is refreshed
|
// if the dialog already exists we delete it so the connection data is refreshed
|
||||||
if (_domainConnectionDialog) {
|
if (_domainConnectionDialog) {
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
|
|
||||||
#include "HMDToolsDialog.h"
|
#include "HMDToolsDialog.h"
|
||||||
|
#include "TestingDialog.h"
|
||||||
|
|
||||||
class AnimationsDialog;
|
class AnimationsDialog;
|
||||||
class AttachmentsDialog;
|
class AttachmentsDialog;
|
||||||
|
@ -26,6 +27,7 @@ class DiskCacheEditor;
|
||||||
class LodToolsDialog;
|
class LodToolsDialog;
|
||||||
class OctreeStatsDialog;
|
class OctreeStatsDialog;
|
||||||
class ScriptEditorWindow;
|
class ScriptEditorWindow;
|
||||||
|
class TestingDialog;
|
||||||
class QMessageBox;
|
class QMessageBox;
|
||||||
class DomainConnectionDialog;
|
class DomainConnectionDialog;
|
||||||
|
|
||||||
|
@ -38,6 +40,7 @@ public:
|
||||||
QPointer<HMDToolsDialog> getHMDToolsDialog() const { return _hmdToolsDialog; }
|
QPointer<HMDToolsDialog> getHMDToolsDialog() const { return _hmdToolsDialog; }
|
||||||
QPointer<LodToolsDialog> getLodToolsDialog() const { return _lodToolsDialog; }
|
QPointer<LodToolsDialog> getLodToolsDialog() const { return _lodToolsDialog; }
|
||||||
QPointer<OctreeStatsDialog> getOctreeStatsDialog() const { return _octreeStatsDialog; }
|
QPointer<OctreeStatsDialog> getOctreeStatsDialog() const { return _octreeStatsDialog; }
|
||||||
|
QPointer<TestingDialog> getTestingDialog() const { return _testingDialog; }
|
||||||
void emitAddressBarShown(bool visible) { emit addressBarShown(visible); }
|
void emitAddressBarShown(bool visible) { emit addressBarShown(visible); }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -55,6 +58,7 @@ public slots:
|
||||||
void hmdTools(bool showTools);
|
void hmdTools(bool showTools);
|
||||||
void showScriptEditor();
|
void showScriptEditor();
|
||||||
void showDomainConnectionDialog();
|
void showDomainConnectionDialog();
|
||||||
|
void showTestingResults();
|
||||||
|
|
||||||
// Application Update
|
// Application Update
|
||||||
void showUpdateDialog();
|
void showUpdateDialog();
|
||||||
|
@ -83,6 +87,7 @@ private:
|
||||||
QPointer<LodToolsDialog> _lodToolsDialog;
|
QPointer<LodToolsDialog> _lodToolsDialog;
|
||||||
QPointer<OctreeStatsDialog> _octreeStatsDialog;
|
QPointer<OctreeStatsDialog> _octreeStatsDialog;
|
||||||
QPointer<ScriptEditorWindow> _scriptEditor;
|
QPointer<ScriptEditorWindow> _scriptEditor;
|
||||||
|
QPointer<TestingDialog> _testingDialog;
|
||||||
QPointer<DomainConnectionDialog> _domainConnectionDialog;
|
QPointer<DomainConnectionDialog> _domainConnectionDialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
35
interface/src/ui/TestingDialog.cpp
Normal file
35
interface/src/ui/TestingDialog.cpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
//
|
||||||
|
// TestingDialog.cpp
|
||||||
|
// interface/src/ui
|
||||||
|
//
|
||||||
|
// Created by Ryan Jones on 12/3/2016.
|
||||||
|
// Copyright 2016 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 <ScriptEngines.h>
|
||||||
|
|
||||||
|
#include "ui/TestingDialog.h"
|
||||||
|
#include "Application.h"
|
||||||
|
|
||||||
|
TestingDialog::TestingDialog(QWidget* parent) :
|
||||||
|
QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint)
|
||||||
|
{
|
||||||
|
DependencyManager::get<ScriptEngines>()->loadOneScript(qApp->applicationDirPath() + testRunnerRelativePath);
|
||||||
|
this->setWindowTitle(windowLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
TestingDialog::~TestingDialog() {
|
||||||
|
// TODO: Clean up here?
|
||||||
|
}
|
||||||
|
|
||||||
|
void TestingDialog::reject() {
|
||||||
|
this->QDialog::close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TestingDialog::closeEvent(QCloseEvent* event) {
|
||||||
|
this->QDialog::closeEvent(event);
|
||||||
|
emit closed();
|
||||||
|
}
|
25
interface/src/ui/TestingDialog.h
Normal file
25
interface/src/ui/TestingDialog.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef hifi_TestingDialog_h
|
||||||
|
#define hifi_TestingDialog_h
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
const QString windowLabel = "Testing Dialog";
|
||||||
|
const QString testRunnerRelativePath = "/scripts/developer/tests/bindUnitTest.js";
|
||||||
|
|
||||||
|
class TestingDialog : public QDialog {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
TestingDialog(QWidget* parent);
|
||||||
|
~TestingDialog();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void closed();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void reject() override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void closeEvent(QCloseEvent*) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in a new issue