
This commit adds a mixin which sets up a modal operator which: * Starts a subprocess * Polls for messages from that subprocesses
27 lines
733 B
Python
27 lines
733 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.package_manager_settings, "url")
|
|
row.operator(pkg_ops.PACKAGE_OT_fetch.bl_idname, text="Fetch")
|
|
|
|
def register():
|
|
bpy.utils.register_class(USERPREF_PT_packages)
|
|
|
|
def unregister():
|
|
bpy.utils.unregister_class(USERPREF_PT_packages)
|