Fix sidebar loading and unloading depending on active stage

This commit is contained in:
ChrisTerBeke 2017-12-06 17:46:18 +01:00
parent 2d044a37ae
commit ee643610e5
7 changed files with 601 additions and 603 deletions

View file

@ -9,14 +9,13 @@ from cura.Stages.CuraStage import CuraStage
## Stage for monitoring a 3D printing while it's printing.
class MonitorStage(CuraStage):
def __init__(self):
super().__init__()
def __init__(self, parent = None):
super().__init__(parent)
Application.getInstance().engineCreatedSignal.connect(self._engineCreated)
# TODO: connect output device state to icon source
def _engineCreated(self):
# Note: currently the sidebar component for prepare and monitor stages is the same, this will change with the printer output device refactor!
sidebar_component_path = os.path.join(Resources.getPath(Application.getInstance().ResourceTypes.QmlFiles), "Sidebar.qml")
sidebar_component = Application.getInstance().createQmlComponent(sidebar_component_path)
self.addDisplayComponent("sidebar", sidebar_component)
self.addDisplayComponent("sidebar", sidebar_component_path)
self.setIconSource(Application.getInstance().getTheme().getIcon("tab_status_connected"))