Add a new printer selector button that is connected to the output

devices and shows labels containing the type of printers that are in the
same group.

Contributes to CURA-5942.
This commit is contained in:
Diego Prado Gesto 2018-11-22 13:54:10 +01:00
parent b890e40e81
commit 9720512f50
5 changed files with 121 additions and 37 deletions

View file

@ -211,6 +211,11 @@ class PrinterOutputDevice(QObject, OutputDevice):
self._unique_configurations.sort(key = lambda k: k.printerType)
self.uniqueConfigurationsChanged.emit()
# Returns the unique configurations of the printers within this output device
@pyqtProperty("QVariantList", notify = uniqueConfigurationsChanged)
def uniquePrinterTypes(self) -> List[str]:
return list(set([configuration.printerType for configuration in self._unique_configurations]))
def _onPrintersChanged(self) -> None:
for printer in self._printers:
printer.configurationChanged.connect(self._updateUniqueConfigurations)