mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Updated message with message types
Contributes to CURA-8418
This commit is contained in:
parent
900db57f0f
commit
2263969d5f
26 changed files with 136 additions and 82 deletions
|
@ -147,6 +147,8 @@ class ArrangeObjectsAllBuildPlatesJob(Job):
|
||||||
status_message.hide()
|
status_message.hide()
|
||||||
|
|
||||||
if not found_solution_for_all:
|
if not found_solution_for_all:
|
||||||
no_full_solution_message = Message(i18n_catalog.i18nc("@info:status", "Unable to find a location within the build volume for all objects"),
|
no_full_solution_message = Message(i18n_catalog.i18nc("@info:status",
|
||||||
title = i18n_catalog.i18nc("@info:title", "Can't Find Location"))
|
"Unable to find a location within the build volume for all objects"),
|
||||||
|
title = i18n_catalog.i18nc("@info:title", "Can't Find Location"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
no_full_solution_message.show()
|
no_full_solution_message.show()
|
||||||
|
|
|
@ -40,6 +40,6 @@ class ArrangeObjectsJob(Job):
|
||||||
i18n_catalog.i18nc("@info:status",
|
i18n_catalog.i18nc("@info:status",
|
||||||
"Unable to find a location within the build volume for all objects"),
|
"Unable to find a location within the build volume for all objects"),
|
||||||
title = i18n_catalog.i18nc("@info:title", "Can't Find Location"),
|
title = i18n_catalog.i18nc("@info:title", "Can't Find Location"),
|
||||||
message_type = Message.MessageType.WARNING)
|
message_type = Message.MessageType.ERROR)
|
||||||
no_full_solution_message.show()
|
no_full_solution_message.show()
|
||||||
self.finished.emit(self)
|
self.finished.emit(self)
|
||||||
|
|
|
@ -111,15 +111,15 @@ class Backup:
|
||||||
return archive
|
return archive
|
||||||
except (IOError, OSError, BadZipfile) as error:
|
except (IOError, OSError, BadZipfile) as error:
|
||||||
Logger.log("e", "Could not create archive from user data directory: %s", error)
|
Logger.log("e", "Could not create archive from user data directory: %s", error)
|
||||||
self._showMessage(
|
self._showMessage(self.catalog.i18nc("@info:backup_failed",
|
||||||
self.catalog.i18nc("@info:backup_failed",
|
"Could not create archive from user data directory: {}".format(error)),
|
||||||
"Could not create archive from user data directory: {}".format(error)))
|
message_type = Message.MessageType.ERROR)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _showMessage(self, message: str) -> None:
|
def _showMessage(self, message: str, message_type: Message.MessageType = Message.MessageType.NEUTRAL) -> None:
|
||||||
"""Show a UI message."""
|
"""Show a UI message."""
|
||||||
|
|
||||||
Message(message, title=self.catalog.i18nc("@info:title", "Backup")).show()
|
Message(message, title=self.catalog.i18nc("@info:title", "Backup"), message_type = message_type).show()
|
||||||
|
|
||||||
def restore(self) -> bool:
|
def restore(self) -> bool:
|
||||||
"""Restore this back-up.
|
"""Restore this back-up.
|
||||||
|
@ -130,9 +130,9 @@ class Backup:
|
||||||
if not self.zip_file or not self.meta_data or not self.meta_data.get("cura_release", None):
|
if not self.zip_file or not self.meta_data or not self.meta_data.get("cura_release", None):
|
||||||
# We can restore without the minimum required information.
|
# We can restore without the minimum required information.
|
||||||
Logger.log("w", "Tried to restore a Cura backup without having proper data or meta data.")
|
Logger.log("w", "Tried to restore a Cura backup without having proper data or meta data.")
|
||||||
self._showMessage(
|
self._showMessage(self.catalog.i18nc("@info:backup_failed",
|
||||||
self.catalog.i18nc("@info:backup_failed",
|
"Tried to restore a Cura backup without having proper data or meta data."),
|
||||||
"Tried to restore a Cura backup without having proper data or meta data."))
|
message_type = Message.MessageType.ERROR)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
current_version = Version(self._application.getVersion())
|
current_version = Version(self._application.getVersion())
|
||||||
|
@ -141,9 +141,9 @@ class Backup:
|
||||||
if current_version < version_to_restore:
|
if current_version < version_to_restore:
|
||||||
# Cannot restore version newer than current because settings might have changed.
|
# Cannot restore version newer than current because settings might have changed.
|
||||||
Logger.log("d", "Tried to restore a Cura backup of version {version_to_restore} with cura version {current_version}".format(version_to_restore = version_to_restore, current_version = current_version))
|
Logger.log("d", "Tried to restore a Cura backup of version {version_to_restore} with cura version {current_version}".format(version_to_restore = version_to_restore, current_version = current_version))
|
||||||
self._showMessage(
|
self._showMessage(self.catalog.i18nc("@info:backup_failed",
|
||||||
self.catalog.i18nc("@info:backup_failed",
|
"Tried to restore a Cura backup that is higher than the current version."),
|
||||||
"Tried to restore a Cura backup that is higher than the current version."))
|
message_type = Message.MessageType.ERROR)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Get the current secrets and store since the back-up doesn't contain those
|
# Get the current secrets and store since the back-up doesn't contain those
|
||||||
|
@ -154,7 +154,8 @@ class Backup:
|
||||||
archive = ZipFile(io.BytesIO(self.zip_file), "r")
|
archive = ZipFile(io.BytesIO(self.zip_file), "r")
|
||||||
except LookupError as e:
|
except LookupError as e:
|
||||||
Logger.log("d", f"The following error occurred while trying to restore a Cura backup: {str(e)}")
|
Logger.log("d", f"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),
|
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"),
|
title = self.catalog.i18nc("@info:title", "Backup"),
|
||||||
message_type = Message.MessageType.ERROR).show()
|
message_type = Message.MessageType.ERROR).show()
|
||||||
|
|
||||||
|
|
|
@ -1798,9 +1798,10 @@ class CuraApplication(QtApplication):
|
||||||
if extension in self._non_sliceable_extensions:
|
if extension in self._non_sliceable_extensions:
|
||||||
message = Message(
|
message = Message(
|
||||||
self._i18n_catalog.i18nc("@info:status",
|
self._i18n_catalog.i18nc("@info:status",
|
||||||
"Only one G-code file can be loaded at a time. Skipped importing {0}", filename),
|
"Only one G-code file can be loaded at a time. Skipped importing {0}",
|
||||||
title = self._i18n_catalog.i18nc("@info:title", "Warning"),
|
filename),
|
||||||
message_type = Message.MessageType.WARNING)
|
title = self._i18n_catalog.i18nc("@info:title", "Warning"),
|
||||||
|
message_type = Message.MessageType.WARNING)
|
||||||
message.show()
|
message.show()
|
||||||
return
|
return
|
||||||
# If file being loaded is non-slicable file, then prevent loading of any other files
|
# If file being loaded is non-slicable file, then prevent loading of any other files
|
||||||
|
@ -1809,9 +1810,10 @@ class CuraApplication(QtApplication):
|
||||||
if extension in self._non_sliceable_extensions:
|
if extension in self._non_sliceable_extensions:
|
||||||
message = Message(
|
message = Message(
|
||||||
self._i18n_catalog.i18nc("@info:status",
|
self._i18n_catalog.i18nc("@info:status",
|
||||||
"Can't open any other file if G-code is loading. Skipped importing {0}", filename),
|
"Can't open any other file if G-code is loading. Skipped importing {0}",
|
||||||
title = self._i18n_catalog.i18nc("@info:title", "Error"),
|
filename),
|
||||||
message_type = Message.MessageType.ERROR)
|
title = self._i18n_catalog.i18nc("@info:title", "Error"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
message.show()
|
message.show()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -75,5 +75,5 @@ class MultiplyObjectsJob(Job):
|
||||||
no_full_solution_message = Message(
|
no_full_solution_message = Message(
|
||||||
i18n_catalog.i18nc("@info:status", "Unable to find a location within the build volume for all objects"),
|
i18n_catalog.i18nc("@info:status", "Unable to find a location within the build volume for all objects"),
|
||||||
title = i18n_catalog.i18nc("@info:title", "Placing Object"),
|
title = i18n_catalog.i18nc("@info:title", "Placing Object"),
|
||||||
message_type = Message.MessageType.WARNING)
|
message_type = Message.MessageType.ERROR)
|
||||||
no_full_solution_message.show()
|
no_full_solution_message.show()
|
||||||
|
|
|
@ -186,7 +186,8 @@ class AuthorizationService:
|
||||||
self._server.start(verification_code, state)
|
self._server.start(verification_code, state)
|
||||||
except OSError:
|
except OSError:
|
||||||
Logger.logException("w", "Unable to create authorization request server")
|
Logger.logException("w", "Unable to create authorization request server")
|
||||||
Message(i18n_catalog.i18nc("@info", "Unable to start a new sign in process. Check if another sign in attempt is still active."),
|
Message(i18n_catalog.i18nc("@info",
|
||||||
|
"Unable to start a new sign in process. Check if another sign in attempt is still active."),
|
||||||
title=i18n_catalog.i18nc("@info:title", "Warning"),
|
title=i18n_catalog.i18nc("@info:title", "Warning"),
|
||||||
message_type = Message.MessageType.WARNING).show()
|
message_type = Message.MessageType.WARNING).show()
|
||||||
return
|
return
|
||||||
|
@ -242,7 +243,10 @@ class AuthorizationService:
|
||||||
if self._unable_to_get_data_message is not None:
|
if self._unable_to_get_data_message is not None:
|
||||||
self._unable_to_get_data_message.hide()
|
self._unable_to_get_data_message.hide()
|
||||||
|
|
||||||
self._unable_to_get_data_message = Message(i18n_catalog.i18nc("@info", "Unable to reach the Ultimaker account server."), title = i18n_catalog.i18nc("@info:title", "Warning"))
|
self._unable_to_get_data_message = Message(i18n_catalog.i18nc("@info",
|
||||||
|
"Unable to reach the Ultimaker account server."),
|
||||||
|
title = i18n_catalog.i18nc("@info:title", "Warning"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
self._unable_to_get_data_message.show()
|
self._unable_to_get_data_message.show()
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
Logger.logException("w", "Could not load auth data from preferences")
|
Logger.logException("w", "Could not load auth data from preferences")
|
||||||
|
|
|
@ -141,20 +141,27 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||||
success = profile_writer.write(file_name, container_list)
|
success = profile_writer.write(file_name, container_list)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Logger.log("e", "Failed to export profile to %s: %s", file_name, str(e))
|
Logger.log("e", "Failed to export profile to %s: %s", file_name, str(e))
|
||||||
m = Message(catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "Failed to export profile to <filename>{0}</filename>: <message>{1}</message>", file_name, str(e)),
|
m = Message(catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!",
|
||||||
lifetime = 0,
|
"Failed to export profile to <filename>{0}</filename>: <message>{1}</message>",
|
||||||
title = catalog.i18nc("@info:title", "Error"))
|
file_name, str(e)),
|
||||||
m.show()
|
|
||||||
return False
|
|
||||||
if not success:
|
|
||||||
Logger.log("w", "Failed to export profile to %s: Writer plugin reported failure.", file_name)
|
|
||||||
m = Message(catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Failed to export profile to <filename>{0}</filename>: Writer plugin reported failure.", file_name),
|
|
||||||
lifetime = 0,
|
lifetime = 0,
|
||||||
title = catalog.i18nc("@info:title", "Error"),
|
title = catalog.i18nc("@info:title", "Error"),
|
||||||
message_type = Message.MessageType.ERROR)
|
message_type = Message.MessageType.ERROR)
|
||||||
m.show()
|
m.show()
|
||||||
return False
|
return False
|
||||||
m = Message(catalog.i18nc("@info:status Don't translate the XML tag <filename>!", "Exported profile to <filename>{0}</filename>", file_name),
|
if not success:
|
||||||
|
Logger.log("w", "Failed to export profile to %s: Writer plugin reported failure.", file_name)
|
||||||
|
m = Message(catalog.i18nc("@info:status Don't translate the XML tag <filename>!",
|
||||||
|
"Failed to export profile to <filename>{0}</filename>: Writer plugin reported failure.",
|
||||||
|
file_name),
|
||||||
|
lifetime = 0,
|
||||||
|
title = catalog.i18nc("@info:title", "Error"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
|
m.show()
|
||||||
|
return False
|
||||||
|
m = Message(catalog.i18nc("@info:status Don't translate the XML tag <filename>!",
|
||||||
|
"Exported profile to <filename>{0}</filename>",
|
||||||
|
file_name),
|
||||||
title = catalog.i18nc("@info:title", "Export succeeded"),
|
title = catalog.i18nc("@info:title", "Export succeeded"),
|
||||||
message_type = Message.MessageType.POSITIVE)
|
message_type = Message.MessageType.POSITIVE)
|
||||||
m.show()
|
m.show()
|
||||||
|
|
|
@ -853,7 +853,8 @@ class MachineManager(QObject):
|
||||||
self._global_container_stack.userChanges.setProperty(setting_key, "value", self._default_extruder_position)
|
self._global_container_stack.userChanges.setProperty(setting_key, "value", self._default_extruder_position)
|
||||||
if add_user_changes:
|
if add_user_changes:
|
||||||
caution_message = Message(
|
caution_message = Message(
|
||||||
catalog.i18nc("@info:message Followed by a list of settings.", "Settings have been changed to match the current availability of extruders:") + " [{settings_list}]".format(settings_list = ", ".join(add_user_changes)),
|
catalog.i18nc("@info:message Followed by a list of settings.",
|
||||||
|
"Settings have been changed to match the current availability of extruders:") + " [{settings_list}]".format(settings_list = ", ".join(add_user_changes)),
|
||||||
lifetime = 0,
|
lifetime = 0,
|
||||||
title = catalog.i18nc("@info:title", "Settings updated"))
|
title = catalog.i18nc("@info:title", "Settings updated"))
|
||||||
caution_message.show()
|
caution_message.show()
|
||||||
|
|
|
@ -43,7 +43,9 @@ class CreateBackupJob(Job):
|
||||||
"""After the job completes, an empty string indicates success. Othrerwise, the value is a translated message."""
|
"""After the job completes, an empty string indicates success. Othrerwise, the value is a translated message."""
|
||||||
|
|
||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
upload_message = Message(catalog.i18nc("@info:backup_status", "Creating your backup..."), title = self.MESSAGE_TITLE, progress = -1)
|
upload_message = Message(catalog.i18nc("@info:backup_status", "Creating your backup..."),
|
||||||
|
title = self.MESSAGE_TITLE,
|
||||||
|
progress = -1)
|
||||||
upload_message.show()
|
upload_message.show()
|
||||||
CuraApplication.getInstance().processEvents()
|
CuraApplication.getInstance().processEvents()
|
||||||
cura_api = CuraApplication.getInstance().getCuraAPI()
|
cura_api = CuraApplication.getInstance().getCuraAPI()
|
||||||
|
|
|
@ -391,7 +391,9 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
if job.getResult() == StartJobResult.MaterialIncompatible:
|
if job.getResult() == StartJobResult.MaterialIncompatible:
|
||||||
if application.platformActivity:
|
if application.platformActivity:
|
||||||
self._error_message = Message(catalog.i18nc("@info:status",
|
self._error_message = Message(catalog.i18nc("@info:status",
|
||||||
"Unable to slice with the current material as it is incompatible with the selected machine or configuration."), title = catalog.i18nc("@info:title", "Unable to slice"))
|
"Unable to slice with the current material as it is incompatible with the selected machine or configuration."),
|
||||||
|
title = catalog.i18nc("@info:title", "Unable to slice"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.setState(BackendState.Error)
|
self.setState(BackendState.Error)
|
||||||
self.backendError.emit(job)
|
self.backendError.emit(job)
|
||||||
|
@ -421,8 +423,10 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
continue
|
continue
|
||||||
error_labels.add(definitions[0].label)
|
error_labels.add(definitions[0].label)
|
||||||
|
|
||||||
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice with the current settings. The following settings have errors: {0}").format(", ".join(error_labels)),
|
self._error_message = Message(catalog.i18nc("@info:status",
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"))
|
"Unable to slice with the current settings. The following settings have errors: {0}").format(", ".join(error_labels)),
|
||||||
|
title = catalog.i18nc("@info:title", "Unable to slice"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.setState(BackendState.Error)
|
self.setState(BackendState.Error)
|
||||||
self.backendError.emit(job)
|
self.backendError.emit(job)
|
||||||
|
@ -445,8 +449,10 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
Logger.log("e", "When checking settings for errors, unable to find definition for key {key} in per-object stack.".format(key = key))
|
Logger.log("e", "When checking settings for errors, unable to find definition for key {key} in per-object stack.".format(key = key))
|
||||||
continue
|
continue
|
||||||
errors[key] = definition[0].label
|
errors[key] = definition[0].label
|
||||||
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice due to some per-model settings. The following settings have errors on one or more models: {error_labels}").format(error_labels = ", ".join(errors.values())),
|
self._error_message = Message(catalog.i18nc("@info:status",
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"))
|
"Unable to slice due to some per-model settings. The following settings have errors on one or more models: {error_labels}").format(error_labels = ", ".join(errors.values())),
|
||||||
|
title = catalog.i18nc("@info:title", "Unable to slice"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.setState(BackendState.Error)
|
self.setState(BackendState.Error)
|
||||||
self.backendError.emit(job)
|
self.backendError.emit(job)
|
||||||
|
@ -454,8 +460,10 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
|
|
||||||
if job.getResult() == StartJobResult.BuildPlateError:
|
if job.getResult() == StartJobResult.BuildPlateError:
|
||||||
if application.platformActivity:
|
if application.platformActivity:
|
||||||
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice because the prime tower or prime position(s) are invalid."),
|
self._error_message = Message(catalog.i18nc("@info:status",
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"))
|
"Unable to slice because the prime tower or prime position(s) are invalid."),
|
||||||
|
title = catalog.i18nc("@info:title", "Unable to slice"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.setState(BackendState.Error)
|
self.setState(BackendState.Error)
|
||||||
self.backendError.emit(job)
|
self.backendError.emit(job)
|
||||||
|
@ -463,8 +471,10 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
self.setState(BackendState.NotStarted)
|
self.setState(BackendState.NotStarted)
|
||||||
|
|
||||||
if job.getResult() == StartJobResult.ObjectsWithDisabledExtruder:
|
if job.getResult() == StartJobResult.ObjectsWithDisabledExtruder:
|
||||||
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice because there are objects associated with disabled Extruder %s.") % job.getMessage(),
|
self._error_message = Message(catalog.i18nc("@info:status",
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"))
|
"Unable to slice because there are objects associated with disabled Extruder %s.") % job.getMessage(),
|
||||||
|
title = catalog.i18nc("@info:title", "Unable to slice"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.setState(BackendState.Error)
|
self.setState(BackendState.Error)
|
||||||
self.backendError.emit(job)
|
self.backendError.emit(job)
|
||||||
|
@ -476,7 +486,8 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
"\n- Fit within the build volume"
|
"\n- Fit within the build volume"
|
||||||
"\n- Are assigned to an enabled extruder"
|
"\n- Are assigned to an enabled extruder"
|
||||||
"\n- Are not all set as modifier meshes"),
|
"\n- Are not all set as modifier meshes"),
|
||||||
title = catalog.i18nc("@info:title", "Unable to slice"))
|
title = catalog.i18nc("@info:title", "Unable to slice"),
|
||||||
|
message_type = Message.MessageType.ERROR)
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.setState(BackendState.Error)
|
self.setState(BackendState.Error)
|
||||||
self.backendError.emit(job)
|
self.backendError.emit(job)
|
||||||
|
|
|
@ -257,10 +257,10 @@ class ProcessSlicedLayersJob(Job):
|
||||||
if self.isRunning():
|
if self.isRunning():
|
||||||
if Application.getInstance().getController().getActiveView().getPluginId() == "SimulationView":
|
if Application.getInstance().getController().getActiveView().getPluginId() == "SimulationView":
|
||||||
if not self._progress_message:
|
if not self._progress_message:
|
||||||
self._progress_message = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, 0, catalog.i18nc("@info:title", "Information"))
|
self._progress_message = Message(catalog.i18nc("@info:status", "Processing Layers"), 0, False, 0,
|
||||||
|
catalog.i18nc("@info:title", "Information"))
|
||||||
if self._progress_message.getProgress() != 100:
|
if self._progress_message.getProgress() != 100:
|
||||||
self._progress_message.show()
|
self._progress_message.show()
|
||||||
else:
|
else:
|
||||||
if self._progress_message:
|
if self._progress_message:
|
||||||
self._progress_message.hide()
|
self._progress_message.hide()
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ class DFFileExportAndUploadManager:
|
||||||
text = "Your {} uploaded to '{}'.".format("file was" if len(self._file_upload_job_metadata) <= 1 else "files were", self._library_project_name),
|
text = "Your {} uploaded to '{}'.".format("file was" if len(self._file_upload_job_metadata) <= 1 else "files were", self._library_project_name),
|
||||||
title = "Upload successful",
|
title = "Upload successful",
|
||||||
lifetime = 0,
|
lifetime = 0,
|
||||||
message_type=Message.MessageType.POSITIVE
|
message_type = Message.MessageType.POSITIVE
|
||||||
)
|
)
|
||||||
self._generic_success_message.addAction(
|
self._generic_success_message.addAction(
|
||||||
"open_df_project",
|
"open_df_project",
|
||||||
|
@ -220,7 +220,8 @@ class DFFileExportAndUploadManager:
|
||||||
self._file_upload_job_metadata[filename]["file_upload_failed_message"] = Message(
|
self._file_upload_job_metadata[filename]["file_upload_failed_message"] = Message(
|
||||||
text = "Failed to export the file '{}'. The upload process is aborted.".format(filename),
|
text = "Failed to export the file '{}'. The upload process is aborted.".format(filename),
|
||||||
title = "Export error",
|
title = "Export error",
|
||||||
lifetime = 0
|
lifetime = 0,
|
||||||
|
message_type = Message.MessageType.ERROR
|
||||||
)
|
)
|
||||||
self._on_upload_error()
|
self._on_upload_error()
|
||||||
self._onFileUploadFinished(filename)
|
self._onFileUploadFinished(filename)
|
||||||
|
@ -242,7 +243,8 @@ class DFFileExportAndUploadManager:
|
||||||
self._file_upload_job_metadata[filename_3mf]["file_upload_failed_message"] = Message(
|
self._file_upload_job_metadata[filename_3mf]["file_upload_failed_message"] = Message(
|
||||||
text = "Failed to upload the file '{}' to '{}'. {}".format(filename_3mf, self._library_project_name, human_readable_error),
|
text = "Failed to upload the file '{}' to '{}'. {}".format(filename_3mf, self._library_project_name, human_readable_error),
|
||||||
title = "File upload error",
|
title = "File upload error",
|
||||||
lifetime = 0
|
lifetime = 0,
|
||||||
|
message_type = Message.MessageType.ERROR
|
||||||
)
|
)
|
||||||
self._on_upload_error()
|
self._on_upload_error()
|
||||||
self._onFileUploadFinished(filename_3mf)
|
self._onFileUploadFinished(filename_3mf)
|
||||||
|
@ -264,7 +266,8 @@ class DFFileExportAndUploadManager:
|
||||||
self._file_upload_job_metadata[filename_ufp]["file_upload_failed_message"] = Message(
|
self._file_upload_job_metadata[filename_ufp]["file_upload_failed_message"] = Message(
|
||||||
title = "File upload error",
|
title = "File upload error",
|
||||||
text = "Failed to upload the file '{}' to '{}'. {}".format(filename_ufp, self._library_project_name, human_readable_error),
|
text = "Failed to upload the file '{}' to '{}'. {}".format(filename_ufp, self._library_project_name, human_readable_error),
|
||||||
lifetime = 0
|
lifetime = 0,
|
||||||
|
message_type = Message.MessageType.ERROR
|
||||||
)
|
)
|
||||||
self._on_upload_error()
|
self._on_upload_error()
|
||||||
self._onFileUploadFinished(filename_ufp)
|
self._onFileUploadFinished(filename_ufp)
|
||||||
|
@ -300,7 +303,8 @@ class DFFileExportAndUploadManager:
|
||||||
self._file_upload_job_metadata[filename]["file_upload_failed_message"] = Message(
|
self._file_upload_job_metadata[filename]["file_upload_failed_message"] = Message(
|
||||||
title = "File upload error",
|
title = "File upload error",
|
||||||
text = "Failed to upload the file '{}' to '{}'. {}".format(self._file_name, self._library_project_name, human_readable_error),
|
text = "Failed to upload the file '{}' to '{}'. {}".format(self._file_name, self._library_project_name, human_readable_error),
|
||||||
lifetime = 0
|
lifetime = 0,
|
||||||
|
message_type = Message.MessageType.ERROR
|
||||||
)
|
)
|
||||||
|
|
||||||
self._on_upload_error()
|
self._on_upload_error()
|
||||||
|
@ -337,11 +341,13 @@ class DFFileExportAndUploadManager:
|
||||||
text = "'{}' was uploaded to '{}'.".format(filename_3mf, self._library_project_name),
|
text = "'{}' was uploaded to '{}'.".format(filename_3mf, self._library_project_name),
|
||||||
title = "Upload successful",
|
title = "Upload successful",
|
||||||
lifetime = 0,
|
lifetime = 0,
|
||||||
|
message_type = Message.MessageType.POSITIVE
|
||||||
),
|
),
|
||||||
"file_upload_failed_message": Message(
|
"file_upload_failed_message": Message(
|
||||||
text = "Failed to upload the file '{}' to '{}'.".format(filename_3mf, self._library_project_name),
|
text = "Failed to upload the file '{}' to '{}'.".format(filename_3mf, self._library_project_name),
|
||||||
title = "File upload error",
|
title = "File upload error",
|
||||||
lifetime = 0
|
lifetime = 0,
|
||||||
|
message_type = Message.MessageType.ERROR
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
job_3mf = ExportFileJob(self._file_handlers["3mf"], self._nodes, self._file_name, "3mf")
|
job_3mf = ExportFileJob(self._file_handlers["3mf"], self._nodes, self._file_name, "3mf")
|
||||||
|
@ -359,11 +365,13 @@ class DFFileExportAndUploadManager:
|
||||||
text = "'{}' was uploaded to '{}'.".format(filename_ufp, self._library_project_name),
|
text = "'{}' was uploaded to '{}'.".format(filename_ufp, self._library_project_name),
|
||||||
title = "Upload successful",
|
title = "Upload successful",
|
||||||
lifetime = 0,
|
lifetime = 0,
|
||||||
|
message_type = Message.MessageType.POSITIVE
|
||||||
),
|
),
|
||||||
"file_upload_failed_message": Message(
|
"file_upload_failed_message": Message(
|
||||||
text = "Failed to upload the file '{}' to '{}'.".format(filename_ufp, self._library_project_name),
|
text = "Failed to upload the file '{}' to '{}'.".format(filename_ufp, self._library_project_name),
|
||||||
title = "File upload error",
|
title = "File upload error",
|
||||||
lifetime = 0
|
lifetime = 0,
|
||||||
|
message_type = Message.MessageType.ERROR
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
job_ufp = ExportFileJob(self._file_handlers["ufp"], self._nodes, self._file_name, "ufp")
|
job_ufp = ExportFileJob(self._file_handlers["ufp"], self._nodes, self._file_name, "ufp")
|
||||||
|
|
|
@ -500,7 +500,8 @@ class FlavorParser:
|
||||||
"@info:generic",
|
"@info:generic",
|
||||||
"Make sure the g-code is suitable for your printer and printer configuration before sending the file to it. The g-code representation may not be accurate."),
|
"Make sure the g-code is suitable for your printer and printer configuration before sending the file to it. The g-code representation may not be accurate."),
|
||||||
lifetime=0,
|
lifetime=0,
|
||||||
title = catalog.i18nc("@info:title", "G-code Details"))
|
title = catalog.i18nc("@info:title", "G-code Details"),
|
||||||
|
message_type = Message.MessageType.WARNING)
|
||||||
caution_message.show()
|
caution_message.show()
|
||||||
|
|
||||||
# The "save/print" button's state is bound to the backend state.
|
# The "save/print" button's state is bound to the backend state.
|
||||||
|
|
|
@ -93,7 +93,9 @@ class RemovableDriveOutputDevice(OutputDevice):
|
||||||
job.progress.connect(self._onProgress)
|
job.progress.connect(self._onProgress)
|
||||||
job.finished.connect(self._onFinished)
|
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()
|
message.show()
|
||||||
|
|
||||||
self.writeStarted.emit(self)
|
self.writeStarted.emit(self)
|
||||||
|
@ -153,7 +155,9 @@ class RemovableDriveOutputDevice(OutputDevice):
|
||||||
message.show()
|
message.show()
|
||||||
self.writeSuccess.emit(self)
|
self.writeSuccess.emit(self)
|
||||||
else:
|
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"),
|
title = catalog.i18nc("@info:title", "Error"),
|
||||||
message_type = Message.MessageType.ERROR)
|
message_type = Message.MessageType.ERROR)
|
||||||
message.show()
|
message.show()
|
||||||
|
@ -164,8 +168,12 @@ class RemovableDriveOutputDevice(OutputDevice):
|
||||||
if action == "eject":
|
if action == "eject":
|
||||||
if Application.getInstance().getOutputDeviceManager().getOutputDevicePlugin("RemovableDriveOutputDevice").ejectDevice(self):
|
if Application.getInstance().getOutputDeviceManager().getOutputDevicePlugin("RemovableDriveOutputDevice").ejectDevice(self):
|
||||||
message.hide()
|
message.hide()
|
||||||
|
eject_message = Message(catalog.i18nc("@info:status",
|
||||||
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"))
|
"Ejected {0}. You can now safely remove the drive.").format(self.getName()),
|
||||||
|
title = catalog.i18nc("@info:title", "Safely Remove Hardware"))
|
||||||
else:
|
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()
|
eject_message.show()
|
||||||
|
|
|
@ -125,12 +125,15 @@ class SimulationView(CuraView):
|
||||||
self._only_show_top_layers = bool(Application.getInstance().getPreferences().getValue("view/only_show_top_layers"))
|
self._only_show_top_layers = bool(Application.getInstance().getPreferences().getValue("view/only_show_top_layers"))
|
||||||
self._compatibility_mode = self._evaluateCompatibilityMode()
|
self._compatibility_mode = self._evaluateCompatibilityMode()
|
||||||
|
|
||||||
self._wireprint_warning_message = Message(catalog.i18nc("@info:status", "Cura does not accurately display layers when Wire Printing is enabled."),
|
self._wireprint_warning_message = Message(catalog.i18nc("@info:status",
|
||||||
|
"Cura does not accurately display layers when Wire Printing is enabled."),
|
||||||
title = catalog.i18nc("@info:title", "Simulation View"),
|
title = catalog.i18nc("@info:title", "Simulation View"),
|
||||||
message_type = Message.MessageType.WARNING)
|
message_type = Message.MessageType.WARNING)
|
||||||
self._slice_first_warning_message = Message(catalog.i18nc("@info:status", "Nothing is shown because you need to slice first."),
|
self._slice_first_warning_message = Message(catalog.i18nc("@info:status",
|
||||||
|
"Nothing is shown because you need to slice first."),
|
||||||
title = catalog.i18nc("@info:title", "No layers to show"),
|
title = catalog.i18nc("@info:title", "No layers to show"),
|
||||||
option_text = catalog.i18nc("@info:option_text", "Do not show this message again"),
|
option_text = catalog.i18nc("@info:option_text",
|
||||||
|
"Do not show this message again"),
|
||||||
option_state = False,
|
option_state = False,
|
||||||
message_type = Message.MessageType.WARNING)
|
message_type = Message.MessageType.WARNING)
|
||||||
self._slice_first_warning_message.optionToggled.connect(self._onDontAskMeAgain)
|
self._slice_first_warning_message.optionToggled.connect(self._onDontAskMeAgain)
|
||||||
|
|
|
@ -15,10 +15,10 @@ class RestartApplicationPresenter:
|
||||||
def present(self) -> None:
|
def present(self) -> None:
|
||||||
app_name = self._app.getApplicationDisplayName()
|
app_name = self._app.getApplicationDisplayName()
|
||||||
|
|
||||||
message = Message(self._i18n_catalog.i18nc(
|
message = Message(self._i18n_catalog.i18nc("@info:generic",
|
||||||
"@info:generic",
|
"You need to quit and restart {} before changes have effect.",
|
||||||
"You need to quit and restart {} before changes have effect.", app_name
|
app_name),
|
||||||
))
|
message_type = Message.MessageType.WARNING)
|
||||||
|
|
||||||
message.addAction("quit",
|
message.addAction("quit",
|
||||||
name="Quit " + app_name,
|
name="Quit " + app_name,
|
||||||
|
|
|
@ -230,7 +230,8 @@ class CloudOutputDeviceManager:
|
||||||
),
|
),
|
||||||
progress = 0,
|
progress = 0,
|
||||||
lifetime = 0,
|
lifetime = 0,
|
||||||
image_source = image_path
|
image_source = image_path,
|
||||||
|
message_type = Message.MessageType.POSITIVE
|
||||||
)
|
)
|
||||||
message.show()
|
message.show()
|
||||||
|
|
||||||
|
@ -316,7 +317,8 @@ class CloudOutputDeviceManager:
|
||||||
"A cloud connection is not available for a printer",
|
"A cloud connection is not available for a printer",
|
||||||
"A cloud connection is not available for some printers",
|
"A cloud connection is not available for some printers",
|
||||||
len(self.reported_device_ids)
|
len(self.reported_device_ids)
|
||||||
)
|
),
|
||||||
|
message_type = Message.MessageType.WARNING
|
||||||
)
|
)
|
||||||
device_names = "".join(["<li>{} ({})</li>".format(self._um_cloud_printers[device].name, self._um_cloud_printers[device].definition.name) for device in self.reported_device_ids])
|
device_names = "".join(["<li>{} ({})</li>".format(self._um_cloud_printers[device].name, self._um_cloud_printers[device].definition.name) for device in self.reported_device_ids])
|
||||||
message_text = self.i18n_catalog.i18ncp(
|
message_text = self.i18n_catalog.i18ncp(
|
||||||
|
|
|
@ -14,7 +14,7 @@ class LegacyDeviceNoLongerSupportedMessage(Message):
|
||||||
"""Singleton used to prevent duplicate messages of this type at the same time."""
|
"""Singleton used to prevent duplicate messages of this type at the same time."""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__(
|
super(LegacyDeviceNoLongerSupportedMessage, self).__init__(
|
||||||
text = I18N_CATALOG.i18nc("@info:status", "You are attempting to connect to a printer that is not "
|
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 "
|
"running Ultimaker Connect. Please update the printer to the "
|
||||||
"latest firmware."),
|
"latest firmware."),
|
||||||
|
|
|
@ -20,12 +20,13 @@ class MaterialSyncMessage(Message):
|
||||||
"""Singleton used to prevent duplicate messages of this type at the same time."""
|
"""Singleton used to prevent duplicate messages of this type at the same time."""
|
||||||
|
|
||||||
def __init__(self, device: "UltimakerNetworkedPrinterOutputDevice") -> None:
|
def __init__(self, device: "UltimakerNetworkedPrinterOutputDevice") -> None:
|
||||||
super().__init__(
|
super(MaterialSyncMessage, self).__init__(
|
||||||
text = I18N_CATALOG.i18nc("@info:status", "Cura has detected material profiles that were not yet installed "
|
text = I18N_CATALOG.i18nc("@info:status", "Cura has detected material profiles that were not yet installed "
|
||||||
"on the host printer of group {0}.", device.name),
|
"on the host printer of group {0}.", device.name),
|
||||||
title = I18N_CATALOG.i18nc("@info:title", "Sending materials to printer"),
|
title = I18N_CATALOG.i18nc("@info:title", "Sending materials to printer"),
|
||||||
lifetime = 10,
|
lifetime = 10,
|
||||||
dismissable = True
|
dismissable = True,
|
||||||
|
message_type = Message.MessageType.POSITIVE
|
||||||
)
|
)
|
||||||
|
|
||||||
def show(self) -> None:
|
def show(self) -> None:
|
||||||
|
|
|
@ -23,7 +23,7 @@ class NotClusterHostMessage(Message):
|
||||||
"""Singleton used to prevent duplicate messages of this type at the same time."""
|
"""Singleton used to prevent duplicate messages of this type at the same time."""
|
||||||
|
|
||||||
def __init__(self, device: "UltimakerNetworkedPrinterOutputDevice") -> None:
|
def __init__(self, device: "UltimakerNetworkedPrinterOutputDevice") -> None:
|
||||||
super().__init__(
|
super(NotClusterHostMessage, self).__init__(
|
||||||
text = I18N_CATALOG.i18nc("@info:status", "You are attempting to connect to {0} but it is not "
|
text = I18N_CATALOG.i18nc("@info:status", "You are attempting to connect to {0} but it is not "
|
||||||
"the host of a group. You can visit the web page to configure "
|
"the host of a group. You can visit the web page to configure "
|
||||||
"it as a group host.", device.name),
|
"it as a group host.", device.name),
|
||||||
|
|
|
@ -11,9 +11,9 @@ class PrintJobUploadBlockedMessage(Message):
|
||||||
"""Message shown when uploading a print job to a cluster is blocked because another upload is already in progress."""
|
"""Message shown when uploading a print job to a cluster is blocked because another upload is already in progress."""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__(
|
super(PrintJobUploadBlockedMessage, self).__init__(
|
||||||
text = I18N_CATALOG.i18nc("@info:status", "Please wait until the current job has been sent."),
|
text = I18N_CATALOG.i18nc("@info:status", "Please wait until the current job has been sent."),
|
||||||
title = I18N_CATALOG.i18nc("@info:title", "Print error"),
|
title = I18N_CATALOG.i18nc("@info:title", "Print error"),
|
||||||
lifetime = 10,
|
lifetime = 10,
|
||||||
message_type = Message.MessageType.WARNING
|
message_type = Message.MessageType.ERROR
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,7 +11,7 @@ class PrintJobUploadErrorMessage(Message):
|
||||||
"""Message shown when uploading a print job to a cluster failed."""
|
"""Message shown when uploading a print job to a cluster failed."""
|
||||||
|
|
||||||
def __init__(self, message: str = None) -> None:
|
def __init__(self, message: str = None) -> None:
|
||||||
super().__init__(
|
super(PrintJobUploadErrorMessage, self).__init__(
|
||||||
text = message or I18N_CATALOG.i18nc("@info:text", "Could not upload the data to the printer."),
|
text = message or I18N_CATALOG.i18nc("@info:text", "Could not upload the data to the printer."),
|
||||||
title = I18N_CATALOG.i18nc("@info:title", "Network error"),
|
title = I18N_CATALOG.i18nc("@info:title", "Network error"),
|
||||||
message_type=Message.MessageType.ERROR
|
message_type=Message.MessageType.ERROR
|
||||||
|
|
|
@ -11,7 +11,7 @@ class PrintJobUploadProgressMessage(Message):
|
||||||
"""Class responsible for showing a progress message while a mesh is being uploaded to the cloud."""
|
"""Class responsible for showing a progress message while a mesh is being uploaded to the cloud."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(
|
super(PrintJobUploadProgressMessage, self).__init__(
|
||||||
title = I18N_CATALOG.i18nc("@info:status", "Sending Print Job"),
|
title = I18N_CATALOG.i18nc("@info:status", "Sending Print Job"),
|
||||||
text = I18N_CATALOG.i18nc("@info:status", "Uploading print job to printer."),
|
text = I18N_CATALOG.i18nc("@info:status", "Uploading print job to printer."),
|
||||||
progress = -1,
|
progress = -1,
|
||||||
|
|
|
@ -12,9 +12,9 @@ class PrintJobUploadQueueFullMessage(Message):
|
||||||
"""Message shown when uploading a print job to a cluster and the print queue is full."""
|
"""Message shown when uploading a print job to a cluster and the print queue is full."""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__(
|
super(PrintJobUploadQueueFullMessage, self).__init__(
|
||||||
text = I18N_CATALOG.i18nc("@info:status", "Print job queue is full. The printer can't accept a new job."),
|
text = I18N_CATALOG.i18nc("@info:status", "Print job queue is full. The printer can't accept a new job."),
|
||||||
title = I18N_CATALOG.i18nc("@info:title", "Queue Full"),
|
title = I18N_CATALOG.i18nc("@info:title", "Queue Full"),
|
||||||
lifetime = 10,
|
lifetime = 10,
|
||||||
message_type=Message.MessageType.WARNING
|
message_type=Message.MessageType.ERROR
|
||||||
)
|
)
|
||||||
|
|
|
@ -11,7 +11,7 @@ class PrintJobUploadSuccessMessage(Message):
|
||||||
"""Message shown when uploading a print job to a cluster succeeded."""
|
"""Message shown when uploading a print job to a cluster succeeded."""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__(
|
super(PrintJobUploadSuccessMessage, self).__init__(
|
||||||
text = I18N_CATALOG.i18nc("@info:status", "Print job was successfully sent to the printer."),
|
text = I18N_CATALOG.i18nc("@info:status", "Print job was successfully sent to the printer."),
|
||||||
title = I18N_CATALOG.i18nc("@info:title", "Data Sent"),
|
title = I18N_CATALOG.i18nc("@info:title", "Data Sent"),
|
||||||
message_type = Message.MessageType.POSITIVE
|
message_type = Message.MessageType.POSITIVE
|
||||||
|
|
|
@ -131,9 +131,10 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self._is_printing:
|
if self._is_printing:
|
||||||
message = Message(text = catalog.i18nc("@message", "A print is still in progress. Cura cannot start another print via USB until the previous print has completed."),
|
message = Message(text = catalog.i18nc("@message",
|
||||||
|
"A print is still in progress. Cura cannot start another print via USB until the previous print has completed."),
|
||||||
title = catalog.i18nc("@message", "Print in Progress"),
|
title = catalog.i18nc("@message", "Print in Progress"),
|
||||||
message_type = Message.MessageType.WARNING)
|
message_type = Message.MessageType.ERROR)
|
||||||
message.show()
|
message.show()
|
||||||
return # Already printing
|
return # Already printing
|
||||||
self.writeStarted.emit(self)
|
self.writeStarted.emit(self)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue