mirror of
https://github.com/overte-org/overte.git
synced 2025-04-29 21:42:42 +02:00
Display avatar settings dialog in tablet
This commit is contained in:
parent
9f56d2f6f6
commit
b9869264ba
4 changed files with 55 additions and 1 deletions
|
@ -0,0 +1,41 @@
|
||||||
|
//
|
||||||
|
// TabletAvatarPreferences.qml
|
||||||
|
//
|
||||||
|
// Created by Davd Rowe on 2 Mar 2017.
|
||||||
|
// 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 "tabletWindows"
|
||||||
|
import "../../dialogs"
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
|
StackView {
|
||||||
|
id: profileRoot
|
||||||
|
initialItem: root
|
||||||
|
objectName: "stack"
|
||||||
|
|
||||||
|
property var eventBridge;
|
||||||
|
signal sendToScript(var message);
|
||||||
|
|
||||||
|
function pushSource(path) {
|
||||||
|
editRoot.push(Qt.reslovedUrl(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
function popSource() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
TabletPreferencesDialog {
|
||||||
|
id: root
|
||||||
|
objectName: "TabletAvatarPreferences"
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
showCategories: ["Avatar Basics", "Avatar Tuning", "Avatar Camera"]
|
||||||
|
}
|
||||||
|
}
|
|
@ -5853,6 +5853,16 @@ void Application::addAssetToWorldFromURL(QString url) {
|
||||||
request->send();
|
request->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::showDialog(const QString& desktopURL, const QString& tabletURL, const QString& name) const {
|
||||||
|
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||||
|
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||||
|
if (tablet->getToolbarMode() && tablet->getTabletRoot() && !isHMDMode()) {
|
||||||
|
DependencyManager::get<OffscreenUi>()->show(desktopURL, name);
|
||||||
|
} else {
|
||||||
|
tablet->loadQMLSource(tabletURL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Application::addAssetToWorldFromURLRequestFinished() {
|
void Application::addAssetToWorldFromURLRequestFinished() {
|
||||||
auto request = qobject_cast<ResourceRequest*>(sender());
|
auto request = qobject_cast<ResourceRequest*>(sender());
|
||||||
auto url = request->getUrl().toString();
|
auto url = request->getUrl().toString();
|
||||||
|
|
|
@ -331,6 +331,8 @@ public slots:
|
||||||
void toggleRunningScriptsWidget() const;
|
void toggleRunningScriptsWidget() const;
|
||||||
Q_INVOKABLE void showAssetServerWidget(QString filePath = "");
|
Q_INVOKABLE void showAssetServerWidget(QString filePath = "");
|
||||||
|
|
||||||
|
void showDialog(const QString& desktopURL, const QString& tabletURL, const QString& name) const;
|
||||||
|
|
||||||
// FIXME: Move addAssetToWorld* methods to own class?
|
// FIXME: Move addAssetToWorld* methods to own class?
|
||||||
void addAssetToWorldFromURL(QString url);
|
void addAssetToWorldFromURL(QString url);
|
||||||
void addAssetToWorldFromURLRequestFinished();
|
void addAssetToWorldFromURLRequestFinished();
|
||||||
|
|
|
@ -300,7 +300,8 @@ Menu::Menu() {
|
||||||
// Settings > Avatar...
|
// Settings > Avatar...
|
||||||
action = addActionToQMenuAndActionHash(settingsMenu, "Avatar...");
|
action = addActionToQMenuAndActionHash(settingsMenu, "Avatar...");
|
||||||
connect(action, &QAction::triggered, [] {
|
connect(action, &QAction::triggered, [] {
|
||||||
DependencyManager::get<OffscreenUi>()->toggle(QString("hifi/dialogs/AvatarPreferencesDialog.qml"), "AvatarPreferencesDialog");
|
qApp->showDialog(QString("hifi/dialogs/AvatarPreferencesDialog.qml"),
|
||||||
|
QString("../../hifi/tablet/TabletAvatarPreferences.qml"), "AvatarPreferencesDialog");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Settings > LOD...
|
// Settings > LOD...
|
||||||
|
|
Loading…
Reference in a new issue