File Browser: add back Delete, which now moves files to the trash

In Blender 2.7 delete would permanently delete files, now this function is back
but using more standard behavior.

This patch includes code contributed by Kris (Metricity).

Differential Revision: https://developer.blender.org/D4585
This commit is contained in:
Robert Guetzkow
2019-10-10 10:53:13 +02:00
committed by Brecht Van Lommel
parent 826db891ab
commit 8825250f5a
6 changed files with 217 additions and 8 deletions

View File

@@ -469,7 +469,12 @@ class FILEBROWSER_MT_context_menu(Menu):
layout.separator()
layout.operator("file.rename", text="Rename")
# layout.operator("file.delete")
sub = layout.row()
sub.operator_context = 'EXEC_DEFAULT'
sub.operator("file.delete", text="Delete")
layout.separator()
sub = layout.row()
sub.operator_context = 'EXEC_DEFAULT'
sub.operator("file.directory_new", text="New Folder")
@@ -503,5 +508,6 @@ classes = (
if __name__ == "__main__": # only for live edit.
from bpy.utils import register_class
for cls in classes:
register_class(cls)