|
@@ -1,4 +1,4 @@
|
|
|
-# Copyright (c) 2018 Ultimaker B.V.
|
|
|
+# Copyright (c) 2022 Ultimaker B.V.
|
|
|
# Cura is released under the terms of the LGPLv3 or higher.
|
|
|
|
|
|
from typing import Optional, TYPE_CHECKING, List
|
|
@@ -6,6 +6,8 @@ from typing import Optional, TYPE_CHECKING, List
|
|
|
from PyQt6.QtCore import pyqtSignal, pyqtProperty, QObject, pyqtSlot, QUrl
|
|
|
from PyQt6.QtGui import QImage
|
|
|
|
|
|
+from cura.CuraApplication import CuraApplication
|
|
|
+
|
|
|
if TYPE_CHECKING:
|
|
|
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
|
|
|
from cura.PrinterOutput.Models.PrinterOutputModel import PrinterOutputModel
|
|
@@ -86,6 +88,13 @@ class PrintJobOutputModel(QObject):
|
|
|
self._owner = owner
|
|
|
self.ownerChanged.emit()
|
|
|
|
|
|
+ @pyqtProperty(bool, notify = ownerChanged)
|
|
|
+ def isMine(self) -> bool:
|
|
|
+ """
|
|
|
+ Returns whether this print job was sent by the currently logged in user.
|
|
|
+ """
|
|
|
+ return self._owner == CuraApplication.getInstance().getCuraAPI().account.userName
|
|
|
+
|
|
|
@pyqtProperty(QObject, notify=assignedPrinterChanged)
|
|
|
def assignedPrinter(self):
|
|
|
return self._assigned_printer
|