Cura/plugins/UM3NetworkPrinting/src/Messages/LegacyDeviceNoLongerSupportedMessage.py
jelle Spijker b6665f1142
Applied review comments
Contributes to CURA-8418
2021-07-28 11:32:29 +02:00

34 lines
1.3 KiB
Python

# Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from UM import i18nCatalog
from UM.Message import Message
I18N_CATALOG = i18nCatalog("cura")
class LegacyDeviceNoLongerSupportedMessage(Message):
"""Message shown when trying to connect to a legacy printer device."""
__is_visible = False
"""Singleton used to prevent duplicate messages of this type at the same time."""
def __init__(self) -> None:
super().__init__(
text = I18N_CATALOG.i18nc("@info:status", "You are attempting to connect to a printer that is not "
"running Ultimaker Connect. Please update the printer to the "
"latest firmware."),
title = I18N_CATALOG.i18nc("@info:title", "Update your printer"),
lifetime = 10,
message_type = Message.MessageType.WARNING
)
def show(self) -> None:
if LegacyDeviceNoLongerSupportedMessage.__is_visible:
return
super().show()
LegacyDeviceNoLongerSupportedMessage.__is_visible = True
def hide(self, send_signal = True) -> None:
super().hide(send_signal)
LegacyDeviceNoLongerSupportedMessage.__is_visible = False