From b97920e5b155caaab6a8b3bb167853a00ae4b604 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 1 Sep 2021 18:11:10 +0200 Subject: Only change project name when saving to project files. CURA-8358 --- cura/UI/PrintInformation.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'cura/UI') diff --git a/cura/UI/PrintInformation.py b/cura/UI/PrintInformation.py index 9640326c91..2bbd12c69f 100644 --- a/cura/UI/PrintInformation.py +++ b/cura/UI/PrintInformation.py @@ -13,7 +13,8 @@ from UM.Qt.Duration import Duration from UM.Scene.SceneNode import SceneNode from UM.i18n import i18nCatalog from UM.MimeTypeDatabase import MimeTypeDatabase, MimeTypeNotFoundError -from UM.OutputDevice import OutputDevice +from UM.OutputDevice.OutputDevice import OutputDevice +from UM.OutputDevice.ProjectOutputDevice import ProjectOutputDevice if TYPE_CHECKING: from cura.CuraApplication import CuraApplication @@ -445,9 +446,10 @@ class PrintInformation(QObject): def _onOutputStart(self, output_device: OutputDevice) -> None: """If this is the sort of output 'device' (like local or online file storage, rather than a printer), the user could have altered the file-name, and thus the project name should be altered as well.""" - new_name = output_device.getLastOutputName() - if new_name is not None: - if len(os.path.dirname(new_name)) > 0: - self.setProjectName(new_name) - else: - self.setJobName(new_name) + if isinstance(output_device, ProjectOutputDevice): + new_name = output_device.getLastOutputName() + if new_name is not None: + if len(os.path.dirname(new_name)) > 0: + self.setProjectName(new_name) + else: + self.setJobName(new_name) -- cgit v1.2.3