[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37155] branches/soc-2011-pepper: User Pref to not overwrite Recent Files list everytime you open a new

Joshua Leung aligorith at gmail.com
Sat Jun 4 03:54:35 CEST 2011


Revision: 37155
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37155
Author:   aligorith
Date:     2011-06-04 01:54:34 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
User Pref to not overwrite Recent Files list everytime you open a new
file

This is just a more formalised version of a local hack I've been
running locally for the past year now. It's especially useful when you
want to maintain your own set of recently opened test files (or
perhaps current project files), but then be able to quickly open some
.blend files downloaded from the web (i.e. checking out some bug
report, or how someone else sets up some node setup) without
loosing/polluting your existing recent files list as a result of doing
so, and having to either resort to some nasty methods to get it back.

Of course, this is still really hacky, as for instance, it means that
the currently opened file will not show up in the recent files list
for quick reload. However, that's why this is a userpref :)

Modified Paths:
--------------
    branches/soc-2011-pepper/release/scripts/startup/bl_ui/space_userpref.py
    branches/soc-2011-pepper/source/blender/makesdna/DNA_userdef_types.h
    branches/soc-2011-pepper/source/blender/makesrna/intern/rna_userdef.c
    branches/soc-2011-pepper/source/blender/windowmanager/intern/wm_files.c

Modified: branches/soc-2011-pepper/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- branches/soc-2011-pepper/release/scripts/startup/bl_ui/space_userpref.py	2011-06-04 01:38:04 UTC (rev 37154)
+++ branches/soc-2011-pepper/release/scripts/startup/bl_ui/space_userpref.py	2011-06-04 01:54:34 UTC (rev 37155)
@@ -743,6 +743,7 @@
 
         col.prop(paths, "save_version")
         col.prop(paths, "recent_files")
+        col.prop(paths, "use_update_recent_files_on_load")
         col.prop(paths, "use_save_preview_images")
         col.label(text="Auto Save:")
         col.prop(paths, "use_auto_save_temporary_files")

Modified: branches/soc-2011-pepper/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- branches/soc-2011-pepper/source/blender/makesdna/DNA_userdef_types.h	2011-06-04 01:38:04 UTC (rev 37154)
+++ branches/soc-2011-pepper/source/blender/makesdna/DNA_userdef_types.h	2011-06-04 01:54:34 UTC (rev 37155)
@@ -435,6 +435,7 @@
 #define USER_NONEGFRAMES		(1 << 24)
 #define USER_TXT_TABSTOSPACES_DISABLE	(1 << 25)
 #define USER_TOOLTIPS_PYTHON    (1 << 26)
+#define USER_NO_RECENTLOAD_UPDATE (1 << 27)
 
 /* helper macro for checking frame clamping */
 #define FRAMENUMBER_MIN_CLAMP(cfra) \

Modified: branches/soc-2011-pepper/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- branches/soc-2011-pepper/source/blender/makesrna/intern/rna_userdef.c	2011-06-04 01:38:04 UTC (rev 37154)
+++ branches/soc-2011-pepper/source/blender/makesrna/intern/rna_userdef.c	2011-06-04 01:54:34 UTC (rev 37155)
@@ -2864,7 +2864,11 @@
 	prop= RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
 	RNA_def_property_range(prop, 0, 30);
 	RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");
-
+	
+	prop= RNA_def_property(srna, "use_update_recent_files_on_load", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NO_RECENTLOAD_UPDATE);
+	RNA_def_property_ui_text(prop, "Update Recent on Load", "When enabled, opening files will update the recent files list. Otherwise, updates only occur when saving");
+	
 	prop= RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS);
 	RNA_def_property_ui_text(prop, "Save Preview Images", "Enables automatic saving of preview images in the .blend file");

Modified: branches/soc-2011-pepper/source/blender/windowmanager/intern/wm_files.c
===================================================================
--- branches/soc-2011-pepper/source/blender/windowmanager/intern/wm_files.c	2011-06-04 01:38:04 UTC (rev 37154)
+++ branches/soc-2011-pepper/source/blender/windowmanager/intern/wm_files.c	2011-06-04 01:54:34 UTC (rev 37155)
@@ -376,7 +376,12 @@
 		
 		if (retval != BKE_READ_FILE_FAIL) {
 			G.relbase_valid = 1;
-			if(!G.background) /* assume automated tasks with background, dont write recent file list */
+			
+			/* dont write recent file list if:
+			 * 1) assuming automated tasks with background
+			 * 2) user preference to not do this is enabled (i.e. developer testing mode)
+			 */
+			if (!G.background && !(U.flag & USER_NO_RECENTLOAD_UPDATE))
 				write_history();
 		}
 




More information about the Bf-blender-cvs mailing list