Use right enum for message dialog

This commit is contained in:
Jaime van Kessel 2022-04-13 16:40:14 +02:00
parent 111d335743
commit c9e625767b
3 changed files with 3 additions and 3 deletions

View file

@ -206,7 +206,7 @@ class ContainerManager(QObject):
if os.path.exists(file_url): if os.path.exists(file_url):
result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"), result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"),
catalog.i18nc("@label Don't translate the XML tag <filename>!", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_url)) catalog.i18nc("@label Don't translate the XML tag <filename>!", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_url))
if result == QMessageBox.No: if result == QMessageBox.ButtonRole.NoRole:
return {"status": "cancelled", "message": "User cancelled"} return {"status": "cancelled", "message": "User cancelled"}
try: try:

View file

@ -139,7 +139,7 @@ class CuraContainerRegistry(ContainerRegistry):
if os.path.exists(file_name): if os.path.exists(file_name):
result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"), result = QMessageBox.question(None, catalog.i18nc("@title:window", "File Already Exists"),
catalog.i18nc("@label Don't translate the XML tag <filename>!", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_name)) catalog.i18nc("@label Don't translate the XML tag <filename>!", "The file <filename>{0}</filename> already exists. Are you sure you want to overwrite it?").format(file_name))
if result == QMessageBox.No: if result == QMessageBox.ButtonRole.NoRole:
return False return False
profile_writer = self._findProfileWriter(extension, description) profile_writer = self._findProfileWriter(extension, description)

View file

@ -480,7 +480,7 @@ class CloudOutputDeviceManager:
if remove_printers_ids == all_ids: if remove_printers_ids == all_ids:
question_content = self.i18n_catalog.i18nc("@label", "You are about to remove all printers from Cura. This action cannot be undone.\nAre you sure you want to continue?") question_content = self.i18n_catalog.i18nc("@label", "You are about to remove all printers from Cura. This action cannot be undone.\nAre you sure you want to continue?")
result = QMessageBox.question(None, question_title, question_content) result = QMessageBox.question(None, question_title, question_content)
if result == QMessageBox.No: if result == QMessageBox.ButtonRole.NoRole:
return return
for machine_cloud_id in self.reported_device_ids: for machine_cloud_id in self.reported_device_ids: