Only set the lastOutputName if the SDK is high enough

This ensures that the DF plugin is backwards compatible

CURA-8358
This commit is contained in:
Jaime van Kessel 2021-09-14 14:43:10 +02:00
parent 8ed2e7bd44
commit c593f62271
2 changed files with 8 additions and 3 deletions

View file

@ -603,8 +603,8 @@ class DigitalFactoryController(QObject):
self._saveFileToSelectedProjectHelper(filename, formats)
def _saveFileToSelectedProjectHelper(self, filename: str, formats: List[str]) -> None:
# Indicate we have started sending a job.
self.uploadStarted.emit()
# Indicate we have started sending a job (and propagate any user file name changes back to the open project)
self.uploadStarted.emit(filename if "3mf" in formats else None)
library_project_id = self._project_model.items[self._selected_project_idx]["libraryProjectId"]
library_project_name = self._project_model.items[self._selected_project_idx]["displayName"]

View file

@ -8,6 +8,8 @@ from UM.Logger import Logger
from UM.OutputDevice import OutputDeviceError
from UM.OutputDevice.ProjectOutputDevice import ProjectOutputDevice
from UM.Scene.SceneNode import SceneNode
from UM.Version import Version
from cura import ApplicationMetadata
from cura.API import Account
from cura.CuraApplication import CuraApplication
from .DigitalFactoryController import DigitalFactoryController
@ -105,8 +107,11 @@ class DigitalFactoryOutputDevice(ProjectOutputDevice):
self.enabled = logged_in and self._controller.userAccountHasLibraryAccess()
self.enabledChanged.emit()
def _onWriteStarted(self) -> None:
def _onWriteStarted(self, new_name: Optional[str] = None) -> None:
self._writing = True
if new_name and Version(ApplicationMetadata.CuraSDKVersion) >= Version("7.7.0"):
# setLastOutputName is only supported sdk version 7.7.0 and up
self.setLastOutputName(new_name)
self.writeStarted.emit(self)
def _onWriteFinished(self) -> None: