feat: initial notification popup
This commit is contained in:
parent
7f19d45b71
commit
4a4cd5db50
@ -114,6 +114,8 @@ def on_connection_end():
|
||||
if isinstance(handler, logging.FileHandler):
|
||||
logger.removeHandler(handler)
|
||||
|
||||
bpy.ops.session.notify('INVOKE_DEFAULT', message="Disconnected from server")
|
||||
|
||||
|
||||
# OPERATORS
|
||||
class SessionStartOperator(bpy.types.Operator):
|
||||
@ -651,7 +653,7 @@ class ApplyArmatureOperator(bpy.types.Operator):
|
||||
stop_modal_executor = False
|
||||
|
||||
|
||||
class ClearCache(bpy.types.Operator):
|
||||
class SessionClearCache(bpy.types.Operator):
|
||||
"Clear local session cache"
|
||||
bl_idname = "session.clear_cache"
|
||||
bl_label = "Modal Executor Operator"
|
||||
@ -679,6 +681,31 @@ class ClearCache(bpy.types.Operator):
|
||||
row = self.layout
|
||||
row.label(text=f" Do you really want to remove local cache ? ")
|
||||
|
||||
class SessionNotifyOperator(bpy.types.Operator):
|
||||
"""Dialog only operator"""
|
||||
bl_idname = "session.notify"
|
||||
bl_label = "Notification"
|
||||
|
||||
message: bpy.props.StringProperty()
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return True
|
||||
|
||||
def execute(self, context):
|
||||
return {'FINISHED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
title = layout.row()
|
||||
title = title.label(text="Multi-user", icon='INFO')
|
||||
message = layout.row()
|
||||
message.label(text=self.message)
|
||||
|
||||
|
||||
def invoke(self, context, event):
|
||||
return context.window_manager.invoke_popup(self, width=200)
|
||||
|
||||
|
||||
classes = (
|
||||
SessionStartOperator,
|
||||
@ -692,7 +719,8 @@ classes = (
|
||||
ApplyArmatureOperator,
|
||||
SessionKickOperator,
|
||||
SessionInitOperator,
|
||||
ClearCache,
|
||||
SessionClearCache,
|
||||
SessionNotifyOperator,
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user