Deprecate the activeMachineName/Id properties in favour of activeMachine

This commit is contained in:
Arjen Hiemstra 2017-04-04 17:40:34 +02:00
parent 7eb5441ebc
commit cbc19b13eb

View file

@ -11,6 +11,7 @@ from UM.Application import Application
from UM.Preferences import Preferences from UM.Preferences import Preferences
from UM.Logger import Logger from UM.Logger import Logger
from UM.Message import Message from UM.Message import Message
from UM.Decorators import deprecated
from UM.Settings.ContainerRegistry import ContainerRegistry from UM.Settings.ContainerRegistry import ContainerRegistry
from UM.Settings.ContainerStack import ContainerStack from UM.Settings.ContainerStack import ContainerStack
@ -482,6 +483,7 @@ class MachineManager(QObject):
return "" return ""
@pyqtProperty(str, notify = globalContainerChanged) @pyqtProperty(str, notify = globalContainerChanged)
@deprecated("Use activeMachine.name", "2.6")
def activeMachineName(self) -> str: def activeMachineName(self) -> str:
if self._global_container_stack: if self._global_container_stack:
return self._global_container_stack.getName() return self._global_container_stack.getName()
@ -489,6 +491,7 @@ class MachineManager(QObject):
return "" return ""
@pyqtProperty(str, notify = globalContainerChanged) @pyqtProperty(str, notify = globalContainerChanged)
@deprecated("Use activeMachine.id", "2.6")
def activeMachineId(self) -> str: def activeMachineId(self) -> str:
if self._global_container_stack: if self._global_container_stack:
return self._global_container_stack.getId() return self._global_container_stack.getId()