mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 15:39:00 +08:00
Fix connecting to the same printer twice
CURA-2019
This commit is contained in:
parent
d7f3b73420
commit
bb8e74eb48
@ -11,7 +11,7 @@ Cura.MachineAction
|
||||
id: base
|
||||
anchors.fill: parent;
|
||||
property var selectedPrinter: null
|
||||
property var connectingWithPrinter: null
|
||||
property var connectingToPrinter: null
|
||||
|
||||
Connections
|
||||
{
|
||||
@ -25,11 +25,14 @@ Cura.MachineAction
|
||||
if(base.selectedPrinter)
|
||||
{
|
||||
var printerKey = base.selectedPrinter.getKey()
|
||||
if(connectingWithPrinter != printerKey) {
|
||||
if(connectingToPrinter != printerKey) {
|
||||
// prevent an infinite loop
|
||||
connectingWithPrinter = printerKey;
|
||||
connectingToPrinter = printerKey;
|
||||
manager.setKey(printerKey);
|
||||
completed();
|
||||
} else {
|
||||
// reset, so we can connect to the same printer again if needed
|
||||
connectingToPrinter = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user