[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31671] trunk/blender/release/scripts/ui/ space_userpref.py: == userprefs: addons ==

Luca Bonavita mindrones at gmail.com
Tue Aug 31 04:41:39 CEST 2010


Revision: 31671
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31671
Author:   mindrones
Date:     2010-08-31 04:41:33 +0200 (Tue, 31 Aug 2010)

Log Message:
-----------
== userprefs: addons ==

- From now on addons bl_addon_info['name'] doesn't need to specifcy also the category, it is put automatically in the addon box title
  In some script category and the category in the title were not matching, this had to be fixed manually.

- The warning icon is at the right of the addon box title, so that it cant disalign the addon name anymore when we have a warning.

- After discussing with Campbell, I've added the field bl_addon_info['api'] where we should specify the Blender API version number the addon is 
compatible with.
  This is certainly useful for clarity, and also I need it in place while preparing the downloadable addons.
  
- Also, bl_addon_info['version'] is now assumed to be a tuple of integers as it is bl_addon_info['blender'].
  Any important text should be placed in the bl_addon_info['warning'] field, not in the script version anymore.
  I'm going to reflect this change in bf-extensions so that scripts won't suddenly break.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_userpref.py

Modified: trunk/blender/release/scripts/ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/ui/space_userpref.py	2010-08-30 20:35:24 UTC (rev 31670)
+++ trunk/blender/release/scripts/ui/space_userpref.py	2010-08-31 02:41:33 UTC (rev 31671)
@@ -973,7 +973,8 @@
 
                 rowsub = row.row()
                 rowsub.active = is_enabled
-                rowsub.label(text=info["name"], icon='ERROR' if info["warning"] else 'BLENDER')
+                rowsub.label(text='%s: %s' % (info['category'], info["name"]))
+                if info["warning"]: rowsub.label(icon='ERROR')
 
                 if is_enabled:
                     row.operator("wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False).module = module_name
@@ -997,7 +998,7 @@
                     if info["version"]:
                         split = colsub.row().split(percentage=0.15)
                         split.label(text='Version:')
-                        split.label(text=info["version"])
+                        split.label(text='.'.join([str(x) for x in info["version"]]))
                     if info["warning"]:
                         split = colsub.row().split(percentage=0.15)
                         split.label(text="Warning:")
@@ -1038,7 +1039,7 @@
 from bpy.props import *
 
 
-def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "description": "", "wiki_url": "", "tracker_url": "", "category": "", "warning": "", "show_expanded": False}):
+def addon_info_get(mod, info_basis={"name": "", "author": "", "version": (), "blender": (), "api": 0, "location": "", "description": "", "wiki_url": "", "tracker_url": "", "category": "", "warning": "", "show_expanded": False}):
     addon_info = getattr(mod, "bl_addon_info", {})
 
     # avoid re-initializing
@@ -1218,4 +1219,4 @@
     pass
 
 if __name__ == "__main__":
-    register()
\ No newline at end of file
+    register()





More information about the Bf-blender-cvs mailing list