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>2010-11-11 21:53:10 +0300
committerAndrea Weikert <elubie@gmx.net>2010-11-11 21:53:10 +0300
commitc0da754d8da63a6a8edc3bced64097e6aa22bec6 (patch)
treeca6cd892ce64138c44ba6b532d51cc9c8df48401 /source/blender/windowmanager
parentdf487be82feb1261d19b8d6699556feb763719f1 (diff)
== filebrowser ==
When loading .blend file (F1) open the filebrowser with the most recently used .blend file. Another lost feature from 2.49 back ;)
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 20228d88f7a..93b6a97de4d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1460,7 +1460,15 @@ static void open_set_use_scripts(wmOperator *op)
static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- RNA_string_set(op->ptr, "filepath", G.main->name);
+ const char *openname= G.main->name;
+
+ /* if possible, get the name of the most recently used .blend file */
+ if (G.recent_files.first) {
+ struct RecentFile *recent = G.recent_files.first;
+ openname = recent->filepath;
+ }
+
+ RNA_string_set(op->ptr, "filepath", openname);
open_set_load_ui(op);
open_set_use_scripts(op);