mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:17:02 +02:00
Add renaming to Asset qml
This commit is contained in:
parent
d299ce2677
commit
f23057b1c0
1 changed files with 7 additions and 9 deletions
|
@ -33,7 +33,7 @@ Window {
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
property var scripts: ScriptDiscoveryService;
|
property var scripts: ScriptDiscoveryService;
|
||||||
property var scriptsModel: Assets.getAssetMappingModel()
|
property var scriptsModel: Assets.mappingModel;
|
||||||
property var currentDirectory;
|
property var currentDirectory;
|
||||||
|
|
||||||
Settings {
|
Settings {
|
||||||
|
@ -52,6 +52,7 @@ Window {
|
||||||
}
|
}
|
||||||
function renameFile() {
|
function renameFile() {
|
||||||
var path = scriptsModel.data(treeView.currentIndex, 0x100);
|
var path = scriptsModel.data(treeView.currentIndex, 0x100);
|
||||||
|
print(path);
|
||||||
if (!path) {
|
if (!path) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -63,16 +64,15 @@ Window {
|
||||||
});
|
});
|
||||||
object.selected.connect(function(destinationPath) {
|
object.selected.connect(function(destinationPath) {
|
||||||
console.log("Renaming " + path + " to " + destinationPath);
|
console.log("Renaming " + path + " to " + destinationPath);
|
||||||
|
Assets.renameMapping(path, destinationPath, function(err) {
|
||||||
|
print("Finished rename: ", err);
|
||||||
|
reload();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function deleteFile() {
|
function deleteFile() {
|
||||||
var path = scriptsModel.data(treeView.currentIndex, 0x100);
|
var path = scriptsModel.data(treeView.currentIndex, 0x100);
|
||||||
print(path);
|
print(treeView.currentIndex, path);
|
||||||
if (!path) {
|
if (!path) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -94,8 +94,6 @@ Window {
|
||||||
print("Finished deleting path: ", path, err);
|
print("Finished deleting path: ", path, err);
|
||||||
reload();
|
reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue