Add renaming to Asset qml

This commit is contained in:
Ryan Huffman 2016-03-09 16:29:17 -08:00
parent d299ce2677
commit f23057b1c0

View file

@ -33,7 +33,7 @@ Window {
HifiConstants { id: hifi }
property var scripts: ScriptDiscoveryService;
property var scriptsModel: Assets.getAssetMappingModel()
property var scriptsModel: Assets.mappingModel;
property var currentDirectory;
Settings {
@ -52,6 +52,7 @@ Window {
}
function renameFile() {
var path = scriptsModel.data(treeView.currentIndex, 0x100);
print(path);
if (!path) {
return;
}
@ -63,16 +64,15 @@ Window {
});
object.selected.connect(function(destinationPath) {
console.log("Renaming " + path + " to " + destinationPath);
Assets.renameMapping(path, destinationPath, function(err) {
print("Finished rename: ", err);
reload();
});
});
}
function deleteFile() {
var path = scriptsModel.data(treeView.currentIndex, 0x100);
print(path);
print(treeView.currentIndex, path);
if (!path) {
return;
}
@ -94,8 +94,6 @@ Window {
print("Finished deleting path: ", path, err);
reload();
});
}
});
}