Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoeydelarago <joeydelarago@gmail.com>2022-08-31 11:05:41 +0300
committerjoeydelarago <joeydelarago@gmail.com>2022-08-31 11:05:41 +0300
commitdaab1aae713fb4d060512fa72f37d3714b2c7e36 (patch)
tree85424a3c2b951875f66b1b55099ade186d8cf904 /cura/Machines
parentaa1c09591f3e7d7c696f9dc3f809f66a6a90262d (diff)
QML was attempting to fetch variables that were emtpy. Using self.clear() properly removed unused items when the list is resized to be smaller.
Also add some dummy variables inside cloud printer expand and contract buttons. CURA-9514
Diffstat (limited to 'cura/Machines')
-rw-r--r--cura/Machines/Models/MachineListModel.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/cura/Machines/Models/MachineListModel.py b/cura/Machines/Models/MachineListModel.py
index 8637801657..66def23a32 100644
--- a/cura/Machines/Models/MachineListModel.py
+++ b/cura/Machines/Models/MachineListModel.py
@@ -77,7 +77,7 @@ class MachineListModel(ListModel):
self._change_timer.start()
def _update(self) -> None:
- self.setItems([]) # Clear items
+ self.clear()
other_machine_stacks = CuraContainerRegistry.getInstance().findContainerStacks(type="machine")
@@ -105,14 +105,19 @@ class MachineListModel(ListModel):
if self._show_cloud_printers:
self.appendItem({ "listType": "HIDE_BUTTON",
"isOnline": True,
+ "isAbstractMachine": False,
+ "machineCount": 0
})
else:
- self.appendItem({ "listType": "SHOW_BUTTON",
+ self.appendItem({"listType": "SHOW_BUTTON",
"isOnline": True,
+ "isAbstractMachine": False,
+ "machineCount": 0
})
for stack in other_machine_stacks:
self.addItem(stack)
+ print(self.items)
def addItem(self, container_stack: ContainerStack, machine_count: int = 0) -> None:
if parseBool(container_stack.getMetaDataEntry("hidden", False)):