mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 19:35:58 +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
|
id: base
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
property var selectedPrinter: null
|
property var selectedPrinter: null
|
||||||
property var connectingWithPrinter: null
|
property var connectingToPrinter: null
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
{
|
{
|
||||||
@ -25,11 +25,14 @@ Cura.MachineAction
|
|||||||
if(base.selectedPrinter)
|
if(base.selectedPrinter)
|
||||||
{
|
{
|
||||||
var printerKey = base.selectedPrinter.getKey()
|
var printerKey = base.selectedPrinter.getKey()
|
||||||
if(connectingWithPrinter != printerKey) {
|
if(connectingToPrinter != printerKey) {
|
||||||
// prevent an infinite loop
|
// prevent an infinite loop
|
||||||
connectingWithPrinter = printerKey;
|
connectingToPrinter = printerKey;
|
||||||
manager.setKey(printerKey);
|
manager.setKey(printerKey);
|
||||||
completed();
|
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