mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 22:39:02 +08:00
Revert "Revert "Only change project name when saving to project files.""
This reverts commit 9e2b556ce8f28294f9b44a3d8801af42043d3956.
This commit is contained in:
parent
87add2c8de
commit
52c224c779
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user