Update messages to use the message_types

CURA-8418
This commit is contained in:
Jaime van Kessel 2021-07-27 11:54:43 +02:00
parent f11079adcf
commit 900db57f0f
No known key found for this signature in database
GPG key ID: 3710727397403C91
23 changed files with 81 additions and 39 deletions

View file

@ -119,7 +119,7 @@ class Backup:
def _showMessage(self, message: str) -> None:
"""Show a UI message."""
Message(message, title=self.catalog.i18nc("@info:title", "Backup"), lifetime=30).show()
Message(message, title=self.catalog.i18nc("@info:title", "Backup")).show()
def restore(self) -> bool:
"""Restore this back-up.
@ -154,7 +154,10 @@ class Backup:
archive = ZipFile(io.BytesIO(self.zip_file), "r")
except LookupError as e:
Logger.log("d", f"The following error occurred while trying to restore a Cura backup: {str(e)}")
self._showMessage(self.catalog.i18nc("@info:backup_failed", "The following error occurred while trying to restore a Cura backup:") + str(e))
Message(self.catalog.i18nc("@info:backup_failed", "The following error occurred while trying to restore a Cura backup:") + str(e),
title = self.catalog.i18nc("@info:title", "Backup"),
message_type = Message.MessageType.ERROR).show()
return False
extracted = self._extractArchive(archive, version_data_dir)