[Bf-blender-cvs] [3e159e7a9b5] userpref_redesign: Move text editor load/save options to filepath RNA

William Reynish noreply at git.blender.org
Fri Jan 4 21:43:58 CET 2019


Commit: 3e159e7a9b528a59ec91e0cc981488ed7a7bff88
Author: William Reynish
Date:   Fri Jan 4 21:11:41 2019 +0100
Branches: userpref_redesign
https://developer.blender.org/rB3e159e7a9b528a59ec91e0cc981488ed7a7bff88

Move text editor load/save options to filepath RNA

===================================================================

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index af64871d892..312c2dcb9a2 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1166,16 +1166,14 @@ class USERPREF_PT_file_autorun(PreferencePanel):
     def draw_header(self, context):
         prefs = context.preferences
         paths = prefs.filepaths
-        system = prefs.system
 
-        self.layout.prop(system, "use_scripts_auto_execute", text="")
+        self.layout.prop(paths, "use_scripts_auto_execute", text="")
 
     def draw_props(self, context, layout):
         prefs = context.preferences
         paths = prefs.filepaths
-        system = prefs.system
 
-        layout.active = system.use_scripts_auto_execute
+        layout.active = paths.use_scripts_auto_execute
 
         box = layout.box()
         row = box.row()
@@ -1245,10 +1243,9 @@ class USERPREF_PT_file_saveload_texteditor(PreferencePanel):
     def draw_props(self, context, layout):
         prefs = context.preferences
         paths = prefs.filepaths
-        system = prefs.system
 
-        layout.prop(system, "use_tabs_as_spaces")
-        layout.prop(system, "author", text="Author")
+        layout.prop(paths, "use_tabs_as_spaces")
+        layout.prop(paths, "author", text="Author")
 
 
 class USERPREF_MT_ndof_settings(Menu):
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 1fd560fa0af..7c7a484dd49 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -4402,27 +4402,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 	RNA_def_property_range(prop, 32, 32768);
 	RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
 
-
-	/* System */
-
-	prop = RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
-	RNA_def_property_string_sdna(prop, NULL, "author");
-	RNA_def_property_string_maxlength(prop, 80);
-	RNA_def_property_ui_text(prop, "Author",
-	                         "Name that will be used in exported files when format supports such feature");
-
-	prop = RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
-	RNA_def_property_ui_text(prop, "Auto Run Python Scripts",
-	                         "Allow any .blend file to run scripts automatically "
-	                         "(unsafe with blend files from an untrusted source)");
-	RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
-
-	prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
-	RNA_def_property_ui_text(prop, "Tabs as Spaces",
-	                         "Automatically convert all new tabs into spaces for new and loaded text files");
-
 	/* OpenGL */
 
 	/* Full scene anti-aliasing */
@@ -4930,6 +4909,27 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
 	RNA_def_property_update(prop, 0, "rna_userdef_load_ui_update");
 
+
+	prop = RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
+	RNA_def_property_ui_text(prop, "Auto Run Python Scripts",
+	                         "Allow any .blend file to run scripts automatically "
+	                         "(unsafe with blend files from an untrusted source)");
+	RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
+
+	prop = RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
+	RNA_def_property_string_sdna(prop, NULL, "author");
+	RNA_def_property_string_maxlength(prop, 80);
+	RNA_def_property_ui_text(prop, "Author",
+	                         "Name that will be used in exported files when format supports such feature");
+
+	prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
+	RNA_def_property_ui_text(prop, "Tabs as Spaces",
+	                         "Automatically convert all new tabs into spaces for new and loaded text files");
+
+	/* Directories  */
+
 	prop = RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
 	RNA_def_property_string_sdna(prop, NULL, "fontdir");
 	RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts");



More information about the Bf-blender-cvs mailing list