Display an appropriate tooltip when device is removed from the account

The tooltip is updated to reflect the case where a cloud printer is
removed from the users account.

CURA-7438
This commit is contained in:
Kostas Karmas 2020-06-04 15:08:27 +02:00
parent ee7f2d4b38
commit 4bebaaaddb
2 changed files with 13 additions and 1 deletions

View file

@ -490,6 +490,11 @@ class MachineManager(QObject):
def activeMachineIsGroup(self) -> bool:
return bool(self._printer_output_devices) and len(self._printer_output_devices[0].printers) > 1
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineIsLinkedToCurrentAccount(self) -> bool:
from plugins.UM3NetworkPrinting.src.Cloud.CloudOutputDeviceManager import META_REMOVED_FROM_ACCOUNT
return not self.activeMachine.getMetaDataEntry(META_REMOVED_FROM_ACCOUNT, False)
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineHasNetworkConnection(self) -> bool:
# A network connection is only available if any output device is actually a network connected device.

View file

@ -41,10 +41,17 @@ Cura.ExpandablePopup
if(Cura.API.connectionStatus.isInternetReachable)
{
if (Cura.API.account.isLoggedIn)
{
if (Cura.MachineManager.activeMachineIsLinkedToCurrentAccount)
{
return catalog.i18nc("@status", "The cloud printer is offline. Please check if the printer is turned on and connected to the internet.")
}
else
{
return catalog.i18nc("@status", "This printer is not linked to your account. Please visit the Ultimaker Digital Factory to establish a connection.")
}
}
else
{
return catalog.i18nc("@status", "The cloud connection is currently unavailable. Please sign in to connect to the cloud printer.")
}