Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Xiangquan <xiaoxiangquan@gmail.com>2011-06-20 14:07:46 +0400
committerXiao Xiangquan <xiaoxiangquan@gmail.com>2011-06-20 14:07:46 +0400
commit9a2f36b50f818c0c1b659363a1df298f7043e207 (patch)
tree29356fc32cdf7faba05e099e67e3da5adf349c39 /source/blender/makesrna/intern/rna_access.c
parent558d549aeb2ec7da41d31986707774eae0821da8 (diff)
handle SpaceType and UserPref popups
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index ab11f88e0f6..10a837f0d05 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -43,6 +43,8 @@
#include "BLI_dynstr.h"
#include "BLI_ghash.h"
+#include "BLF_api.h"
+
#include "BKE_animsys.h"
#include "BKE_context.h"
#include "BKE_idprop.h"
@@ -96,6 +98,48 @@ void RNA_exit(void)
RNA_free(&BLENDER_RNA);
}
+void RNA_struct_gettexted( StructRNA* ptr )
+{
+ StructRNA* temp_struct;
+ PropertyRNA* temp_property;
+ PropertyRNA* end_property;
+
+ ptr->name = _(ptr->name);
+ ptr->description = _(ptr->description);
+
+ temp_property = (PropertyRNA*)ptr->cont.properties.first;
+ end_property = (PropertyRNA*)ptr->cont.properties.last;
+ while( temp_property!=end_property )
+ {
+ temp_property->name = _(temp_property->name);
+ temp_property->description = _(temp_property->description);
+ if( temp_property->type == PROP_ENUM )
+ RNA_enum_items_gettexted( ((EnumPropertyRNA*)temp_property)->item );
+ temp_property = temp_property->next;
+ }
+ if( end_property!=NULL )
+ {
+ end_property->name = _(end_property->name);
+ end_property->description = _(end_property->description);
+ if( end_property->type == PROP_ENUM )
+ RNA_enum_items_gettexted( ((EnumPropertyRNA*)end_property)->item );
+ }
+
+ temp_struct = (StructRNA*)ptr->cont.next;
+ if( temp_struct!=NULL && temp_struct != &RNA_UnknownType )
+ RNA_struct_gettexted( temp_struct );
+}
+
+void RNA_types_init_gettext()
+{
+ StructRNA* target_struct[] = { &RNA_UserPreferences, &RNA_Theme, NULL };
+ int i=0;
+ for( i=0; target_struct[i]!=NULL; i++ )
+ {
+ RNA_struct_gettexted( target_struct[i] );
+ }
+}
+
/* Pointer */
void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr)