Repository: spyder-ide/spyder

Issue:
Update obsolete QMessageBox Standard Button values
QMessageBox.YesAll and QMessageBox.NoAll are obsolete.

https://doc.qt.io/qt-4.8/qmessagebox.html#StandardButton-enum


Discussion:

Resolving patch:
diff --git a/spyder/widgets/editor.py b/spyder/widgets/editor.py
--- a/spyder/widgets/editor.py
+++ b/spyder/widgets/editor.py
@@ -1548,7 +1548,7 @@ def save_if_changed(self, cancelable=False, index=None):
             # No file to save
             return True
         if unsaved_nb > 1:
-            buttons |= QMessageBox.YesAll | QMessageBox.NoAll
+            buttons |= QMessageBox.YesToAll | QMessageBox.NoToAll
         yes_all = False
         for index in indexes:
             self.set_stack_index(index)
@@ -1571,11 +1571,11 @@ def save_if_changed(self, cancelable=False, index=None):
                 if answer == QMessageBox.Yes:
                     if not self.save():
                         return False
-                elif answer == QMessageBox.YesAll:
+                elif answer == QMessageBox.YesToAll:
                     if not self.save():
                         return False
                     yes_all = True
-                elif answer == QMessageBox.NoAll:
+                elif answer == QMessageBox.NoToAll:
                     return True
                 elif answer == QMessageBox.Cancel:
                     return False
diff --git a/spyder/widgets/explorer.py b/spyder/widgets/explorer.py
--- a/spyder/widgets/explorer.py
+++ b/spyder/widgets/explorer.py
@@ -588,7 +588,7 @@ def remove_tree(self, dirname):
     def delete_file(self, fname, multiple, yes_to_all):
         """Delete file"""
         if multiple:
-            buttons = QMessageBox.Yes|QMessageBox.YesAll| \
+            buttons = QMessageBox.Yes|QMessageBox.YesToAll| \
                       QMessageBox.No|QMessageBox.Cancel
         else:
             buttons = QMessageBox.Yes|QMessageBox.No
@@ -601,7 +601,7 @@ def delete_file(self, fname, multiple, yes_to_all):
                 return yes_to_all
             elif answer == QMessageBox.Cancel:
                 return False
-            elif answer == QMessageBox.YesAll:
+            elif answer == QMessageBox.YesToAll:
                 yes_to_all = True
         try:
             if osp.isfile(fname):
diff --git a/spyder/widgets/projects/explorer.py b/spyder/widgets/projects/explorer.py
--- a/spyder/widgets/projects/explorer.py
+++ b/spyder/widgets/projects/explorer.py
@@ -96,8 +96,8 @@ def dropEvent(self, event):
         src_list = [to_text_string(url.toString())
                     for url in event.mimeData().urls()]
         if len(src_list) > 1:
-            buttons = QMessageBox.Yes|QMessageBox.YesAll| \
-                      QMessageBox.No|QMessageBox.NoAll|QMessageBox.Cancel
+            buttons = QMessageBox.Yes|QMessageBox.YesToAll| \
+                      QMessageBox.No|QMessageBox.NoToAll|QMessageBox.Cancel
         else:
             buttons = QMessageBox.Yes|QMessageBox.No
         for src in src_list:
@@ -117,9 +117,9 @@ def dropEvent(self, event):
                         continue
                     elif answer == QMessageBox.Cancel:
                         break
-                    elif answer == QMessageBox.YesAll:
+                    elif answer == QMessageBox.YesToAll:
                         yes_to_all = True
-                    elif answer == QMessageBox.NoAll:
+                    elif answer == QMessageBox.NoToAll:
                         no_to_all = True
                         continue
                 else:


Test patch: