From 5cd464c5de7a33745fd71f02fdd9dc98c5837b28 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 12 Jun 2018 16:35:46 +0200 Subject: [PATCH] CURA-5330 Fix some typing issues in QualityProfilesDropDownMenuModel and SettingInheritanceManager. --- cura/Machines/Models/QualityProfilesDropDownMenuModel.py | 2 ++ cura/Settings/SettingInheritanceManager.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/Machines/Models/QualityProfilesDropDownMenuModel.py b/cura/Machines/Models/QualityProfilesDropDownMenuModel.py index 62e8c638e3..ec8236e887 100644 --- a/cura/Machines/Models/QualityProfilesDropDownMenuModel.py +++ b/cura/Machines/Models/QualityProfilesDropDownMenuModel.py @@ -94,6 +94,8 @@ class QualityProfilesDropDownMenuModel(ListModel): default_layer_height = global_stack.definition.getProperty("layer_height", "value") # Get layer_height from the quality profile for the GlobalStack + if quality_group.node_for_global is None: + return float(default_layer_height) container = quality_group.node_for_global.getContainer() layer_height = default_layer_height diff --git a/cura/Settings/SettingInheritanceManager.py b/cura/Settings/SettingInheritanceManager.py index 7cbfbcfda1..6d4176ebf1 100644 --- a/cura/Settings/SettingInheritanceManager.py +++ b/cura/Settings/SettingInheritanceManager.py @@ -1,5 +1,6 @@ # Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from typing import List from PyQt5.QtCore import QObject, QTimer, pyqtProperty, pyqtSignal from UM.FlameProfiler import pyqtSlot @@ -13,6 +14,7 @@ from UM.Logger import Logger # speed settings. If all the children of print_speed have a single value override, changing the speed won't # actually do anything, as only the 'leaf' settings are used by the engine. from UM.Settings.ContainerStack import ContainerStack +from UM.Settings.Interfaces import ContainerInterface from UM.Settings.SettingFunction import SettingFunction from UM.Settings.SettingInstance import InstanceState @@ -157,7 +159,7 @@ class SettingInheritanceManager(QObject): stack = self._active_container_stack if not stack: #No active container stack yet! return False - containers = [] + containers = [] # type: List[ContainerInterface] ## Check if the setting has a user state. If not, it is never overwritten. has_user_state = stack.getProperty(key, "state") == InstanceState.User