[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43670] trunk/blender/source/blender: Fix #29946: Recover Auto Save defaults to "Short List" View -- Cannot determine dates

Sergey Sharybin sergey.vfx at gmail.com
Tue Jan 24 19:19:02 CET 2012


Revision: 43670
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43670
Author:   nazgul
Date:     2012-01-24 18:18:51 +0000 (Tue, 24 Jan 2012)
Log Message:
-----------
Fix #29946: Recover Auto Save defaults to "Short List" View -- Cannot determine dates

Added option display_type to WM_operator_properties_filesel which defines which file
display type (short/list/icons/default) should be used for file browser.

All current operators are using FILE_DEFAULTDISPLAY display type which means display
type will still be calculated based on type of opening file and user preferences
settings. Recover Auto Save operator is now using long display type so file date can
easily be checked now.

Reviewed by Andrea, thanks!

Modified Paths:
--------------
    trunk/blender/source/blender/editors/curve/editfont.c
    trunk/blender/source/blender/editors/object/object_modifier.c
    trunk/blender/source/blender/editors/render/render_shading.c
    trunk/blender/source/blender/editors/screen/screendump.c
    trunk/blender/source/blender/editors/sound/sound_ops.c
    trunk/blender/source/blender/editors/space_buttons/buttons_ops.c
    trunk/blender/source/blender/editors/space_clip/clip_ops.c
    trunk/blender/source/blender/editors/space_file/filesel.c
    trunk/blender/source/blender/editors/space_graph/graph_edit.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/editors/space_info/info_ops.c
    trunk/blender/source/blender/editors/space_node/node_edit.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_add.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_edit.c
    trunk/blender/source/blender/editors/space_text/text_ops.c
    trunk/blender/source/blender/makesdna/DNA_space_types.h
    trunk/blender/source/blender/windowmanager/WM_api.h
    trunk/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: trunk/blender/source/blender/editors/curve/editfont.c
===================================================================
--- trunk/blender/source/blender/editors/curve/editfont.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/curve/editfont.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -422,7 +422,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
 	/* properties */
-	WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
 }
 
 /******************* text to object operator ********************/
@@ -1697,7 +1697,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 	
 	/* properties */
-	WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|FTFONTFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
 }
 
 /******************* delete operator *********************/

Modified: trunk/blender/source/blender/editors/object/object_modifier.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_modifier.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/object/object_modifier.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -1236,7 +1236,7 @@
 	/* flags */
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
-	WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|BTXFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
 	edit_modifier_properties(ot);
 }
 

Modified: trunk/blender/source/blender/editors/render/render_shading.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_shading.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/render/render_shading.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -749,7 +749,7 @@
 	prop= RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] (use -1 to skip a face)", 0.0f, 0.0f);
 	RNA_def_property_flag(prop, PROP_HIDDEN);
 
-	WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
 }
 
 static int envmap_clear_exec(bContext *C, wmOperator *UNUSED(op))

Modified: trunk/blender/source/blender/editors/screen/screendump.c
===================================================================
--- trunk/blender/source/blender/editors/screen/screendump.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/screen/screendump.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -228,7 +228,7 @@
 	
 	ot->flag= 0;
 	
-	WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
 	RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "");
 }
 

Modified: trunk/blender/source/blender/editors/sound/sound_ops.c
===================================================================
--- trunk/blender/source/blender/editors/sound/sound_ops.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/sound/sound_ops.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -186,7 +186,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
 	/* properties */
-	WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
 	RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory");
 	RNA_def_boolean(ot->srna, "mono", FALSE, "Mono", "Mixdown the sound to mono");
 }
@@ -207,7 +207,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
 	/* properties */
-	WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
 	RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory");
 	RNA_def_boolean(ot->srna, "mono", TRUE, "Mono", "Mixdown the sound to mono");
 }
@@ -587,7 +587,7 @@
 	ot->flag= OPTYPE_REGISTER;
 
 	/* properties */
-	WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
 #ifdef WITH_AUDASPACE
 	RNA_def_int(ot->srna, "accuracy", 1024, 1, 16777216, "Accuracy", "Sample accuracy, important for animation data (the lower the value, the more accurate)", 1, 16777216);
 	RNA_def_enum(ot->srna, "container", container_items, AUD_CONTAINER_FLAC, "Container", "File format");

Modified: trunk/blender/source/blender/editors/space_buttons/buttons_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_buttons/buttons_ops.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/space_buttons/buttons_ops.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -224,7 +224,7 @@
 	ot->cancel= file_browse_cancel;
 
 	/* properties */
-	WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH);
+	WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
 }
 
 /* second operator, only difference from BUTTONS_OT_file_browse is WM_FILESEL_DIRECTORY */
@@ -241,5 +241,5 @@
 	ot->cancel= file_browse_cancel;
 
 	/* properties */
-	WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH);
+	WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
 }

Modified: trunk/blender/source/blender/editors/space_clip/clip_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/clip_ops.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/space_clip/clip_ops.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -213,7 +213,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
 	/* properties */
-	WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
 }
 
 /******************* reload clip operator *********************/

Modified: trunk/blender/source/blender/editors/space_file/filesel.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/filesel.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/space_file/filesel.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -215,14 +215,19 @@
 			params->flag |= RNA_boolean_get(op->ptr, "autoselect") ? FILE_AUTOSELECT : 0;
 			params->flag |= RNA_boolean_get(op->ptr, "active_layer") ? FILE_ACTIVELAY : 0;
 		}
-		
-		if (U.uiflag & USER_SHOW_THUMBNAILS) {
-			if(params->filter & (IMAGEFILE|MOVIEFILE))
-				params->display= FILE_IMGDISPLAY;
-			else
+
+		if(RNA_struct_find_property(op->ptr, "display_type"))
+			params->display= RNA_enum_get(op->ptr, "display_type");
+
+		if(params->display==FILE_DEFAULTDISPLAY) {
+			if (U.uiflag & USER_SHOW_THUMBNAILS) {
+				if(params->filter & (IMAGEFILE|MOVIEFILE))
+					params->display= FILE_IMGDISPLAY;
+				else
+					params->display= FILE_SHORTDISPLAY;
+			} else {
 				params->display= FILE_SHORTDISPLAY;
-		} else {
-			params->display= FILE_SHORTDISPLAY;
+			}
 		}
 
 		if (is_relative_path) {

Modified: trunk/blender/source/blender/editors/space_graph/graph_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_edit.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/space_graph/graph_edit.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -1188,7 +1188,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
 	/* properties */
-	WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
 	RNA_def_float(ot->srna, "low", 0.0f, 0.0, 100000.0, "Lowest frequency", "", 0.1, 1000.00);
 	RNA_def_float(ot->srna, "high", 100000.0, 0.0, 100000.0, "Highest frequency", "", 0.1, 1000.00);
 	RNA_def_float(ot->srna, "attack", 0.005, 0.0, 2.0, "Attack time", "", 0.01, 0.1);

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c	2012-01-24 17:28:50 UTC (rev 43669)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c	2012-01-24 18:18:51 UTC (rev 43670)
@@ -868,7 +868,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
 	/* properties */
-	WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH);
+	WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
 }
 
 /******************** replace image operator ********************/
@@ -928,7 +928,7 @@

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list