mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Added MachineManagerModel to Cura
CURA-1278
This commit is contained in:
parent
9fcc3930ff
commit
573c1c1a5a
3 changed files with 33 additions and 3 deletions
25
cura/MachineManagerModel.py
Normal file
25
cura/MachineManagerModel.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
|
||||
from UM.Application import Application
|
||||
from UM.Signal import Signal, signalemitter
|
||||
|
||||
class MachineManagerModel(QObject):
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(parent)
|
||||
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerChanged)
|
||||
|
||||
globalContainerChanged = pyqtSignal()
|
||||
|
||||
def _onGlobalContainerChanged(self):
|
||||
self.globalContainerChanged.emit()
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setActiveMachine(self, stack_id):
|
||||
pass
|
||||
|
||||
@pyqtProperty(str, notify = globalContainerChanged)
|
||||
def activeMachineId(self):
|
||||
return Application.getInstance().getGlobalContainerStack().getId()
|
||||
|
||||
def createMachineManagerModel(engine, script_engine):
|
||||
return MachineManagerModel()
|
Loading…
Add table
Add a link
Reference in a new issue