mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Call from QtApplication instead of Application
Because we're using createQmlComponent which is only in QtApplication. Contributes to issue CURA-5330.
This commit is contained in:
parent
6e663ac6f5
commit
eda0d34fd9
@ -11,7 +11,7 @@ from UM.Logger import Logger
|
|||||||
from UM.FileHandler.FileHandler import FileHandler #For typing.
|
from UM.FileHandler.FileHandler import FileHandler #For typing.
|
||||||
from UM.Scene.SceneNode import SceneNode #For typing.
|
from UM.Scene.SceneNode import SceneNode #For typing.
|
||||||
from UM.Signal import signalemitter
|
from UM.Signal import signalemitter
|
||||||
from UM.Application import Application
|
from UM.Qt.QtApplication import QtApplication
|
||||||
|
|
||||||
from enum import IntEnum # For the connection state tracking.
|
from enum import IntEnum # For the connection state tracking.
|
||||||
from typing import Callable, List, Optional
|
from typing import Callable, List, Optional
|
||||||
@ -87,7 +87,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||||||
self._address = "" #type: str
|
self._address = "" #type: str
|
||||||
self._connection_text = "" #type: str
|
self._connection_text = "" #type: str
|
||||||
self.printersChanged.connect(self._onPrintersChanged)
|
self.printersChanged.connect(self._onPrintersChanged)
|
||||||
Application.getInstance().getOutputDeviceManager().outputDevicesChanged.connect(self._updateUniqueConfigurations)
|
QtApplication.getInstance().getOutputDeviceManager().outputDevicesChanged.connect(self._updateUniqueConfigurations)
|
||||||
|
|
||||||
@pyqtProperty(str, notify = connectionTextChanged)
|
@pyqtProperty(str, notify = connectionTextChanged)
|
||||||
def address(self) -> str:
|
def address(self) -> str:
|
||||||
@ -160,14 +160,14 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||||||
if not self._control_view_qml_path:
|
if not self._control_view_qml_path:
|
||||||
return
|
return
|
||||||
if self._control_item is None:
|
if self._control_item is None:
|
||||||
self._control_item = Application.getInstance().createQmlComponent(self._control_view_qml_path, {"OutputDevice": self})
|
self._control_item = QtApplication.getInstance().createQmlComponent(self._control_view_qml_path, {"OutputDevice": self})
|
||||||
|
|
||||||
def _createMonitorViewFromQML(self) -> None:
|
def _createMonitorViewFromQML(self) -> None:
|
||||||
if not self._monitor_view_qml_path:
|
if not self._monitor_view_qml_path:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self._monitor_item is None:
|
if self._monitor_item is None:
|
||||||
self._monitor_item = Application.getInstance().createQmlComponent(self._monitor_view_qml_path, {"OutputDevice": self})
|
self._monitor_item = QtApplication.getInstance().createQmlComponent(self._monitor_view_qml_path, {"OutputDevice": self})
|
||||||
|
|
||||||
## Attempt to establish connection
|
## Attempt to establish connection
|
||||||
def connect(self) -> None:
|
def connect(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user