Merge pull request #5791 from Ultimaker/CURA-6490_fix_ppa_attempt2

CURA-6490 Fix settings attempt 2
This commit is contained in:
Remco Burema 2019-06-05 13:07:47 +02:00 committed by GitHub
commit 7aa17da536
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 3 deletions

View file

@ -29,7 +29,7 @@ SettingItem
// 4: variant
// 5: machine
var value
if ((base.resolve != "None") && (stackLevel != 0) && (stackLevel != 1))
if ((base.resolve !== undefined && base.resolve != "None") && (stackLevel != 0) && (stackLevel != 1))
{
// We have a resolve function. Indicates that the setting is not settable per extruder and that
// we have to choose between the resolved value (default) and the global value

View file

@ -54,7 +54,7 @@ SettingItem
{
// FIXME this needs to go away once 'resolve' is combined with 'value' in our data model.
var value = undefined
if ((base.resolve != "None") && (base.stackLevel != 0) && (base.stackLevel != 1))
if ((base.resolve !== undefined && base.resolve != "None") && (base.stackLevel != 0) && (base.stackLevel != 1))
{
// We have a resolve function. Indicates that the setting is not settable per extruder and that
// we have to choose between the resolved value (default) and the global value

View file

@ -36,6 +36,20 @@ Item
property var resolve: Cura.MachineManager.activeStackId !== Cura.MachineManager.activeMachineId ? propertyProvider.properties.resolve : "None"
property var stackLevels: propertyProvider.stackLevels
property var stackLevel: stackLevels[0]
// A list of stack levels that will trigger to show the revert button
property var showRevertStackLevels: [0]
property bool resetButtonVisible: {
var is_revert_stack_level = false;
for (var i in base.showRevertStackLevels)
{
if (base.stackLevel == i)
{
is_revert_stack_level = true
break
}
}
return is_revert_stack_level && base.showRevertButton
}
signal focusReceived()
signal setActiveFocusToNextSetting(bool forward)
@ -184,7 +198,7 @@ Item
{
id: revertButton
visible: base.stackLevel == 0 && base.showRevertButton
visible: base.resetButtonVisible
height: parent.height
width: height