Skip to content

Commit

Permalink
add text
Browse files Browse the repository at this point in the history
  • Loading branch information
5axes committed Jun 2, 2022
1 parent cd80d95 commit 42897c2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
19 changes: 18 additions & 1 deletion CustomSupportsCylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def __init__(self):
self._MirrorSupport = False
self._SType = 'cylinder'
self._SubType = 'cross'
self._SMsg = 'Remove All'

# Shortcut
if not VERSION_QT5:
Expand All @@ -128,7 +129,7 @@ def __init__(self):

self._application = CuraApplication.getInstance()

self.setExposedProperties("SSize", "MSize", "ISize", "AAngle", "SType" , "YDirection" , "EHeights" , "SMain" , "SubType" , "SMirror")
self.setExposedProperties("SSize", "MSize", "ISize", "AAngle", "SType" , "YDirection" , "EHeights" , "SMain" , "SubType" , "SMirror", "SMsg")

CuraApplication.getInstance().globalContainerStackChanged.connect(self._updateEnabled)

Expand Down Expand Up @@ -395,6 +396,8 @@ def _createSupportMesh(self, parent: CuraSceneNode, position: Vector , position2
op.push()
node.setPosition(position, CuraSceneNode.TransformSpace.World)
self._all_picked_node.append(node)
self._SMsg = 'Remove Last'
Ret = self.getSMsg

CuraApplication.getInstance().getController().getScene().sceneChanged.emit(node)

Expand Down Expand Up @@ -941,6 +944,7 @@ def removeAllSupportMesh(self):
if node_stack.getProperty("support_mesh", "value"):
self._removeSupportMesh(node)
self._all_picked_node = []
self._SMsg = 'Remove All'
else:
for node in DepthFirstIterator(self._application.getController().getScene().getRoot()):
if node.callDecoration("isSliceable"):
Expand Down Expand Up @@ -1044,7 +1048,20 @@ def setAAngle(self, AAngle: str) -> None:
# Logger.log('d', 's_value : ' + str(s_value))
self._UseAngle = s_value
self._preferences.setValue("customsupportcylinder/a_angle", s_value)

def getSMsg(self) -> bool:
"""
return: golabl _SMsg as text paramater.
"""
return self._SMsg

def setSMsg(self, SMsg: str) -> None:
"""
param SType: SMsg as text paramater.
"""
self._SMsg = SMsg


def getSType(self) -> bool:
"""
return: golabl _SType as text paramater.
Expand Down
8 changes: 6 additions & 2 deletions qml_qt6/CustomSupport.qml
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,12 @@ Item
width: UM.Theme.getSize("setting_control").width
height: UM.Theme.getSize("setting_control").height
highlighted : true
text: catalog.i18nc("@label", "Remove All")
onClicked: UM.ActiveTool.triggerAction("removeAllSupportMesh")
text: catalog.i18nc("@label", UM.ActiveTool.properties.getValue("SMsg"))
onClicked:
{
UM.ActiveTool.triggerAction("removeAllSupportMesh")
text: catalog.i18nc("@label", "Remove All")
}
}

}

0 comments on commit 42897c2

Please sign in to comment.