mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Revert Some of "Fix show/hide button in WorkSpaceDialog printer selector"
This reverts commit 0c79ec73
This commit is contained in:
parent
44d9df57e4
commit
62274c4dac
2 changed files with 8 additions and 7 deletions
|
@ -29,7 +29,7 @@ class MachineListModel(ListModel):
|
||||||
IsAbstractMachineRole = Qt.ItemDataRole.UserRole + 7
|
IsAbstractMachineRole = Qt.ItemDataRole.UserRole + 7
|
||||||
ComponentTypeRole = Qt.ItemDataRole.UserRole + 8
|
ComponentTypeRole = Qt.ItemDataRole.UserRole + 8
|
||||||
|
|
||||||
def __init__(self, parent: Optional[QObject] = None, machines_filter: Optional[List[GlobalStack]] = None) -> None:
|
def __init__(self, parent: Optional[QObject] = None, machines_filter: List[GlobalStack] = None, listenToChanges: bool = True) -> None:
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
self._show_cloud_printers = False
|
self._show_cloud_printers = False
|
||||||
|
@ -51,10 +51,11 @@ class MachineListModel(ListModel):
|
||||||
self._change_timer.setSingleShot(True)
|
self._change_timer.setSingleShot(True)
|
||||||
self._change_timer.timeout.connect(self._update)
|
self._change_timer.timeout.connect(self._update)
|
||||||
|
|
||||||
CuraContainerRegistry.getInstance().containerAdded.connect(self._onContainerChanged)
|
if listenToChanges:
|
||||||
CuraContainerRegistry.getInstance().containerMetaDataChanged.connect(self._onContainerChanged)
|
CuraContainerRegistry.getInstance().containerAdded.connect(self._onContainerChanged)
|
||||||
CuraContainerRegistry.getInstance().containerRemoved.connect(self._onContainerChanged)
|
CuraContainerRegistry.getInstance().containerMetaDataChanged.connect(self._onContainerChanged)
|
||||||
self._updateDelayed()
|
CuraContainerRegistry.getInstance().containerRemoved.connect(self._onContainerChanged)
|
||||||
|
self._updateDelayed()
|
||||||
|
|
||||||
showCloudPrintersChanged = pyqtSignal(bool)
|
showCloudPrintersChanged = pyqtSignal(bool)
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ class WorkspaceDialog(QObject):
|
||||||
self._extruders = []
|
self._extruders = []
|
||||||
self._objects_on_plate = False
|
self._objects_on_plate = False
|
||||||
self._is_printer_group = False
|
self._is_printer_group = False
|
||||||
self._updatable_machines_model = MachineListModel(self)
|
self._updatable_machines_model = MachineListModel(self, listenToChanges=False)
|
||||||
self._missing_package_metadata: List[Dict[str, str]] = []
|
self._missing_package_metadata: List[Dict[str, str]] = []
|
||||||
self._plugin_registry: PluginRegistry = CuraApplication.getInstance().getPluginRegistry()
|
self._plugin_registry: PluginRegistry = CuraApplication.getInstance().getPluginRegistry()
|
||||||
self._install_missing_package_dialog: Optional[QObject] = None
|
self._install_missing_package_dialog: Optional[QObject] = None
|
||||||
|
@ -168,7 +168,7 @@ class WorkspaceDialog(QObject):
|
||||||
return cast(MachineListModel, self._updatable_machines_model)
|
return cast(MachineListModel, self._updatable_machines_model)
|
||||||
|
|
||||||
def setUpdatableMachines(self, updatable_machines: List[GlobalStack]) -> None:
|
def setUpdatableMachines(self, updatable_machines: List[GlobalStack]) -> None:
|
||||||
self._updatable_machines_model.set_machines_filter(updatable_machines)
|
self._updatable_machines_model.update(updatable_machines)
|
||||||
self.updatableMachinesChanged.emit()
|
self.updatableMachinesChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = isAbstractMachineChanged)
|
@pyqtProperty(bool, notify = isAbstractMachineChanged)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue