mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Add legacy 'Connect over Network' button back
This commit is contained in:
parent
d703e48007
commit
e977cdd431
7 changed files with 131 additions and 140 deletions
|
@ -52,6 +52,7 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
|
|||
|
||||
# Keeps track of all printers in the cluster.
|
||||
self._printers = [] # type: List[PrinterOutputModel]
|
||||
self._received_printers = False
|
||||
|
||||
# Keeps track of all print jobs in the cluster.
|
||||
self._print_jobs = [] # type: List[UM3PrintJobOutputModel]
|
||||
|
@ -96,6 +97,8 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
|
|||
# Get the amount of printers in the cluster.
|
||||
@pyqtProperty(int, notify=_clusterPrintersChanged)
|
||||
def clusterSize(self) -> int:
|
||||
if not self._received_printers:
|
||||
return 1 # prevent false positives when discovering new devices
|
||||
return len(self._printers)
|
||||
|
||||
# Get the amount of printer in the cluster per type.
|
||||
|
@ -217,6 +220,7 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
|
|||
self.setActivePrinter(None)
|
||||
|
||||
self._printers = new_printers
|
||||
self._received_printers = True
|
||||
if self._printers and not self.activePrinter:
|
||||
self.setActivePrinter(self._printers[0])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue