Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2009-07-26 22:52:27 +0400
committerAndrea Weikert <elubie@gmx.net>2009-07-26 22:52:27 +0400
commitcbb9dfaab80ed52950a4ea4c1570370eddacfa64 (patch)
tree3df161c74b8d43634bfb032f2ada65d6496b3cad /source/blender/editors/space_file/space_file.c
parent4741137fc9639a3902a0a7bbbebb7256841ac027 (diff)
2.5 file browser
* operator for create new directory activated (IKEY) * operator for rename (works on files and directories so far) (CTRL+LMB) Note: fail to rename is rather quiet, no message popup, just doesn't rename if it can't. So far checked that (On Windows Vista) rename fails on system directories, which I think acceptable. Note: I removed the code that (silently) deletes file if I rename file to an existing one. Considered harmful :)
Diffstat (limited to 'source/blender/editors/space_file/space_file.c')
-rw-r--r--source/blender/editors/space_file/space_file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 077ad65830c..cdf65fc5af2 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -272,7 +272,7 @@ static void file_main_area_draw(const bContext *C, ARegion *ar)
float col[3];
/* Needed, because filelist is not initialized on loading */
- if (!sfile->files)
+ if (!sfile->files || filelist_empty(sfile->files))
file_refresh(C, NULL);
layout = ED_fileselect_get_layout(sfile, ar);
@@ -346,6 +346,7 @@ void file_operatortypes(void)
WM_operatortype_append(FILE_OT_filenum);
WM_operatortype_append(FILE_OT_directory_new);
WM_operatortype_append(FILE_OT_delete);
+ WM_operatortype_append(FILE_OT_rename);
}
/* NOTE: do not add .blend file reading on this level */
@@ -360,7 +361,7 @@ void file_keymap(struct wmWindowManager *wm)
WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "FILE_OT_previous", BACKSPACEKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "FILE_OT_next", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0);
- /* WM_keymap_add_item(keymap, "FILE_OT_directory_new", IKEY, KM_PRESS, 0, 0); */ /* XXX needs button */
+ WM_keymap_add_item(keymap, "FILE_OT_directory_new", IKEY, KM_PRESS, 0, 0); /* XXX needs button */
WM_keymap_add_item(keymap, "FILE_OT_delete", XKEY, KM_PRESS, 0, 0);
/* keys for main area */
@@ -368,6 +369,7 @@ void file_keymap(struct wmWindowManager *wm)
WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "FILE_OT_rename", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "FILE_OT_highlight", MOUSEMOVE, KM_ANY, 0, 0);
WM_keymap_add_item(keymap, "FILE_OT_loadimages", TIMER1, KM_ANY, KM_ANY, 0);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0);