UITranslation: remove usage of register_module.
This commit is contained in:
parent
1acd28885f
commit
7f6ae93c54
|
@ -21,7 +21,7 @@
|
|||
bl_info = {
|
||||
"name": "Manage UI translations",
|
||||
"author": "Bastien Montagne",
|
||||
"version": (1, 1, 2),
|
||||
"version": (1, 1, 3),
|
||||
"blender": (2, 75, 0),
|
||||
"location": "Main \"File\" menu, text editor, any UI control",
|
||||
"description": "Allow to manage UI translations directly from Blender "
|
||||
|
@ -53,8 +53,12 @@ else:
|
|||
import os
|
||||
|
||||
|
||||
classes = settings.classes + edit_translation.classes + update_svn.classes + update_addon.classes + update_ui.classes
|
||||
|
||||
|
||||
def register():
|
||||
bpy.utils.register_module(__name__)
|
||||
for cls in classes:
|
||||
bpy.utils.register_class(cls)
|
||||
bpy.types.WindowManager.i18n_update_svn_settings = \
|
||||
bpy.props.PointerProperty(type=update_ui.I18nUpdateTranslationSettings)
|
||||
|
||||
|
@ -68,5 +72,5 @@ def register():
|
|||
|
||||
def unregister():
|
||||
del bpy.types.WindowManager.i18n_update_svn_settings
|
||||
|
||||
bpy.utils.unregister_module(__name__)
|
||||
for cls in classes:
|
||||
bpy.utils.unregister_class(cls)
|
||||
|
|
|
@ -308,3 +308,9 @@ class UI_OT_i18n_edittranslation(bpy.types.Operator):
|
|||
row.prop(self, "update_po", text="Save to PO File", toggle=True)
|
||||
row.prop(self, "update_mo", text="Rebuild MO File", toggle=True)
|
||||
row.prop(self, "clean_mo", text="Erase Local MO files", toggle=True)
|
||||
|
||||
|
||||
classes = (
|
||||
UI_OT_i18n_edittranslation_update_mo,
|
||||
UI_OT_i18n_edittranslation,
|
||||
)
|
||||
|
|
|
@ -96,6 +96,7 @@ def _setattr(self, name, val):
|
|||
print(self, name, val)
|
||||
setattr(self, name, val)
|
||||
|
||||
|
||||
class UI_AP_i18n_settings(bpy.types.AddonPreferences):
|
||||
bl_idname = __name__.split(".")[0] # We want "top" module name!
|
||||
bl_option = {'REGISTER'}
|
||||
|
@ -195,3 +196,10 @@ class UI_AP_i18n_settings(bpy.types.AddonPreferences):
|
|||
col = split.column()
|
||||
col.operator("ui.i18n_settings_save", text="Save Persistent To...")
|
||||
col.operator("ui.i18n_settings_load", text="Load Persistent From...")
|
||||
|
||||
|
||||
classes = (
|
||||
UI_OT_i18n_settings_load,
|
||||
UI_OT_i18n_settings_save,
|
||||
UI_AP_i18n_settings,
|
||||
)
|
||||
|
|
|
@ -333,3 +333,11 @@ class UI_OT_i18n_addon_translation_export(bpy.types.Operator):
|
|||
trans.write(kind='PO', langs=set(uids))
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
classes = (
|
||||
UI_OT_i18n_addon_translation_invoke,
|
||||
UI_OT_i18n_addon_translation_update,
|
||||
UI_OT_i18n_addon_translation_import,
|
||||
UI_OT_i18n_addon_translation_export,
|
||||
)
|
||||
|
|
|
@ -221,3 +221,10 @@ class UI_OT_i18n_updatetranslation_svn_statistics(bpy.types.Operator):
|
|||
def invoke(self, context, event):
|
||||
wm = context.window_manager
|
||||
return wm.invoke_props_dialog(self)
|
||||
|
||||
|
||||
classes = (
|
||||
UI_OT_i18n_updatetranslation_svn_branches,
|
||||
UI_OT_i18n_updatetranslation_svn_trunk,
|
||||
UI_OT_i18n_updatetranslation_svn_statistics,
|
||||
)
|
||||
|
|
|
@ -221,3 +221,13 @@ class UI_OT_i18n_updatetranslation_svn_settings_select(bpy.types.Operator):
|
|||
for lng in context.window_manager.i18n_update_svn_settings.langs:
|
||||
lng.use = self.use_select
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
classes = (
|
||||
I18nUpdateTranslationLanguage,
|
||||
I18nUpdateTranslationSettings,
|
||||
UI_UL_i18n_languages,
|
||||
UI_PT_i18n_update_translations_settings,
|
||||
UI_OT_i18n_updatetranslation_svn_init_settings,
|
||||
UI_OT_i18n_updatetranslation_svn_settings_select,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue