Fix MachineManager connection to OutputDeviceManager signals late.

If a PrinterOutputDevice is able to connect quickly to a machine, then
by the time the MachineManager is created and connects to the signal,
it will be too late, and it might miss that there is already connected
devices.

# Conflicts:
#	plugins/USBPrinting/USBPrinterOutputDeviceManager.py
This commit is contained in:
Youness Alaoui 2016-09-14 14:57:43 -04:00 committed by fieldOfView
parent 391533e939
commit 7e7e15a12b
2 changed files with 10 additions and 18 deletions

View file

@ -91,6 +91,8 @@ class MachineManager(QObject):
self._printer_output_devices = []
Application.getInstance().getOutputDeviceManager().outputDevicesChanged.connect(self._onOutputDevicesChanged)
# There might already be some output devices by the time the signal is connected
self._onOutputDevicesChanged()
if active_machine_id != "" and ContainerRegistry.getInstance().findContainerStacks(id = active_machine_id):
# An active machine was saved, so restore it.