Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cura/UI
diff options
context:
space:
mode:
authorRemco Burema <r.burema@ultimaker.com>2021-09-01 19:11:10 +0300
committerRemco Burema <r.burema@ultimaker.com>2021-09-01 19:11:10 +0300
commitb97920e5b155caaab6a8b3bb167853a00ae4b604 (patch)
tree2fdab540d3eb4ef4692ace3d264700c62ae15393 /cura/UI
parentc2c53d51c1954315324982bd916b8aad5c19946d (diff)
Only change project name when saving to project files.
CURA-8358
Diffstat (limited to 'cura/UI')
-rw-r--r--cura/UI/PrintInformation.py16
1 files changed, 9 insertions, 7 deletions
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)