Updated message with message types

Contributes to CURA-8418
This commit is contained in:
Jelle Spijker 2021-07-28 08:45:42 +02:00
parent 900db57f0f
commit 2263969d5f
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
26 changed files with 136 additions and 82 deletions

View file

@ -93,7 +93,9 @@ class RemovableDriveOutputDevice(OutputDevice):
job.progress.connect(self._onProgress)
job.finished.connect(self._onFinished)
message = Message(catalog.i18nc("@info:progress Don't translate the XML tags <filename>!", "Saving to Removable Drive <filename>{0}</filename>").format(self.getName()), 0, False, -1, catalog.i18nc("@info:title", "Saving"))
message = Message(catalog.i18nc("@info:progress Don't translate the XML tags <filename>!",
"Saving to Removable Drive <filename>{0}</filename>").format(self.getName()),
0, False, -1, catalog.i18nc("@info:title", "Saving"))
message.show()
self.writeStarted.emit(self)
@ -153,7 +155,9 @@ class RemovableDriveOutputDevice(OutputDevice):
message.show()
self.writeSuccess.emit(self)
else:
message = Message(catalog.i18nc("@info:status", "Could not save to removable drive {0}: {1}").format(self.getName(), str(job.getError())),
message = Message(catalog.i18nc("@info:status",
"Could not save to removable drive {0}: {1}").format(self.getName(),
str(job.getError())),
title = catalog.i18nc("@info:title", "Error"),
message_type = Message.MessageType.ERROR)
message.show()
@ -164,8 +168,12 @@ class RemovableDriveOutputDevice(OutputDevice):
if action == "eject":
if Application.getInstance().getOutputDeviceManager().getOutputDevicePlugin("RemovableDriveOutputDevice").ejectDevice(self):
message.hide()
eject_message = Message(catalog.i18nc("@info:status", "Ejected {0}. You can now safely remove the drive.").format(self.getName()), title = catalog.i18nc("@info:title", "Safely Remove Hardware"))
eject_message = Message(catalog.i18nc("@info:status",
"Ejected {0}. You can now safely remove the drive.").format(self.getName()),
title = catalog.i18nc("@info:title", "Safely Remove Hardware"))
else:
eject_message = Message(catalog.i18nc("@info:status", "Failed to eject {0}. Another program may be using the drive.").format(self.getName()), title = catalog.i18nc("@info:title", "Warning"))
eject_message = Message(catalog.i18nc("@info:status",
"Failed to eject {0}. Another program may be using the drive.").format(self.getName()),
title = catalog.i18nc("@info:title", "Warning"),
message_type = Message.MessageType.ERROR)
eject_message.show()