mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-01 06:41:06 -07:00
Fix connecting to the same printer twice
CURA-2019
This commit is contained in:
parent
d7f3b73420
commit
bb8e74eb48
1 changed files with 6 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue