diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 6194941bd38a0f7ce0c6dec93b4abd1b566e812f..b1dadbab6ca52dd3803903a2806b661d9099b3a3 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -57,14 +57,13 @@ class USERPREF_HT_header(Header): userpref = context.user_preferences layout.operator_context = 'EXEC_AREA' - if userpref.active_section in {'WORKSPACE_CONFIG', 'WORKSPACE_ADDONS', 'WORKSPACE_KEYMAPS'}: - layout.operator("wm.save_workspace_file") - else: - layout.operator("wm.save_userpref") + layout.operator("wm.save_userpref") layout.operator_context = 'INVOKE_DEFAULT' - if userpref.active_section == 'INPUT': + if userpref.active_section == 'INTERFACE': + layout.operator("wm.save_workspace_file") + elif userpref.active_section == 'INPUT': layout.operator("wm.keyconfig_import") layout.operator("wm.keyconfig_export") elif userpref.active_section == 'ADDONS': @@ -333,16 +332,16 @@ class USERPREF_PT_interface(Panel): -class USERPREF_PT_general(Panel): +class USERPREF_PT_edit(Panel): bl_space_type = 'USER_PREFERENCES' - bl_label = "General" + bl_label = "Edit" bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} @classmethod def poll(cls, context): userpref = context.user_preferences - return (userpref.active_section == 'GENERAL') + return (userpref.active_section == 'EDITING') def draw(self, context): layout = self.layout @@ -458,6 +457,168 @@ class USERPREF_PT_general(Panel): col.prop(edit, "use_duplicate_particle", text="Particle") +class USERPREF_PT_system_general(Panel): + bl_space_type = 'USER_PREFERENCES' + bl_label = "System General" + bl_region_type = 'WINDOW' + bl_options = {'HIDE_HEADER'} + + @classmethod + def poll(cls, context): + userpref = context.user_preferences + return (userpref.active_section == 'SYSTEM_GENERAL') + + def draw(self, context): + import sys + layout = self.layout + + userpref = context.user_preferences + system = userpref.system + + split = layout.split() + + # 1. Column + column = split.column() + colsplit = column.split(percentage=0.85) + + col = colsplit.column() + col.label(text="General:") + + col.prop(system, "frame_server_port") + col.prop(system, "scrollback", text="Console Scrollback") + + col.separator() + + col.label(text="Sound:") + col.row().prop(system, "audio_device", expand=False) + sub = col.column() + sub.active = system.audio_device not in {'NONE', 'Null'} + #sub.prop(system, "use_preview_images") + sub.prop(system, "audio_channels", text="Channels") + sub.prop(system, "audio_mixing_buffer", text="Mixing Buffer") + sub.prop(system, "audio_sample_rate", text="Sample Rate") + sub.prop(system, "audio_sample_format", text="Sample Format") + + col.separator() + + col.label(text="Screencast:") + col.prop(system, "screencast_fps") + col.prop(system, "screencast_wait_time") + + col.separator() + + if bpy.app.build_options.cycles: + addon = userpref.addons.get("cycles") + if addon is not None: + addon.preferences.draw_impl(col, context) + del addon + + if hasattr(system, "opensubdiv_compute_type"): + col.label(text="OpenSubdiv compute:") + col.row().prop(system, "opensubdiv_compute_type", text="") + + # 2. Column + column = split.column() + colsplit = column.split(percentage=0.85) + + col = colsplit.column() + col.label(text="OpenGL:") + col.prop(system, "gl_clip_alpha", slider=True) + col.prop(system, "use_mipmaps") + col.prop(system, "use_gpu_mipmap") + col.prop(system, "use_16bit_textures") + + col.separator() + col.label(text="Selection") + col.prop(system, "select_method", text="") + col.prop(system, "use_select_pick_depth") + + col.separator() + + col.label(text="Anisotropic Filtering") + col.prop(system, "anisotropic_filter", text="") + + col.separator() + + col.label(text="Window Draw Method:") + col.prop(system, "window_draw_method", text="") + col.prop(system, "multi_sample", text="") + if sys.platform == "linux" and system.multi_sample != 'NONE': + col.label(text="Might fail for Mesh editing selection!") + col.separator() + col.prop(system, "use_region_overlap") + + col.separator() + + col.label(text="Text Draw Options:") + col.prop(system, "use_text_antialiasing") + + col.separator() + + col.label(text="Textures:") + col.prop(system, "gl_texture_limit", text="Limit Size") + col.prop(system, "texture_time_out", text="Time Out") + col.prop(system, "texture_collection_rate", text="Collection Rate") + + col.separator() + + col.label(text="Images Draw Method:") + col.prop(system, "image_draw_method", text="") + + col.separator() + + col.label(text="Sequencer/Clip Editor:") + # currently disabled in the code + # col.prop(system, "prefetch_frames") + col.prop(system, "memory_cache_limit") + + # 3. Column + column = split.column() + + column.label(text="Solid OpenGL Lights:") + + split = column.split(percentage=0.1) + split.label() + split.label(text="Colors:") + split.label(text="Direction:") + + lamp = system.solid_lights[0] + opengl_lamp_buttons(column, lamp) + + lamp = system.solid_lights[1] + opengl_lamp_buttons(column, lamp) + + lamp = system.solid_lights[2] + opengl_lamp_buttons(column, lamp) + + column.separator() + + column.label(text="Color Picker Type:") + column.row().prop(system, "color_picker_type", text="") + + column.separator() + + column.prop(system, "use_weight_color_range", text="Custom Weight Paint Range") + sub = column.column() + sub.active = system.use_weight_color_range + sub.template_color_ramp(system, "weight_color_range", expand=True) + + column.separator() + column.prop(system, "font_path_ui") + column.prop(system, "font_path_ui_mono") + + if bpy.app.build_options.international: + column.prop(system, "use_international_fonts") + if system.use_international_fonts: + column.prop(system, "language") + row = column.row() + row.label(text="Translate:", text_ctxt=i18n_contexts.id_windowmanager) + row = column.row(align=True) + row.prop(system, "use_translate_interface", text="Interface", toggle=True) + row.prop(system, "use_translate_tooltips", text="Tooltips", toggle=True) + row.prop(system, "use_translate_new_dataname", text="New Data", toggle=True) + + class USERPREF_MT_interface_theme_presets(Menu): bl_label = "Presets" preset_subdir = "interface_theme" @@ -1424,247 +1585,6 @@ class USERPREF_PT_addons(Panel): row.label(text=module_name, translate=False) -class USERPREF_PT_workspace_config(Panel): - bl_space_type = 'USER_PREFERENCES' - bl_label = "Workspace Configuration File" - bl_region_type = 'WINDOW' - bl_options = {'HIDE_HEADER'} - - @classmethod - def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'WORKSPACE_CONFIG') - - def draw(self, context): - layout = self.layout - - layout.label("Nothing to see here yet!") - - -class USERPREF_PT_workspace_addons(Panel): - bl_space_type = 'USER_PREFERENCES' - bl_label = "Workspace Add-on Overrides" - bl_region_type = 'WINDOW' - bl_options = {'HIDE_HEADER'} - - @classmethod - def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'WORKSPACE_ADDONS') - - def draw(self, context): - layout = self.layout - - layout.label("Nothing to see here yet!") - - -class USERPREF_PT_workspace_keymaps(Panel): - bl_space_type = 'USER_PREFERENCES' - bl_label = "Workspace Key-map Overrides" - bl_region_type = 'WINDOW' - bl_options = {'HIDE_HEADER'} - - @classmethod - def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'WORKSPACE_KEYMAPS') - - def draw(self, context): - layout = self.layout - - layout.label("Nothing to see here yet!") - - -class USERPREF_PT_system_general(Panel): - bl_space_type = 'USER_PREFERENCES' - bl_label = "System General" - bl_region_type = 'WINDOW' - bl_options = {'HIDE_HEADER'} - - @classmethod - def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'SYSTEM_GENERAL') - - def draw(self, context): - layout = self.layout - - userpref = context.user_preferences - system = userpref.system - - col = layout.column() - - col.label(text="General:") - - row = col.row(align=True) - row.prop(system, "frame_server_port") - row.prop(system, "scrollback", text="Console Scrollback") - - col.separator() - - col.label(text="Sound:") - col.row().prop(system, "audio_device", expand=False) - sub = col.column() - sub.active = system.audio_device not in {'NONE', 'Null'} - #sub.prop(system, "use_preview_images") - sub.prop(system, "audio_channels", text="Channels") - sub.prop(system, "audio_mixing_buffer", text="Mixing Buffer") - sub.prop(system, "audio_sample_rate", text="Sample Rate") - sub.prop(system, "audio_sample_format", text="Sample Format") - - col.separator() - - col.label(text="Screencast:") - row = col.row(align=True) - row.prop(system, "screencast_fps") - row.prop(system, "screencast_wait_time") - - row = col.row(align=True) - row.label(text="Sequencer/Clip Editor:") - # currently disabled in the code - # row.prop(system, "prefetch_frames") - row.prop(system, "memory_cache_limit") - - col.separator() - - col.prop(system, "color_picker_type") - - col.separator() - - col.prop(system, "use_weight_color_range", text="Custom Weight Paint Range") - sub = col.column() - sub.active = system.use_weight_color_range - sub.template_color_ramp(system, "weight_color_range", expand=True) - - col.separator() - col.prop(system, "font_path_ui") - col.prop(system, "font_path_ui_mono") - - if bpy.app.build_options.international: - col.prop(system, "use_international_fonts") - if system.use_international_fonts: - col.prop(system, "language") - row = col.row() - row.label(text="Translate:", text_ctxt=i18n_contexts.id_windowmanager) - row = col.row(align=True) - row.prop(system, "use_translate_interface", text="Interface", toggle=True) - row.prop(system, "use_translate_tooltips", text="Tooltips", toggle=True) - row.prop(system, "use_translate_new_dataname", text="New Data", toggle=True) - - -class USERPREF_PT_system_drawing(Panel): - bl_space_type = 'USER_PREFERENCES' - bl_label = "System Drawing" - bl_region_type = 'WINDOW' - bl_options = {'HIDE_HEADER'} - - @classmethod - def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'SYSTEM_DRAWING') - - def draw(self, context): - import sys - - layout = self.layout - - userpref = context.user_preferences - system = userpref.system - - col = layout.column() - - col.separator() - col.prop(system, "select_method") - col.prop(system, "use_select_pick_depth") - - col.separator() - - col.prop(system, "anisotropic_filter") - col.prop(system, "window_draw_method") - col.prop(system, "multi_sample") - if sys.platform == "linux" and system.multi_sample != 'NONE': - col.label(text="Might fail for Mesh editing selection!") - col.separator() - col.prop(system, "use_region_overlap") - col.prop(system, "use_text_antialiasing") - - col.separator() - - col.label(text="Textures:") - col.prop(system, "gl_texture_limit", text="Limit Size") - row = col.row(align=True) - row.prop(system, "texture_time_out", text="Time Out") - row.prop(system, "texture_collection_rate", text="Collection Rate") - - col.separator() - - col.prop(system, "image_draw_method") - - col.separator() - - col.label(text="OpenGL:") - row = col.row() - row.prop(system, "gl_clip_alpha", slider=True) - row.label() - col.prop(system, "use_mipmaps") - col.prop(system, "use_gpu_mipmap") - col.prop(system, "use_16bit_textures") - - col.separator() - - col.label(text="Solid OpenGL Lights:") - - split = col.split(percentage=0.6) - col = split.column() - - split = col.split(percentage=0.45) - split.label() - subsplit = split.split(percentage=0.75) - subsplit.label(text="Colors:") - subsplit.label(text="Direction:") - - lamp = system.solid_lights[0] - opengl_lamp_buttons(col, lamp) - - lamp = system.solid_lights[1] - opengl_lamp_buttons(col, lamp) - - lamp = system.solid_lights[2] - opengl_lamp_buttons(col, lamp) - - -class USERPREF_PT_system_devices(Panel): - bl_space_type = 'USER_PREFERENCES' - bl_label = "System Devices" - bl_region_type = 'WINDOW' - bl_options = {'HIDE_HEADER'} - - @classmethod - def poll(cls, context): - userpref = context.user_preferences - return (userpref.active_section == 'SYSTEM_DEVICES') - - def draw(self, context): - layout = self.layout - - userpref = context.user_preferences - system = userpref.system - - split = layout.split(percentage=0.5) - col = split.column() - - if bpy.app.build_options.cycles: - addon = userpref.addons.get("cycles") - if addon is not None: - addon.preferences.draw_impl(col, context) - del addon - - if hasattr(system, "opensubdiv_compute_type"): - col.label(text="OpenSubdiv compute:") - col.row().prop(system, "opensubdiv_compute_type", text="") - - - classes = ( USERPREF_HT_header, USERPREF_PT_navigation, @@ -1675,7 +1595,8 @@ classes = ( USERPREF_MT_splash, USERPREF_MT_splash_footer, USERPREF_PT_interface, - USERPREF_PT_general, + USERPREF_PT_edit, + USERPREF_PT_system_general, USERPREF_MT_interface_theme_presets, USERPREF_PT_theme, USERPREF_PT_file, @@ -1684,12 +1605,6 @@ classes = ( USERPREF_PT_input, USERPREF_MT_addons_online_resources, USERPREF_PT_addons, - USERPREF_PT_workspace_config, - USERPREF_PT_workspace_addons, - USERPREF_PT_workspace_keymaps, - USERPREF_PT_system_general, - USERPREF_PT_system_drawing, - USERPREF_PT_system_devices, ) if __name__ == "__main__": # only for live edit. diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 19271cb0fd076a195dd45025d51962c77ab24a71..d1eda36f3e35607a585f2137f07fa9ffc5943251 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -601,20 +601,28 @@ extern UserDef U; /* from blenkernel blender.c */ /* ***************** USERDEF ****************** */ +/* Toggles for unfinished 2.8 UserPref design. */ +//#define WITH_USERDEF_WORKSPACES +//#define WITH_USERDEF_SYSTEM_SPLIT + /* UserDef.userpref (UI active_section) */ typedef enum eUserPref_Section { USER_SECTION_INTERFACE = 0, - USER_SECTION_GENERAL = 1, + USER_SECTION_EDIT = 1, USER_SECTION_FILE = 2, USER_SECTION_SYSTEM_GENERAL = 3, USER_SECTION_THEME = 4, USER_SECTION_INPUT = 5, USER_SECTION_ADDONS = 6, +#ifdef WITH_USERDEF_WORKSPACES USER_SECTION_WORKSPACE_CONFIG = 7, USER_SECTION_WORKSPACE_ADDONS = 8, USER_SECTION_WORKSPACE_KEYMAPS = 9, +#endif +#ifdef WITH_USERDEF_SYSTEM_SPLIT USER_SECTION_SYSTEM_DRAWING = 10, USER_SECTION_SYSTEM_DEVICES = 11, +#endif } eUserPref_Section; /* UserDef.flag */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 4c3047aee2cb0b8e58910129d5b8e4a2321fff45..d4896d47b429efbdfa741d28f7aa103b92c979fe 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -4698,20 +4698,24 @@ void RNA_def_userdef(BlenderRNA *brna) static const EnumPropertyItem user_pref_sections[] = { {0, "", 0, "User Preferences", ""}, - {USER_SECTION_GENERAL, "GENERAL", 0, "General", ""}, + {USER_SECTION_EDIT, "EDITING", 0, "Editing", ""}, {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""}, {USER_SECTION_INPUT, "INPUT", 0, "Input", ""}, {USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", ""}, {USER_SECTION_THEME, "THEMES", 0, "Themes", ""}, {USER_SECTION_FILE, "FILES", 0, "File", ""}, +#ifdef WITH_USERDEF_WORKSPACES {0, "", 0, "Workspaces", ""}, {USER_SECTION_WORKSPACE_CONFIG, "WORKSPACE_CONFIG", 0, "Configuration File", ""}, {USER_SECTION_WORKSPACE_ADDONS, "WORKSPACE_ADDONS", 0, "Add-on Overrides", ""}, {USER_SECTION_WORKSPACE_KEYMAPS, "WORKSPACE_KEYMAPS", 0, "Keymap Overrides", ""}, +#endif {0, "", 0, "System", ""}, {USER_SECTION_SYSTEM_GENERAL, "SYSTEM_GENERAL", 0, "General", ""}, +#ifdef WITH_USERDEF_SYSTEM_SPLIT {USER_SECTION_SYSTEM_DRAWING, "SYSTEM_DRAWING", 0, "Drawing", ""}, {USER_SECTION_SYSTEM_DEVICES, "SYSTEM_DEVICES", 0, "Devices", ""}, +#endif {0, NULL, 0, NULL, NULL} };