Merge branch '2.3'

This commit is contained in:
Ghostkeeper 2016-10-25 11:50:20 +02:00
commit e3ae3d50f9
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
4 changed files with 13 additions and 13 deletions

View file

@ -169,16 +169,15 @@ class CuraContainerRegistry(ContainerRegistry):
return { "status": "error", "message": catalog.i18nc("@info:status", "Failed to import profile from <filename>{0}</filename>: <message>{1}</message>", file_name, str(e))}
if profile_or_list: # Success!
name_seed = os.path.splitext(os.path.basename(file_name))[0]
new_name = self.uniqueName(name_seed)
if type(profile_or_list) is not list:
profile = profile_or_list
self._configureProfile(profile, name_seed)
self._configureProfile(profile, name_seed, new_name)
return { "status": "ok", "message": catalog.i18nc("@info:status", "Successfully imported profile {0}", profile.getName()) }
else:
profile_index = -1
global_profile = None
new_name = self.uniqueName(name_seed)
for profile in profile_or_list:
if profile_index >= 0:
if len(machine_extruders) > profile_index:

View file

@ -50,8 +50,11 @@ class ExtruderManager(QObject):
@pyqtProperty(int, notify = extrudersChanged)
def extruderCount(self):
if not UM.Application.getInstance().getGlobalContainerStack():
return 0 # No active machine, so no extruders.
return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
return 0 # No active machine, so no extruders.
try:
return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
except KeyError:
return 0
@pyqtProperty("QVariantMap", notify=extrudersChanged)
def extruderIds(self):

View file

@ -56,6 +56,8 @@ class ProfilesModel(InstanceContainersModel):
machine_manager = Application.getInstance().getMachineManager()
unit = global_container_stack.getBottom().getProperty("layer_height", "unit")
if not unit:
unit = ""
for item in super()._recomputeItems():
profile = container_registry.findContainers(id = item["id"])
@ -80,7 +82,10 @@ class ProfilesModel(InstanceContainersModel):
quality = quality_result["quality"]
break
else: #No global container stack in the results:
quality = quality_results[0]["quality"] #Take any of the extruders.
if quality_results:
quality = quality_results[0]["quality"] #Take any of the extruders.
else:
quality = None
if quality and quality.hasProperty("layer_height", "value"):
item["layer_height"] = str(quality.getProperty("layer_height", "value")) + unit
yield item

View file

@ -194,7 +194,6 @@ Item {
// Inherit button needs to be visible if;
// - User made changes that override any loaded settings
// - This setting item uses inherit button at all
// - The revert button is not visible.
// - The type of the value of any deeper container is an "object" (eg; is a function)
visible:
{
@ -203,12 +202,6 @@ Item {
return false;
}
if(revertButton.visible)
{
// The revert button already indicates there is a custom value for this setting, making this button superfluous.
return false;
}
if(globalPropertyProvider.properties.limit_to_extruder == null || globalPropertyProvider.properties.limit_to_extruder == -1)
{
return Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0;