mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Move layerdata and busy handling back into LayerView
This reverts commits17b12b9048
and66f8a62e6c
. # Conflicts: # plugins/LayerView/LayerPass.py # plugins/LayerView/LayerView.py
This commit is contained in:
parent
155fe326b7
commit
087ad6f472
4 changed files with 226 additions and 218 deletions
|
@ -19,27 +19,27 @@ class LayerViewProxy(QObject):
|
|||
def getLayerActivity(self):
|
||||
active_view = self._controller.getActiveView()
|
||||
if type(active_view) == LayerView.LayerView.LayerView:
|
||||
return active_view.getLayerPass().getActivity()
|
||||
return active_view.getActivity()
|
||||
|
||||
@pyqtProperty(int, notify = maxLayersChanged)
|
||||
def numLayers(self):
|
||||
active_view = self._controller.getActiveView()
|
||||
if type(active_view) == LayerView.LayerView.LayerView:
|
||||
return active_view.getLayerPass().getMaxLayers()
|
||||
return active_view.getMaxLayers()
|
||||
#return 100
|
||||
|
||||
@pyqtProperty(int, notify = currentLayerChanged)
|
||||
def currentLayer(self):
|
||||
active_view = self._controller.getActiveView()
|
||||
if type(active_view) == LayerView.LayerView.LayerView:
|
||||
return active_view.getLayerPass().getCurrentLayer()
|
||||
return active_view.getCurrentLayer()
|
||||
|
||||
busyChanged = pyqtSignal()
|
||||
@pyqtProperty(bool, notify = busyChanged)
|
||||
def busy(self):
|
||||
active_view = self._controller.getActiveView()
|
||||
if type(active_view) == LayerView.LayerView.LayerView:
|
||||
return active_view.getLayerPass().isBusy()
|
||||
return active_view.isBusy()
|
||||
|
||||
return False
|
||||
|
||||
|
@ -47,7 +47,7 @@ class LayerViewProxy(QObject):
|
|||
def setCurrentLayer(self, layer_num):
|
||||
active_view = self._controller.getActiveView()
|
||||
if type(active_view) == LayerView.LayerView.LayerView:
|
||||
active_view.getLayerPass().setLayer(layer_num)
|
||||
active_view.setLayer(layer_num)
|
||||
|
||||
def _layerActivityChanged(self):
|
||||
self.activityChanged.emit()
|
||||
|
@ -65,6 +65,6 @@ class LayerViewProxy(QObject):
|
|||
def _onActiveViewChanged(self):
|
||||
active_view = self._controller.getActiveView()
|
||||
if type(active_view) == LayerView.LayerView.LayerView:
|
||||
active_view.getLayerPass().currentLayerNumChanged.connect(self._onLayerChanged)
|
||||
active_view.getLayerPass().maxLayersChanged.connect(self._onMaxLayersChanged)
|
||||
active_view.getLayerPass().busyChanged.connect(self._onBusyChanged)
|
||||
active_view.currentLayerNumChanged.connect(self._onLayerChanged)
|
||||
active_view.maxLayersChanged.connect(self._onMaxLayersChanged)
|
||||
active_view.busyChanged.connect(self._onBusyChanged)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue