mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 22:23:57 -06:00
Added machine action buttons dynamic visibility
Based on this change, users now will be able to manage the visibility of their machine action plugin implementations. For example, a machine action only visible when loggedIn.
This commit is contained in:
parent
a8f0e330ad
commit
ed14e3bd44
2 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue