mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:18:38 +02:00
Add a couple dialogs
This commit is contained in:
parent
028c7ab6ba
commit
169af80bc0
1 changed files with 25 additions and 8 deletions
|
@ -50,15 +50,35 @@ Window {
|
||||||
print("addToWorld");
|
print("addToWorld");
|
||||||
}
|
}
|
||||||
function renameFile() {
|
function renameFile() {
|
||||||
print("renameFile");
|
var object = desktop.inputDialog({
|
||||||
|
label: "Enter new path:",
|
||||||
|
prefilledText: "atp:/myFolder/myFile.ext",
|
||||||
|
placeholderText: "Enter path here"
|
||||||
|
});
|
||||||
|
object.selected.connect(function(destinationPath) {
|
||||||
|
console.log("Renaming " + "fileUrl" + " to " + destinationPath);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function deleteFile() {
|
function deleteFile() {
|
||||||
print("deleteFile");
|
var object = desktop.messageBox({
|
||||||
|
text: "Deleting",
|
||||||
|
informativeText: "You are about to delete the following file:\n" + "test" + "\nDo you want to continue?"
|
||||||
|
});
|
||||||
|
object.selected.connect(function(button) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function chooseClicked() {
|
function chooseClicked() {
|
||||||
var browser = fileBrowserBuilder.createObject(desktop, {
|
var browser = desktop.fileDialog({
|
||||||
selectDirectory: false,
|
selectDirectory: false,
|
||||||
folder: fileDialogHelper.pathToUrl(currentDirectory)
|
folder: fileDialogHelper.pathToUrl(currentDirectory)
|
||||||
});
|
});
|
||||||
|
@ -67,6 +87,8 @@ Window {
|
||||||
fileUrlTextField.text = fileDialogHelper.urlToPath(url);
|
fileUrlTextField.text = fileDialogHelper.urlToPath(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadClicked() {
|
function uploadClicked() {
|
||||||
|
@ -161,11 +183,6 @@ Window {
|
||||||
name: ""
|
name: ""
|
||||||
spacing: hifi.dimensions.contentSpacing.y
|
spacing: hifi.dimensions.contentSpacing.y
|
||||||
|
|
||||||
Component {
|
|
||||||
id: fileBrowserBuilder;
|
|
||||||
FileDialog { selectDirectory: true }
|
|
||||||
}
|
|
||||||
|
|
||||||
HifiControls.TextField {
|
HifiControls.TextField {
|
||||||
id: fileUrlTextField
|
id: fileUrlTextField
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
Loading…
Reference in a new issue