mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:15:51 +08:00
Merge branch '2.3'
This commit is contained in:
commit
e3ae3d50f9
@ -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))}
|
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!
|
if profile_or_list: # Success!
|
||||||
name_seed = os.path.splitext(os.path.basename(file_name))[0]
|
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:
|
if type(profile_or_list) is not list:
|
||||||
profile = profile_or_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()) }
|
return { "status": "ok", "message": catalog.i18nc("@info:status", "Successfully imported profile {0}", profile.getName()) }
|
||||||
else:
|
else:
|
||||||
profile_index = -1
|
profile_index = -1
|
||||||
global_profile = None
|
global_profile = None
|
||||||
|
|
||||||
new_name = self.uniqueName(name_seed)
|
|
||||||
|
|
||||||
for profile in profile_or_list:
|
for profile in profile_or_list:
|
||||||
if profile_index >= 0:
|
if profile_index >= 0:
|
||||||
if len(machine_extruders) > profile_index:
|
if len(machine_extruders) > profile_index:
|
||||||
|
@ -50,8 +50,11 @@ class ExtruderManager(QObject):
|
|||||||
@pyqtProperty(int, notify = extrudersChanged)
|
@pyqtProperty(int, notify = extrudersChanged)
|
||||||
def extruderCount(self):
|
def extruderCount(self):
|
||||||
if not UM.Application.getInstance().getGlobalContainerStack():
|
if not UM.Application.getInstance().getGlobalContainerStack():
|
||||||
return 0 # No active machine, so no extruders.
|
return 0 # No active machine, so no extruders.
|
||||||
return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
|
try:
|
||||||
|
return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
|
||||||
|
except KeyError:
|
||||||
|
return 0
|
||||||
|
|
||||||
@pyqtProperty("QVariantMap", notify=extrudersChanged)
|
@pyqtProperty("QVariantMap", notify=extrudersChanged)
|
||||||
def extruderIds(self):
|
def extruderIds(self):
|
||||||
|
@ -56,6 +56,8 @@ class ProfilesModel(InstanceContainersModel):
|
|||||||
machine_manager = Application.getInstance().getMachineManager()
|
machine_manager = Application.getInstance().getMachineManager()
|
||||||
|
|
||||||
unit = global_container_stack.getBottom().getProperty("layer_height", "unit")
|
unit = global_container_stack.getBottom().getProperty("layer_height", "unit")
|
||||||
|
if not unit:
|
||||||
|
unit = ""
|
||||||
|
|
||||||
for item in super()._recomputeItems():
|
for item in super()._recomputeItems():
|
||||||
profile = container_registry.findContainers(id = item["id"])
|
profile = container_registry.findContainers(id = item["id"])
|
||||||
@ -80,7 +82,10 @@ class ProfilesModel(InstanceContainersModel):
|
|||||||
quality = quality_result["quality"]
|
quality = quality_result["quality"]
|
||||||
break
|
break
|
||||||
else: #No global container stack in the results:
|
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"):
|
if quality and quality.hasProperty("layer_height", "value"):
|
||||||
item["layer_height"] = str(quality.getProperty("layer_height", "value")) + unit
|
item["layer_height"] = str(quality.getProperty("layer_height", "value")) + unit
|
||||||
yield item
|
yield item
|
||||||
|
@ -194,7 +194,6 @@ Item {
|
|||||||
// Inherit button needs to be visible if;
|
// Inherit button needs to be visible if;
|
||||||
// - User made changes that override any loaded settings
|
// - User made changes that override any loaded settings
|
||||||
// - This setting item uses inherit button at all
|
// - 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)
|
// - The type of the value of any deeper container is an "object" (eg; is a function)
|
||||||
visible:
|
visible:
|
||||||
{
|
{
|
||||||
@ -203,12 +202,6 @@ Item {
|
|||||||
return false;
|
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)
|
if(globalPropertyProvider.properties.limit_to_extruder == null || globalPropertyProvider.properties.limit_to_extruder == -1)
|
||||||
{
|
{
|
||||||
return Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0;
|
return Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user