mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +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)
|
||||
|
||||
//HifiConstants { id: hifi }
|
||||
|
||||
AvatarProject {
|
||||
id: avatarProject
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: avatarPackagerMain
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
RalewaySemiBold {
|
||||
id: avatarPackagerLabel
|
||||
size: 24;
|
||||
AvatarProject {
|
||||
id: avatarProject
|
||||
colorScheme: root.colorScheme
|
||||
visible: false
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: avatarPackagerMain
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 25
|
||||
anchors.bottomMargin: 25
|
||||
text: 'Avatar Packager'
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
RalewaySemiBold {
|
||||
id: avatarPackagerLabel
|
||||
size: 24;
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 25
|
||||
anchors.bottomMargin: 25
|
||||
text: 'Avatar Packager'
|
||||
}
|
||||
}
|
||||
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({
|
||||
selectDirectory: false,
|
||||
dir: fileDialogHelper.pathToUrl(avatarProjectsPath),
|
||||
filter: "Avatar Project FST Files (*.fst)",
|
||||
title: "Open Project (.fst)"
|
||||
});
|
||||
// TODO: make the dialog modal
|
||||
|
||||
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) {
|
||||
console.log("FOUND PATH " + fileUrl);
|
||||
let fstFilePath = fileDialogHelper.urlToPath(fileUrl);
|
||||
let avatarProject = AvatarPackagerCore.openAvatarProject(fstFilePath);
|
||||
if (avatarProject) {
|
||||
console.log("LOAD COMPLETE");
|
||||
console.log("file dir = " + AvatarPackagerCore.currentAvatarProject.projectFolderPath);
|
||||
avatarProject.visible = true;
|
||||
avatarPackagerMain.visible = false;
|
||||
}
|
||||
});
|
||||
browser.selectedFile.connect(function(fileUrl) {
|
||||
console.log("FOUND PATH " + fileUrl);
|
||||
let fstFilePath = fileDialogHelper.urlToPath(fileUrl);
|
||||
let currentAvatarProject = AvatarPackagerCore.openAvatarProject(fstFilePath);
|
||||
if (currentAvatarProject) {
|
||||
console.log("LOAD COMPLETE");
|
||||
console.log("file dir = " + AvatarPackagerCore.currentAvatarProject.projectFolderPath);
|
||||
|
||||
avatarPackagerMain.visible = false;
|
||||
avatarProject.visible = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,15 +7,13 @@ import "../../controlsUit" 1.0 as HifiControls
|
|||
import "../../stylesUit" 1.0
|
||||
|
||||
Rectangle {
|
||||
id: avatarProject
|
||||
id: root
|
||||
|
||||
HifiConstants { id: hifi }
|
||||
|
||||
|
||||
z: 3
|
||||
property int colorScheme;
|
||||
|
||||
visible: false
|
||||
visible: true
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
@ -37,7 +35,7 @@ Rectangle {
|
|||
anchors.right: parent.right
|
||||
anchors.top: avatarProjectLabel.bottom
|
||||
text: qsTr("Open Project Folder")
|
||||
colorScheme: avatarProject.colorScheme
|
||||
colorScheme: root.colorScheme
|
||||
height: 30
|
||||
onClicked: function() {
|
||||
fileDialogHelper.openDirectory(AvatarPackagerCore.currentAvatarProject.projectFolderPath);
|
||||
|
@ -50,7 +48,7 @@ Rectangle {
|
|||
anchors.top: openFolderButton.bottom
|
||||
text: qsTr("Upload")
|
||||
color: hifi.buttons.blue
|
||||
colorScheme: avatarProject.colorScheme
|
||||
colorScheme: root.colorScheme
|
||||
height: 30
|
||||
onClicked: function() {
|
||||
|
||||
|
|
|
@ -28,7 +28,8 @@ bool AvatarPackager::open() {
|
|||
|
||||
QObject* AvatarPackager::openAvatarProject(QString avatarProjectFSTPath) {
|
||||
if (_currentAvatarProject) {
|
||||
_currentAvatarProject->deleteLater();
|
||||
//_currentAvatarProject->deleteLater();
|
||||
//_currentAvatarProject = nullptr;
|
||||
}
|
||||
_currentAvatarProject = AvatarProject::openAvatarProject(avatarProjectFSTPath);
|
||||
return _currentAvatarProject;
|
||||
|
|
Loading…
Reference in a new issue