feat: expose commit to the user
This commit is contained in:
Submodule libs/replication updated: 1e24adc350...2d5ef3d18c
20
operators.py
20
operators.py
@ -273,6 +273,25 @@ class SessionApply(bpy.types.Operator):
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
class SessionCommit(bpy.types.Operator):
|
||||
bl_idname = "session.commit"
|
||||
bl_label = "commit and push the target to other clients"
|
||||
bl_description = "commit and push the target to other clients"
|
||||
bl_options = {"REGISTER"}
|
||||
|
||||
target = bpy.props.StringProperty()
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return True
|
||||
|
||||
def execute(self, context):
|
||||
global client
|
||||
|
||||
client.commit(uuid=self.target)
|
||||
client.push(uuid=self.target)
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
classes = (
|
||||
SessionStartOperator,
|
||||
@ -281,6 +300,7 @@ classes = (
|
||||
SessionSnapUserOperator,
|
||||
SessionPropertyRightOperator,
|
||||
SessionApply,
|
||||
SessionCommit,
|
||||
)
|
||||
|
||||
|
||||
|
7
ui.py
7
ui.py
@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from . import operators
|
||||
from .libs.replication.replication.constants import FETCHED, ERROR
|
||||
from .libs.replication.replication.constants import FETCHED, ERROR, MODIFIED
|
||||
from .bl_types.bl_user import BlUser
|
||||
|
||||
|
||||
@ -213,6 +213,11 @@ def draw_property(context, parent, property_uuid, level=0):
|
||||
"session.apply",
|
||||
text="",
|
||||
icon=PROP_STATES[item.state]).target = item.uuid
|
||||
elif item.state == MODIFIED:
|
||||
detail_item_box.operator(
|
||||
"session.commit",
|
||||
text="",
|
||||
icon=PROP_STATES[item.state]).target = item.uuid
|
||||
else:
|
||||
detail_item_box.label(text="", icon=PROP_STATES[item.state])
|
||||
|
||||
|
Reference in New Issue
Block a user