Merge branch '3.4'

This commit is contained in:
Ghostkeeper 2018-06-07 11:38:13 +02:00
commit 8202b62343
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
4 changed files with 17 additions and 10 deletions

View file

@ -1243,7 +1243,7 @@ class MachineManager(QObject):
## Given a printer definition name, select the right machine instance. In case it doesn't exist, create a new
# instance with the same network key.
@pyqtSlot(str)
def switchPrinterType(self, machine_name: str):
def switchPrinterType(self, machine_name: str) -> None:
# Don't switch if the user tries to change to the same type of printer
if self.activeMachineDefinitionName == machine_name:
return
@ -1254,6 +1254,8 @@ class MachineManager(QObject):
# If there is no machine, then create a new one and set it to the non-hidden instance
if not new_machine:
new_machine = CuraStackBuilder.createMachine(machine_definition_id + "_sync", machine_definition_id)
if not new_machine:
return
new_machine.addMetaDataEntry("um_network_key", self.activeMachineNetworkKey)
new_machine.addMetaDataEntry("connect_group_name", self.activeMachineNetworkGroupName)
new_machine.addMetaDataEntry("hidden", False)