mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Fix: filenames cut by first dot, remove only file extension because file might have dot in name
CURA-5323
This commit is contained in:
parent
24684d5d9c
commit
b1c9b04a7a
2 changed files with 9 additions and 14 deletions
|
@ -335,8 +335,15 @@ class PrintInformation(QObject):
|
||||||
# name is "" when I first had some meshes and afterwards I deleted them so the naming should start again
|
# name is "" when I first had some meshes and afterwards I deleted them so the naming should start again
|
||||||
is_empty = name == ""
|
is_empty = name == ""
|
||||||
if is_gcode or is_project_file or (is_empty or (self._base_name == "" and self._base_name != name)):
|
if is_gcode or is_project_file or (is_empty or (self._base_name == "" and self._base_name != name)):
|
||||||
# Only take the file name part
|
# Only take the file name part, Note : file name might have 'dot' in name as well
|
||||||
self._base_name = filename_parts[0]
|
if is_project_file:
|
||||||
|
self._base_name = ".".join(filename_parts)
|
||||||
|
elif len(filename_parts) > 1:
|
||||||
|
self._base_name = ".".join(filename_parts[0:-1])
|
||||||
|
else:
|
||||||
|
self._base_name = filename_parts[0]
|
||||||
|
|
||||||
|
|
||||||
self._updateJobName()
|
self._updateJobName()
|
||||||
|
|
||||||
@pyqtProperty(str, fset = setBaseName, notify = baseNameChanged)
|
@pyqtProperty(str, fset = setBaseName, notify = baseNameChanged)
|
||||||
|
|
|
@ -19,18 +19,6 @@ Item {
|
||||||
|
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
Connections
|
|
||||||
{
|
|
||||||
target: backgroundItem
|
|
||||||
onHasMesh:
|
|
||||||
{
|
|
||||||
if (PrintInformation.baseName == "")
|
|
||||||
{
|
|
||||||
PrintInformation.baseName = name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onActivityChanged: {
|
onActivityChanged: {
|
||||||
if (activity == false) {
|
if (activity == false) {
|
||||||
//When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file)
|
//When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue