diff --git a/cura/MachineAction.py b/cura/MachineAction.py index c38be5261f..98e156d834 100644 --- a/cura/MachineAction.py +++ b/cura/MachineAction.py @@ -114,3 +114,15 @@ class MachineAction(QObject, PluginObject): @pyqtSlot(result = QObject) def getDisplayItem(self) -> Optional["QObject"]: return self._createViewFromQML() + + @pyqtSlot(result = bool) + def isVisible(self) -> bool: + """Whether this action button will be visible. + + Example: Show only when isLoggedIn + + :return: Defaults to true to be in line with the old behaviour. + """ + + return True + \ No newline at end of file diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 258b45292e..d728be6dfa 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -67,6 +67,7 @@ UM.ManagementPage { width: Math.round(childrenRect.width + 2 * screenScaleFactor) height: childrenRect.height + visible: machineActionRepeater.model[index].isVisible() Cura.SecondaryButton { text: machineActionRepeater.model[index].label