diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2009-07-07 11:25:44 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2009-07-07 11:25:44 +0400 |
commit | cfd5046c9e4a6617a20cfc7e59519a84d3c18b9d (patch) | |
tree | 2c2c1180a69c5996ad7ebbca151234469cdf475a /source/blender/windowmanager | |
parent | 79633056ac3848237d8bb8245523501905582f2e (diff) |
2.5 filebrowser: previous/next + bugfix + elubie's changes and cleanup
* Previous/Next Folder browser
* bugfix: "open most recently opened directory".
* Previous and Next functionalities:
- use BACKSPACE to navigate to previous folders
- use SHIFT+BACKSPACE to navigate forward
- once you change the folder by other ways the forward folder list is cleared
* bug fix: the sfile->params->dir set through ED_fileselect_set_params wasn't correct. According to the code taking the settings from the existing (previous) filebrowser is a temp solution. In that case this is a fix for a temp solution :)
(changes in: wm_event_system.c, filesel.c and ED_fileselect.h)
** Andrea(elubie): we can get away of the folderlist_clear_next test if we manually pass a boolean to file_change_dir (e.g. file_change_dir(sfile, true)). I tried not to mess up with your changes here. It's slightly slower (and maybe hacky) but its's more conservative IMHO.
(my first commit to 2.5 ... that was a good reason to put my paper on hold :p)
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index e520067b9e5..b5d51ef650b 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -780,7 +780,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa case EVT_FILESELECT_FULL_OPEN: { short flag =0; short display =FILE_SHORTDISPLAY; short filter =0; short sort =FILE_SORT_ALPHA; - char *path= RNA_string_get_alloc(handler->op->ptr, "filename", NULL, 0); + char *dir= NULL; char *path= RNA_string_get_alloc(handler->op->ptr, "filename", NULL, 0); if(event->val==EVT_FILESELECT_OPEN) ED_area_newspace(C, handler->op_area, SPACE_FILE); @@ -798,9 +798,11 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa filter = sfile->params->filter; display = sfile->params->display; sort = sfile->params->sort; + dir = sfile->params->dir; } - ED_fileselect_set_params(sfile, handler->op->type->name, path, flag, display, filter, sort); + ED_fileselect_set_params(sfile, handler->op->type->name, dir, path, flag, display, filter, sort); + dir = NULL; MEM_freeN(path); action= WM_HANDLER_BREAK; @@ -1501,4 +1503,3 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata) break; } } - |