mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
CURA-4870 Add call to the QObject constructor
This commit is contained in:
parent
1ee5b44187
commit
b8ad0959a7
2 changed files with 7 additions and 6 deletions
|
|
@ -9,6 +9,7 @@ class ConfigurationModel(QObject):
|
||||||
configurationChanged = pyqtSignal()
|
configurationChanged = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
self._printer_type = None
|
self._printer_type = None
|
||||||
self._extruder_configurations = []
|
self._extruder_configurations = []
|
||||||
self._buildplate_configuration = None
|
self._buildplate_configuration = None
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
from UM.OutputDevice.OutputDevice import OutputDevice
|
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 PyQt5.QtWidgets import QMessageBox
|
||||||
|
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
|
|
@ -11,7 +11,7 @@ from UM.Signal import signalemitter
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
|
|
||||||
from enum import IntEnum # For the connection state tracking.
|
from enum import IntEnum # For the connection state tracking.
|
||||||
from typing import List, Set, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
MYPY = False
|
MYPY = False
|
||||||
if MYPY:
|
if MYPY:
|
||||||
|
|
@ -51,7 +51,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
super().__init__(device_id = device_id, parent = parent)
|
super().__init__(device_id = device_id, parent = parent)
|
||||||
|
|
||||||
self._printers = [] # type: List[PrinterOutputModel]
|
self._printers = [] # type: List[PrinterOutputModel]
|
||||||
self._unique_configurations = {} # type: Set[ConfigurationModel]
|
self._unique_configurations = [] # type: List[ConfigurationModel]
|
||||||
|
|
||||||
self._monitor_view_qml_path = ""
|
self._monitor_view_qml_path = ""
|
||||||
self._monitor_component = None
|
self._monitor_component = None
|
||||||
|
|
@ -180,13 +180,13 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
|
|
||||||
self.acceptsCommandsChanged.emit()
|
self.acceptsCommandsChanged.emit()
|
||||||
|
|
||||||
# Returns the unique configurations of the current printers
|
# Returns the unique configurations of the printers within this output device
|
||||||
@pyqtProperty("QVariantMap", notify = uniqueConfigurationsChanged)
|
@pyqtProperty("QVariantList", notify = uniqueConfigurationsChanged)
|
||||||
def uniqueConfigurations(self):
|
def uniqueConfigurations(self):
|
||||||
return self._unique_configurations
|
return self._unique_configurations
|
||||||
|
|
||||||
def _updateUniqueConfigurations(self):
|
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()
|
self.uniqueConfigurationsChanged.emit()
|
||||||
|
|
||||||
def _onPrintersChanged(self):
|
def _onPrintersChanged(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue