Fix refresh of ChoosePrinterDialog not working

CURA-9278
This commit is contained in:
Jaime van Kessel 2022-09-16 14:39:20 +02:00
parent 017560480a
commit 1dc42cb69a
No known key found for this signature in database
GPG key ID: C85F7A3AF1BAA7C4
2 changed files with 11 additions and 3 deletions

View file

@ -31,6 +31,10 @@ class CompatibleMachineModel(ListModel):
machine_manager.globalContainerChanged.connect(self._update)
machine_manager.outputDevicesChanged.connect(self._update)
@pyqtSlot()
def forceUpdate(self):
self._update()
def _update(self) -> None:
self.clear()

View file

@ -11,7 +11,7 @@ import Cura 1.0 as Cura
UM.Dialog
{
property var manager
property var compatible_machine_model: Cura.CompatibleMachineModel {}
id: base
title: catalog.i18nc("@title:window", "Select Printer")
@ -65,7 +65,11 @@ UM.Dialog
color: UM.Theme.getColor("text_link")
hoverColor: UM.Theme.getColor("text_scene_hover")
onClicked: manager.refresh()
onClicked:
{
manager.refresh()
base.compatible_machine_model.forceUpdate()
}
}
}
@ -73,7 +77,7 @@ UM.Dialog
{
id: contents
model: Cura.CompatibleMachineModel {}
model: base.compatible_machine_model
delegate: Cura.PrintSelectorCard
{