Added a pyQtProperty to validate user settings (Might be wrong approach)

CURA-4333
This commit is contained in:
A.Sasin 2017-10-12 21:23:17 +02:00
parent 39891551e3
commit 16bd4430e4
3 changed files with 32 additions and 22 deletions

View file

@ -20,13 +20,10 @@ Item
property variant minimumPrintTime: PrintInformation.minimumPrintTime;
property variant maximumPrintTime: PrintInformation.maximumPrintTime;
property bool settingsEnabled: ExtruderManager.activeExtruderStackId || machineExtruderCount.properties.value == 1
property bool hasUserSettings;
property var profileChangedCheckSkipKeys: ["support_enable" ,
"infill_sparse_density",
"gradual_infill_steps",
"adhesion_type",
"support_extruder_nr"]
property bool hasUserSettings: Cura.MachineManager.userCustomSettingsProperty
property var tickClickedViaProfileSlider: undefined
Component.onCompleted: PrintInformation.enabled = true
@ -41,17 +38,9 @@ Item
}
}
Connections
{
target: CuraApplication
onSidebarSimpleDiscardOrKeepProfileChanges:
{
base.checkUserSettings();
}
}
function checkUserSettings() {
hasUserSettings = Cura.MachineManager.hasUserCustomSettings(profileChangedCheckSkipKeys);
Cura.MachineManager.checkWhetherUserContainersHaveSettings()
if (!hasUserSettings && tickClickedViaProfileSlider != undefined)
{
Cura.MachineManager.setActiveQuality(Cura.ProfilesModel.getItem(tickClickedViaProfileSlider).id);