From 527de2b6ef4ac47855d54ecea295d4d5b8d3fb35 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 5 Oct 2021 10:20:52 +0200 Subject: [PATCH] Use image instead of custom message type CURA-8601 --- .../resources/svg/CloudPlatform.svg | 353 ++++++++++++++++++ .../src/Messages/CloudFlowMessage.py | 7 +- resources/themes/cura-light/theme.json | 2 +- 3 files changed, 359 insertions(+), 3 deletions(-) create mode 100644 plugins/UM3NetworkPrinting/resources/svg/CloudPlatform.svg diff --git a/plugins/UM3NetworkPrinting/resources/svg/CloudPlatform.svg b/plugins/UM3NetworkPrinting/resources/svg/CloudPlatform.svg new file mode 100644 index 0000000000..5da9f17bbf --- /dev/null +++ b/plugins/UM3NetworkPrinting/resources/svg/CloudPlatform.svg @@ -0,0 +1,353 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/UM3NetworkPrinting/src/Messages/CloudFlowMessage.py b/plugins/UM3NetworkPrinting/src/Messages/CloudFlowMessage.py index 692b52a0ba..3ef5a6bf43 100644 --- a/plugins/UM3NetworkPrinting/src/Messages/CloudFlowMessage.py +++ b/plugins/UM3NetworkPrinting/src/Messages/CloudFlowMessage.py @@ -16,12 +16,15 @@ I18N_CATALOG = i18nCatalog("cura") class CloudFlowMessage(Message): def __init__(self, printer_name: str) -> None: - + image_path = os.path.join( + CuraApplication.getInstance().getPluginRegistry().getPluginPath("UM3NetworkPrinting") or "", + "resources", "svg", "CloudPlatform.svg" + ) super().__init__( text=I18N_CATALOG.i18nc("@info:status", f"Your printer {printer_name} could be connected via cloud.\n Manage your print queue and monitor your prints from anywhere connecting your printer to Digital Factory"), title=I18N_CATALOG.i18nc("@info:title", "Are you ready for cloud printing?"), - message_type=Message.MessageType.CLOUD + image_source=QUrl.fromLocalFile(image_path) ) self._printer_name = printer_name self.addAction("get_started", I18N_CATALOG.i18nc("@action", "Get started"), "", "") diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index daa12b3390..78676da926 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -626,7 +626,7 @@ "message_close": [1, 1], "message_radius": [0.25, 0.25], "message_action_button": [0, 2.5], - "message_image": [15.0, 5.0], + "message_image": [15.0, 10.0], "message_type_icon": [2, 2], "infill_button_margin": [0.5, 0.5],