mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Expose the new busy property to QML
Contributes to CURA-957
This commit is contained in:
parent
e0afc1535a
commit
c684e96ef1
1 changed files with 13 additions and 0 deletions
|
@ -33,6 +33,15 @@ class LayerViewProxy(QObject):
|
||||||
active_view = self._controller.getActiveView()
|
active_view = self._controller.getActiveView()
|
||||||
if type(active_view) == LayerView.LayerView.LayerView:
|
if type(active_view) == LayerView.LayerView.LayerView:
|
||||||
return active_view.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.isBusy()
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def setCurrentLayer(self, layer_num):
|
def setCurrentLayer(self, layer_num):
|
||||||
|
@ -49,9 +58,13 @@ class LayerViewProxy(QObject):
|
||||||
|
|
||||||
def _onMaxLayersChanged(self):
|
def _onMaxLayersChanged(self):
|
||||||
self.maxLayersChanged.emit()
|
self.maxLayersChanged.emit()
|
||||||
|
|
||||||
|
def _onBusyChanged(self):
|
||||||
|
self.busyChanged.emit()
|
||||||
|
|
||||||
def _onActiveViewChanged(self):
|
def _onActiveViewChanged(self):
|
||||||
active_view = self._controller.getActiveView()
|
active_view = self._controller.getActiveView()
|
||||||
if type(active_view) == LayerView.LayerView.LayerView:
|
if type(active_view) == LayerView.LayerView.LayerView:
|
||||||
active_view.currentLayerNumChanged.connect(self._onLayerChanged)
|
active_view.currentLayerNumChanged.connect(self._onLayerChanged)
|
||||||
active_view.maxLayersChanged.connect(self._onMaxLayersChanged)
|
active_view.maxLayersChanged.connect(self._onMaxLayersChanged)
|
||||||
|
active_view.busyChanged.connect(self._onBusyChanged)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue