2.5: User Preferences

* Added basic infrastructure to layout user preferences. The
  intention is that you open a user preferences space in place
  of the buttons space, and have panels there.
* The existing sections don't have to be followed, it's easy
  to create different ones, just change the user_pref_sections
  enum in RNA.
* This will get separated from the info header later.
This commit is contained in:
Brecht Van Lommel
2009-07-15 19:19:43 +00:00
parent 097d05a1af
commit 4df1836325
8 changed files with 53 additions and 62 deletions

View File

@@ -108,6 +108,31 @@ class INFO_MT_help(bpy.types.Menu):
layout = self.layout
layout.itemL(text="Nothing yet")
class INFO_PT_tabs(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__no_header__ = True
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
layout.itemR(userpref, "active_section")
class INFO_PT_view(bpy.types.Panel):
__space_type__ = "USER_PREFERENCES"
__label__ = "View"
def poll(self, context):
userpref = context.user_preferences
return (userpref.active_section == 'VIEW_CONTROLS')
def draw(self, context):
layout = self.layout
userpref = context.user_preferences
view = userpref.view
layout.itemR(view, "show_view_name")
bpy.types.register(INFO_HT_header)
bpy.types.register(INFO_MT_file)
bpy.types.register(INFO_MT_file_external_data)
@@ -116,4 +141,6 @@ bpy.types.register(INFO_MT_timeline)
bpy.types.register(INFO_MT_game)
bpy.types.register(INFO_MT_render)
bpy.types.register(INFO_MT_help)
bpy.types.register(INFO_PT_tabs)
bpy.types.register(INFO_PT_view)