mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 05:15:52 +08:00
Expose the new busy property to QML
Contributes to CURA-957
This commit is contained in:
parent
e0afc1535a
commit
c684e96ef1
@ -34,6 +34,15 @@ class LayerViewProxy(QObject):
|
|||||||
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):
|
||||||
active_view = self._controller.getActiveView()
|
active_view = self._controller.getActiveView()
|
||||||
@ -50,8 +59,12 @@ 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…
x
Reference in New Issue
Block a user