|
@@ -3,7 +3,7 @@
|
|
|
|
|
|
from UM.i18n import i18nCatalog
|
|
|
from UM.OutputDevice.OutputDevice import OutputDevice
|
|
|
-from PyQt5.QtCore import pyqtProperty, QObject, QTimer, pyqtSignal
|
|
|
+from PyQt5.QtCore import pyqtProperty, QObject, QTimer, pyqtSignal, QVariant
|
|
|
from PyQt5.QtWidgets import QMessageBox
|
|
|
|
|
|
from UM.Logger import Logger
|
|
@@ -11,7 +11,7 @@ from UM.Signal import signalemitter
|
|
|
from UM.Application import Application
|
|
|
|
|
|
from enum import IntEnum # For the connection state tracking.
|
|
|
-from typing import List, Set, Optional
|
|
|
+from typing import List, Optional
|
|
|
|
|
|
MYPY = False
|
|
|
if MYPY:
|
|
@@ -51,7 +51,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|
|
super().__init__(device_id = device_id, parent = parent)
|
|
|
|
|
|
self._printers = [] # type: List[PrinterOutputModel]
|
|
|
- self._unique_configurations = {} # type: Set[ConfigurationModel]
|
|
|
+ self._unique_configurations = [] # type: List[ConfigurationModel]
|
|
|
|
|
|
self._monitor_view_qml_path = ""
|
|
|
self._monitor_component = None
|
|
@@ -180,13 +180,13 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|
|
|
|
|
self.acceptsCommandsChanged.emit()
|
|
|
|
|
|
- # Returns the unique configurations of the current printers
|
|
|
- @pyqtProperty("QVariantMap", notify = uniqueConfigurationsChanged)
|
|
|
+ # Returns the unique configurations of the printers within this output device
|
|
|
+ @pyqtProperty("QVariantList", notify = uniqueConfigurationsChanged)
|
|
|
def uniqueConfigurations(self):
|
|
|
return self._unique_configurations
|
|
|
|
|
|
def _updateUniqueConfigurations(self):
|
|
|
- self._unique_configurations = set([printer.printerConfiguration for printer in self._printers])
|
|
|
+ self._unique_configurations = list(set([printer.printerConfiguration for printer in self._printers]))
|
|
|
self.uniqueConfigurationsChanged.emit()
|
|
|
|
|
|
def _onPrintersChanged(self):
|