27 lines
737 B
Python
27 lines
737 B
Python
|
import bpy
|
||
|
from . import pkg_ops
|
||
|
|
||
|
class USERPREF_PT_packages(bpy.types.Panel):
|
||
|
bl_label = "Package Management"
|
||
|
bl_space_type = 'USER_PREFERENCES'
|
||
|
bl_region_type = 'WINDOW'
|
||
|
bl_options = {'HIDE_HEADER'}
|
||
|
|
||
|
@classmethod
|
||
|
def poll(cls, context):
|
||
|
userpref = context.user_preferences
|
||
|
return (userpref.active_section == 'PACKAGES')
|
||
|
|
||
|
def draw(self, context):
|
||
|
layout = self.layout
|
||
|
|
||
|
row = layout.row()
|
||
|
row.prop(context.window_manager.PackageManagerSettings, "url")
|
||
|
row.operator(pkg_ops.PACKAGE_OT_fetch_lists.bl_idname, text="Fetch")
|
||
|
|
||
|
def register():
|
||
|
bpy.utils.register_class(USERPREF_PT_packages)
|
||
|
|
||
|
def unregister():
|
||
|
bpy.utils.unregister_class(USERPREF_PT_packages)
|