mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 19:20:16 +02:00
show project page
This commit is contained in:
parent
c0bd9121fb
commit
96673bb5b9
3 changed files with 70 additions and 64 deletions
|
@ -22,76 +22,83 @@ Windows.ScrollingWindow {
|
||||||
minSize: Qt.vector2d(200, 300)
|
minSize: Qt.vector2d(200, 300)
|
||||||
|
|
||||||
//HifiConstants { id: hifi }
|
//HifiConstants { id: hifi }
|
||||||
|
|
||||||
AvatarProject {
|
|
||||||
id: avatarProject
|
|
||||||
colorScheme: root.colorScheme
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: avatarPackagerMain
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
RalewaySemiBold {
|
AvatarProject {
|
||||||
id: avatarPackagerLabel
|
id: avatarProject
|
||||||
size: 24;
|
colorScheme: root.colorScheme
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: avatarPackagerMain
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 25
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: 25
|
RalewaySemiBold {
|
||||||
text: 'Avatar Packager'
|
id: avatarPackagerLabel
|
||||||
}
|
size: 24;
|
||||||
|
anchors.left: parent.left
|
||||||
HifiControls.Button {
|
anchors.top: parent.top
|
||||||
id: createProjectButton
|
anchors.topMargin: 25
|
||||||
anchors.left: parent.left
|
anchors.bottomMargin: 25
|
||||||
anchors.right: parent.right
|
text: 'Avatar Packager'
|
||||||
anchors.top: avatarPackagerLabel.bottom
|
|
||||||
text: qsTr("Create Project")
|
|
||||||
colorScheme: root.colorScheme
|
|
||||||
height: 30
|
|
||||||
onClicked: function() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
HifiControls.Button {
|
|
||||||
id: openProjectButton
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: createProjectButton.bottom
|
|
||||||
text: qsTr("Open Avatar Project")
|
|
||||||
colorScheme: root.colorScheme
|
|
||||||
height: 30
|
|
||||||
onClicked: function() {
|
|
||||||
var avatarProjectsPath = fileDialogHelper.standardPath(/*fileDialogHelper.StandardLocation.DocumentsLocation*/ 1) + "/High Fidelity/Avatar Projects";
|
|
||||||
console.log("path = " + avatarProjectsPath);
|
|
||||||
|
|
||||||
// TODO: make the dialog modal
|
HifiControls.Button {
|
||||||
|
id: createProjectButton
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: avatarPackagerLabel.bottom
|
||||||
|
text: qsTr("Create Project")
|
||||||
|
colorScheme: root.colorScheme
|
||||||
|
height: 30
|
||||||
|
onClicked: function() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HifiControls.Button {
|
||||||
|
id: openProjectButton
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: createProjectButton.bottom
|
||||||
|
text: qsTr("Open Avatar Project")
|
||||||
|
colorScheme: root.colorScheme
|
||||||
|
height: 30
|
||||||
|
onClicked: function() {
|
||||||
|
var avatarProjectsPath = fileDialogHelper.standardPath(/*fileDialogHelper.StandardLocation.DocumentsLocation*/ 1) + "/High Fidelity/Avatar Projects";
|
||||||
|
console.log("path = " + avatarProjectsPath);
|
||||||
|
|
||||||
var browser = desktop.fileDialog({
|
// TODO: make the dialog modal
|
||||||
selectDirectory: false,
|
|
||||||
dir: fileDialogHelper.pathToUrl(avatarProjectsPath),
|
|
||||||
filter: "Avatar Project FST Files (*.fst)",
|
|
||||||
title: "Open Project (.fst)"
|
|
||||||
});
|
|
||||||
|
|
||||||
browser.canceled.connect(function() {
|
var browser = desktop.fileDialog({
|
||||||
|
selectDirectory: false,
|
||||||
|
dir: fileDialogHelper.pathToUrl(avatarProjectsPath),
|
||||||
|
filter: "Avatar Project FST Files (*.fst)",
|
||||||
|
title: "Open Project (.fst)"
|
||||||
|
});
|
||||||
|
|
||||||
|
browser.canceled.connect(function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
browser.selectedFile.connect(function(fileUrl) {
|
browser.selectedFile.connect(function(fileUrl) {
|
||||||
console.log("FOUND PATH " + fileUrl);
|
console.log("FOUND PATH " + fileUrl);
|
||||||
let fstFilePath = fileDialogHelper.urlToPath(fileUrl);
|
let fstFilePath = fileDialogHelper.urlToPath(fileUrl);
|
||||||
let avatarProject = AvatarPackagerCore.openAvatarProject(fstFilePath);
|
let currentAvatarProject = AvatarPackagerCore.openAvatarProject(fstFilePath);
|
||||||
if (avatarProject) {
|
if (currentAvatarProject) {
|
||||||
console.log("LOAD COMPLETE");
|
console.log("LOAD COMPLETE");
|
||||||
console.log("file dir = " + AvatarPackagerCore.currentAvatarProject.projectFolderPath);
|
console.log("file dir = " + AvatarPackagerCore.currentAvatarProject.projectFolderPath);
|
||||||
avatarProject.visible = true;
|
|
||||||
avatarPackagerMain.visible = false;
|
avatarPackagerMain.visible = false;
|
||||||
}
|
avatarProject.visible = true;
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,15 +7,13 @@ import "../../controlsUit" 1.0 as HifiControls
|
||||||
import "../../stylesUit" 1.0
|
import "../../stylesUit" 1.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: avatarProject
|
id: root
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
|
|
||||||
z: 3
|
|
||||||
property int colorScheme;
|
property int colorScheme;
|
||||||
|
|
||||||
visible: false
|
visible: true
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@ -37,7 +35,7 @@ Rectangle {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: avatarProjectLabel.bottom
|
anchors.top: avatarProjectLabel.bottom
|
||||||
text: qsTr("Open Project Folder")
|
text: qsTr("Open Project Folder")
|
||||||
colorScheme: avatarProject.colorScheme
|
colorScheme: root.colorScheme
|
||||||
height: 30
|
height: 30
|
||||||
onClicked: function() {
|
onClicked: function() {
|
||||||
fileDialogHelper.openDirectory(AvatarPackagerCore.currentAvatarProject.projectFolderPath);
|
fileDialogHelper.openDirectory(AvatarPackagerCore.currentAvatarProject.projectFolderPath);
|
||||||
|
@ -50,7 +48,7 @@ Rectangle {
|
||||||
anchors.top: openFolderButton.bottom
|
anchors.top: openFolderButton.bottom
|
||||||
text: qsTr("Upload")
|
text: qsTr("Upload")
|
||||||
color: hifi.buttons.blue
|
color: hifi.buttons.blue
|
||||||
colorScheme: avatarProject.colorScheme
|
colorScheme: root.colorScheme
|
||||||
height: 30
|
height: 30
|
||||||
onClicked: function() {
|
onClicked: function() {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,8 @@ bool AvatarPackager::open() {
|
||||||
|
|
||||||
QObject* AvatarPackager::openAvatarProject(QString avatarProjectFSTPath) {
|
QObject* AvatarPackager::openAvatarProject(QString avatarProjectFSTPath) {
|
||||||
if (_currentAvatarProject) {
|
if (_currentAvatarProject) {
|
||||||
_currentAvatarProject->deleteLater();
|
//_currentAvatarProject->deleteLater();
|
||||||
|
//_currentAvatarProject = nullptr;
|
||||||
}
|
}
|
||||||
_currentAvatarProject = AvatarProject::openAvatarProject(avatarProjectFSTPath);
|
_currentAvatarProject = AvatarProject::openAvatarProject(avatarProjectFSTPath);
|
||||||
return _currentAvatarProject;
|
return _currentAvatarProject;
|
||||||
|
|
Loading…
Reference in a new issue