mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 03:46:05 +08:00
Fix manual printer device not up-to-date
CURA-6483
This commit is contained in:
parent
2b5d78a01a
commit
0575fd283e
@ -22,6 +22,7 @@ Item
|
|||||||
property bool hasRequestInProgress: CuraApplication.getDiscoveredPrintersModel().hasManualDeviceRequestInProgress
|
property bool hasRequestInProgress: CuraApplication.getDiscoveredPrintersModel().hasManualDeviceRequestInProgress
|
||||||
// Indicates if a request has finished.
|
// Indicates if a request has finished.
|
||||||
property bool hasRequestFinished: false
|
property bool hasRequestFinished: false
|
||||||
|
property string currentRequestAddress: ""
|
||||||
|
|
||||||
property var discoveredPrinter: null
|
property var discoveredPrinter: null
|
||||||
property bool isPrinterDiscovered: discoveredPrinter != null
|
property bool isPrinterDiscovered: discoveredPrinter != null
|
||||||
@ -31,6 +32,26 @@ Item
|
|||||||
// For validating IP address
|
// For validating IP address
|
||||||
property var networkingUtil: Cura.NetworkingUtil {}
|
property var networkingUtil: Cura.NetworkingUtil {}
|
||||||
|
|
||||||
|
// CURA-6483
|
||||||
|
// For a manually added UM printer, the UM3OutputDevicePlugin will first create a LegacyUM device for it. Later,
|
||||||
|
// when it gets more info from the printer, it will first REMOVE the LegacyUM device and then add a ClusterUM device.
|
||||||
|
// The Add-by-IP page needs to make sure that the user do not add an unknown printer or a printer that's not the
|
||||||
|
// host of a group. Because of the device list change, this page needs to react upon DiscoveredPrintersChanged so
|
||||||
|
// it has the correct information.
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: CuraApplication.getDiscoveredPrintersModel()
|
||||||
|
onDiscoveredPrintersChanged:
|
||||||
|
{
|
||||||
|
if (hasRequestFinished && currentRequestAddress)
|
||||||
|
{
|
||||||
|
var printer = CuraApplication.getDiscoveredPrintersModel().discoveredPrintersByAddress[currentRequestAddress]
|
||||||
|
printer = printer ? printer : null
|
||||||
|
discoveredPrinter = printer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure to cancel the current request when this page closes.
|
// Make sure to cancel the current request when this page closes.
|
||||||
onVisibleChanged:
|
onVisibleChanged:
|
||||||
{
|
{
|
||||||
@ -149,9 +170,11 @@ Item
|
|||||||
if (CuraApplication.getDiscoveredPrintersModel().discoveredPrintersByAddress[address])
|
if (CuraApplication.getDiscoveredPrintersModel().discoveredPrintersByAddress[address])
|
||||||
{
|
{
|
||||||
addPrinterByIpScreen.discoveredPrinter = CuraApplication.getDiscoveredPrintersModel().discoveredPrintersByAddress[address]
|
addPrinterByIpScreen.discoveredPrinter = CuraApplication.getDiscoveredPrintersModel().discoveredPrintersByAddress[address]
|
||||||
|
addPrinterByIpScreen.hasRequestFinished = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addPrinterByIpScreen.currentRequestAddress = address
|
||||||
CuraApplication.getDiscoveredPrintersModel().checkManualDevice(address)
|
CuraApplication.getDiscoveredPrintersModel().checkManualDevice(address)
|
||||||
}
|
}
|
||||||
busy: addPrinterByIpScreen.hasRequestInProgress
|
busy: addPrinterByIpScreen.hasRequestInProgress
|
||||||
|
Loading…
x
Reference in New Issue
Block a user