Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Diego Prado Gesto 2018-03-20 11:42:49 +01:00
commit 9b3a1b4056
4 changed files with 25 additions and 21 deletions

View file

@ -13,7 +13,7 @@ Item {
id: base
property bool activity: CuraApplication.platformActivity
property string fileBaseName: ""
property string fileBaseName: PrintInformation.baseName
UM.I18nCatalog { id: catalog; name:"cura"}
@ -24,26 +24,17 @@ Item {
target: backgroundItem
onHasMesh:
{
if (base.fileBaseName == "")
if (PrintInformation.baseName == "")
{
base.fileBaseName = name;
PrintInformation.baseName = name;
}
}
}
onActivityChanged: {
if (activity == true && base.fileBaseName == ''){
//this only runs when you open a file from the terminal (or something that works the same way; for example when you drag a file on the icon in MacOS or use 'open with' on Windows)
base.fileBaseName = PrintInformation.baseName; //get the fileBaseName from PrintInformation.py because this saves the filebase when the file is opened using the terminal (or something alike)
PrintInformation.setBaseName(base.fileBaseName);
}
if (activity == true && base.fileBaseName != ''){
//this runs in all other cases where there is a mesh on the buildplate (activity == true). It uses the fileBaseName from the hasMesh signal
PrintInformation.setBaseName(base.fileBaseName);
}
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)
PrintInformation.setBaseName('')
PrintInformation.baseName = ''
}
}