From 3fcd7d567f16fa10126a9b798fce2df51c9fa43d Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 16 Sep 2020 08:26:41 +0200 Subject: [PATCH] Show warning icon on import non-visible profile. part of CURA-7691 --- cura/Settings/CuraContainerRegistry.py | 6 ++++-- resources/qml/Preferences/ProfilesPage.qml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cura/Settings/CuraContainerRegistry.py b/cura/Settings/CuraContainerRegistry.py index 5be59324f0..2527d761bd 100644 --- a/cura/Settings/CuraContainerRegistry.py +++ b/cura/Settings/CuraContainerRegistry.py @@ -179,7 +179,7 @@ class CuraContainerRegistry(ContainerRegistry): """Imports a profile from a file :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. """ @@ -338,10 +338,12 @@ class CuraContainerRegistry(ContainerRegistry): "Failed to import profile from {0}:", file_name) + " " + message} profile_ids_added.append(profile.getId()) + result_status = "ok" success_message = catalog.i18nc("@info:status", "Successfully imported profile {0}.", profile_or_list[0].getName()) if additional_message: + result_status = "warning" 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 return {"status": "error", "message": catalog.i18nc("@info:status", "File {0} does not contain any valid profile.", file_name)} diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index fdb961ad21..5ee6dc32ce 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -313,7 +313,7 @@ Item { messageDialog.icon = StandardIcon.Information; } - else if (result.status == "duplicate") + else if (result.status == "warning" || result.status == "duplicate") { messageDialog.icon = StandardIcon.Warning; }