This repository has been archived on 2023-02-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-package-manager-addon/pkg_ui.py

34 lines
964 B
Python
Raw Normal View History

2017-06-22 01:43:08 -07:00
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):
wm = context.window_manager
# see comment in __init__.py
pm_settings = wm.package_manager_settings
2017-06-22 01:43:08 -07:00
layout = self.layout
row = layout.row()
row.prop(pm_settings, "url")
row.operator(pkg_ops.PACKAGE_OT_fetch.bl_idname, text="Fetch")
2017-06-22 01:43:08 -07:00
row = layout.row()
# just a demonstration
row.label(text="Last response: %s" % pkg_ops.PACKAGE_OT_fetch.last_response)
2017-06-22 01:43:08 -07:00
def register():
bpy.utils.register_class(USERPREF_PT_packages)
def unregister():
bpy.utils.unregister_class(USERPREF_PT_packages)