mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 06:08:58 +08:00
Show warning icon on import non-visible profile.
part of CURA-7691
This commit is contained in:
parent
0524e8d129
commit
3fcd7d567f
@ -179,7 +179,7 @@ class CuraContainerRegistry(ContainerRegistry):
|
|||||||
"""Imports a profile from a file
|
"""Imports a profile from a file
|
||||||
|
|
||||||
:param file_name: The full path and filename of the profile to import.
|
:param file_name: The full path and filename of the profile to import.
|
||||||
:return: Dict with a 'status' key containing the string 'ok' or 'error',
|
:return: Dict with a 'status' key containing the string 'ok', 'warning' or 'error',
|
||||||
and a 'message' key containing a message for the user.
|
and a 'message' key containing a message for the user.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -338,10 +338,12 @@ class CuraContainerRegistry(ContainerRegistry):
|
|||||||
"Failed to import profile from <filename>{0}</filename>:",
|
"Failed to import profile from <filename>{0}</filename>:",
|
||||||
file_name) + " " + message}
|
file_name) + " " + message}
|
||||||
profile_ids_added.append(profile.getId())
|
profile_ids_added.append(profile.getId())
|
||||||
|
result_status = "ok"
|
||||||
success_message = catalog.i18nc("@info:status", "Successfully imported profile {0}.", profile_or_list[0].getName())
|
success_message = catalog.i18nc("@info:status", "Successfully imported profile {0}.", profile_or_list[0].getName())
|
||||||
if additional_message:
|
if additional_message:
|
||||||
|
result_status = "warning"
|
||||||
success_message += additional_message
|
success_message += additional_message
|
||||||
return {"status": "ok", "message": success_message}
|
return {"status": result_status, "message": success_message}
|
||||||
|
|
||||||
# This message is throw when the profile reader doesn't find any profile in the file
|
# This message is throw when the profile reader doesn't find any profile in the file
|
||||||
return {"status": "error", "message": catalog.i18nc("@info:status", "File {0} does not contain any valid profile.", file_name)}
|
return {"status": "error", "message": catalog.i18nc("@info:status", "File {0} does not contain any valid profile.", file_name)}
|
||||||
|
@ -313,7 +313,7 @@ Item
|
|||||||
{
|
{
|
||||||
messageDialog.icon = StandardIcon.Information;
|
messageDialog.icon = StandardIcon.Information;
|
||||||
}
|
}
|
||||||
else if (result.status == "duplicate")
|
else if (result.status == "warning" || result.status == "duplicate")
|
||||||
{
|
{
|
||||||
messageDialog.icon = StandardIcon.Warning;
|
messageDialog.icon = StandardIcon.Warning;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user