mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 03:04:40 +02:00
inpput configutration stub
This commit is contained in:
parent
e1d37f2167
commit
f0f10f74c6
8 changed files with 154 additions and 13 deletions
95
interface/resources/qml/hifi/tablet/InputConfiguration.qml
Normal file
95
interface/resources/qml/hifi/tablet/InputConfiguration.qml
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
//
|
||||||
|
// Created by Dante Ruiz on 6/1/17.
|
||||||
|
// Copyright 2017 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
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
import "../../styles-uit"
|
||||||
|
import "../../controls"
|
||||||
|
import "../../controls-uit" as HifiControls
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: inputConfiguration
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
|
color: hifi.colors.baseGray
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: inputConfiguration.width
|
||||||
|
height: 1
|
||||||
|
color: hifi.colors.baseGrayShadow
|
||||||
|
x: -hifi.dimensions.contentMargin.x
|
||||||
|
}
|
||||||
|
|
||||||
|
RalewayBold {
|
||||||
|
id: header
|
||||||
|
text: "Controller Settings"
|
||||||
|
size: 22
|
||||||
|
color: "white"
|
||||||
|
|
||||||
|
anchors.top: inputConfiguration.top
|
||||||
|
anchors.left: inputConfiguration.left
|
||||||
|
anchors.leftMargin: 20
|
||||||
|
anchors.topMargin: 20
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
id: headerSeparator
|
||||||
|
width: inputConfiguration.width
|
||||||
|
anchors.top: header.bottom
|
||||||
|
anchors.topMargin: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
RalewayBold {
|
||||||
|
id: configuration
|
||||||
|
text: "SELECT DEVICE"
|
||||||
|
size: 18
|
||||||
|
color: hifi.colors.lightGray
|
||||||
|
|
||||||
|
|
||||||
|
anchors.top: headerSeparator.bottom
|
||||||
|
anchors.left: inputConfiguration.left
|
||||||
|
anchors.leftMargin: 20
|
||||||
|
anchors.topMargin: 20
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: configRow
|
||||||
|
|
||||||
|
anchors.top: configuration.bottom
|
||||||
|
anchors.topMargin: 20
|
||||||
|
anchors.left: configuration.left
|
||||||
|
anchors.leftMargin: 40
|
||||||
|
spacing: 10
|
||||||
|
HifiControls.ComboBox {
|
||||||
|
id: box
|
||||||
|
width: 160
|
||||||
|
|
||||||
|
colorScheme: hifi.colorSchemes.dark
|
||||||
|
model: inputPlugins()
|
||||||
|
}
|
||||||
|
|
||||||
|
HifiControls.CheckBox {
|
||||||
|
onClicked: {
|
||||||
|
if (checked) {
|
||||||
|
console.log("button checked");
|
||||||
|
Tablet.getTablet("");
|
||||||
|
InputConfiguration.inputPlugins();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function inputPlugins() {
|
||||||
|
var plugins = ["temp"];
|
||||||
|
return plugins
|
||||||
|
}
|
||||||
|
}
|
26
interface/resources/qml/styles-uit/Separator.qml
Normal file
26
interface/resources/qml/styles-uit/Separator.qml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
//
|
||||||
|
// Created by Dante Ruiz on 6/1/17.
|
||||||
|
// Copyright 2017 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
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Rectangle {
|
||||||
|
id: shadows
|
||||||
|
width: parent.width
|
||||||
|
height: 2
|
||||||
|
color: hifi.colors.baseGrayShadow
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
anchors.top: shadows.bottom
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
}
|
||||||
|
}
|
|
@ -79,6 +79,7 @@
|
||||||
#include <input-plugins/InputPlugin.h>
|
#include <input-plugins/InputPlugin.h>
|
||||||
#include <controllers/UserInputMapper.h>
|
#include <controllers/UserInputMapper.h>
|
||||||
#include <controllers/InputRecorder.h>
|
#include <controllers/InputRecorder.h>
|
||||||
|
#include <plugins/InputConfiguration.h>
|
||||||
#include <controllers/ScriptingInterface.h>
|
#include <controllers/ScriptingInterface.h>
|
||||||
#include <controllers/StateController.h>
|
#include <controllers/StateController.h>
|
||||||
#include <UserActivityLoggerScriptingInterface.h>
|
#include <UserActivityLoggerScriptingInterface.h>
|
||||||
|
@ -522,6 +523,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {
|
||||||
STATE_CAMERA_FIRST_PERSON, STATE_CAMERA_THIRD_PERSON, STATE_CAMERA_ENTITY, STATE_CAMERA_INDEPENDENT,
|
STATE_CAMERA_FIRST_PERSON, STATE_CAMERA_THIRD_PERSON, STATE_CAMERA_ENTITY, STATE_CAMERA_INDEPENDENT,
|
||||||
STATE_SNAP_TURN, STATE_ADVANCED_MOVEMENT_CONTROLS, STATE_GROUNDED, STATE_NAV_FOCUSED } });
|
STATE_SNAP_TURN, STATE_ADVANCED_MOVEMENT_CONTROLS, STATE_GROUNDED, STATE_NAV_FOCUSED } });
|
||||||
DependencyManager::set<UserInputMapper>();
|
DependencyManager::set<UserInputMapper>();
|
||||||
|
DependencyManager::set<InputConfiguration>();
|
||||||
DependencyManager::set<controller::ScriptingInterface, ControllerScriptingInterface>();
|
DependencyManager::set<controller::ScriptingInterface, ControllerScriptingInterface>();
|
||||||
DependencyManager::set<InterfaceParentFinder>();
|
DependencyManager::set<InterfaceParentFinder>();
|
||||||
DependencyManager::set<EntityTreeRenderer>(true, qApp, qApp);
|
DependencyManager::set<EntityTreeRenderer>(true, qApp, qApp);
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <AudioClient.h>
|
#include <AudioClient.h>
|
||||||
#include <CrashHelpers.h>
|
#include <CrashHelpers.h>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
|
#include <TabletScriptingInterface.h>
|
||||||
#include <display-plugins/DisplayPlugin.h>
|
#include <display-plugins/DisplayPlugin.h>
|
||||||
#include <PathUtils.h>
|
#include <PathUtils.h>
|
||||||
#include <SettingHandle.h>
|
#include <SettingHandle.h>
|
||||||
|
@ -311,6 +312,12 @@ Menu::Menu() {
|
||||||
QString("../../hifi/tablet/TabletLodPreferences.qml"), "LodPreferencesDialog");
|
QString("../../hifi/tablet/TabletLodPreferences.qml"), "LodPreferencesDialog");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
action = addActionToQMenuAndActionHash(settingsMenu, "InputConfiguration");
|
||||||
|
connect(action, &QAction::triggered, [] {
|
||||||
|
auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
tablet->loadQMLSource("InputConfiguration.qml");
|
||||||
|
});
|
||||||
|
|
||||||
// Settings > Control with Speech [advanced]
|
// Settings > Control with Speech [advanced]
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||||
auto speechRecognizer = DependencyManager::get<SpeechRecognizer>();
|
auto speechRecognizer = DependencyManager::get<SpeechRecognizer>();
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include "ui/AvatarInputs.h"
|
#include "ui/AvatarInputs.h"
|
||||||
#include "avatar/AvatarManager.h"
|
#include "avatar/AvatarManager.h"
|
||||||
#include "scripting/GlobalServicesScriptingInterface.h"
|
#include "scripting/GlobalServicesScriptingInterface.h"
|
||||||
|
#include <plugins/InputConfiguration.h>
|
||||||
#include "ui/Snapshot.h"
|
#include "ui/Snapshot.h"
|
||||||
|
|
||||||
static const float DPI = 30.47f;
|
static const float DPI = 30.47f;
|
||||||
|
@ -201,7 +202,7 @@ void Web3DOverlay::loadSourceURL() {
|
||||||
_webSurface->getRootContext()->setContextProperty("GlobalServices", GlobalServicesScriptingInterface::getInstance());
|
_webSurface->getRootContext()->setContextProperty("GlobalServices", GlobalServicesScriptingInterface::getInstance());
|
||||||
_webSurface->getRootContext()->setContextProperty("AvatarList", DependencyManager::get<AvatarManager>().data());
|
_webSurface->getRootContext()->setContextProperty("AvatarList", DependencyManager::get<AvatarManager>().data());
|
||||||
_webSurface->getRootContext()->setContextProperty("DialogsManager", DialogsManagerScriptingInterface::getInstance());
|
_webSurface->getRootContext()->setContextProperty("DialogsManager", DialogsManagerScriptingInterface::getInstance());
|
||||||
|
_webSurface->getRootContext()->setContextProperty("InputConfiguration", DependencyManager::get<InputConfiguration>().data());
|
||||||
_webSurface->getRootContext()->setContextProperty("pathToFonts", "../../");
|
_webSurface->getRootContext()->setContextProperty("pathToFonts", "../../");
|
||||||
tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", _webSurface->getRootItem(), _webSurface.data());
|
tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", _webSurface->getRootItem(), _webSurface.data());
|
||||||
|
|
||||||
|
|
BIN
libraries/plugins/src/plugins/.#PluginManager.h
Normal file
BIN
libraries/plugins/src/plugins/.#PluginManager.h
Normal file
Binary file not shown.
|
@ -9,9 +9,18 @@
|
||||||
|
|
||||||
#include "InputConfiguration.h"
|
#include "InputConfiguration.h"
|
||||||
|
|
||||||
namespace controller {
|
#include "PluginManager.h"
|
||||||
|
|
||||||
InputConfiguration::InputConfiguration() {
|
InputConfiguration::InputConfiguration() {
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InputConfiguration::inputPlugins() {
|
||||||
|
PluginManager* inputPlugin = PluginManager::getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
void InputConfiguration::enabledInputPlugins() {
|
||||||
|
qDebug() << "getting enabled plugins";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,16 +11,17 @@
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
#include <RegisteredMetaTypes.h>
|
|
||||||
|
|
||||||
namespace controller {
|
class InputConfiguration : public QObject, public Dependency {
|
||||||
|
Q_OBJECT
|
||||||
class InputConfiguration : public QObject, public Dependency {
|
public:
|
||||||
public:
|
InputConfiguration();
|
||||||
InputConfiguration();
|
|
||||||
~InputConfiguration() {}
|
void inputPlugins();
|
||||||
};
|
public slots:
|
||||||
}
|
void enabledInputPlugins();
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in a new issue