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:
authorKonstantinos Karmas <konskarm@gmail.com>2021-09-15 13:26:30 +0300
committerKonstantinos Karmas <konskarm@gmail.com>2021-09-15 13:26:30 +0300
commit52c224c779eb5214f419e7956db96d53bb752508 (patch)
tree23745e15744a4bf32de6c131909daa14847de610 /cura/UI
parent87add2c8def1c31ce059d689fb727157c680315c (diff)
Revert "Revert "Only change project name when saving to project files.""
This reverts commit 9e2b556ce8f28294f9b44a3d8801af42043d3956.
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)