mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
Merge branch '2.3'
This commit is contained in:
commit
e3ae3d50f9
4 changed files with 13 additions and 13 deletions
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue