mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 18:14:40 +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");
|
||||
}
|
||||
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() {
|
||||
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() {
|
||||
var browser = fileBrowserBuilder.createObject(desktop, {
|
||||
var browser = desktop.fileDialog({
|
||||
selectDirectory: false,
|
||||
folder: fileDialogHelper.pathToUrl(currentDirectory)
|
||||
});
|
||||
|
@ -67,6 +87,8 @@ Window {
|
|||
fileUrlTextField.text = fileDialogHelper.urlToPath(url);
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function uploadClicked() {
|
||||
|
@ -161,11 +183,6 @@ Window {
|
|||
name: ""
|
||||
spacing: hifi.dimensions.contentSpacing.y
|
||||
|
||||
Component {
|
||||
id: fileBrowserBuilder;
|
||||
FileDialog { selectDirectory: true }
|
||||
}
|
||||
|
||||
HifiControls.TextField {
|
||||
id: fileUrlTextField
|
||||
anchors.left: parent.left
|
||||
|
|
Loading…
Reference in a new issue