Просмотр исходного кода

Use correct role for standardbutton

Otherwise the no won't register...

CURA-9229
Jaime van Kessel 2 лет назад
Родитель
Сommit
0c98ce2384

+ 1 - 1
cura/Settings/ContainerManager.py

@@ -206,7 +206,7 @@ class ContainerManager(QObject):
             if os.path.exists(file_url):
                 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))
-                if result == QMessageBox.ButtonRole.NoRole:
+                if result == QMessageBox.StandardButton.No:
                     return {"status": "cancelled", "message": "User cancelled"}
 
         try:

+ 1 - 1
cura/Settings/CuraContainerRegistry.py

@@ -139,7 +139,7 @@ class CuraContainerRegistry(ContainerRegistry):
             if os.path.exists(file_name):
                 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))
-                if result == QMessageBox.ButtonRole.NoRole:
+                if result == QMessageBox.StandardButton.No:
                     return False
 
         profile_writer = self._findProfileWriter(extension, description)

+ 1 - 1
plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py

@@ -480,7 +480,7 @@ class CloudOutputDeviceManager:
             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?")
             result = QMessageBox.question(None, question_title, question_content)
-            if result == QMessageBox.ButtonRole.NoRole:
+            if result == QMessageBox.StandardButton.No:
                 return
 
             for machine_cloud_id in self.reported_device_ids: