UI/UserInterface.py

changeset 543
a558e3cb7b5a
parent 541
00e1a5d060c5
child 545
1538031b5175
--- a/UI/UserInterface.py	Tue Aug 31 16:38:06 2010 +0200
+++ b/UI/UserInterface.py	Wed Sep 01 19:24:30 2010 +0200
@@ -2999,15 +2999,12 @@
         """
         Private method to restart the application.
         """
-        res = E5MessageBox.question(self,
+        res = E5MessageBox.yesNo(self,
             self.trUtf8("Restart application"),
             self.trUtf8("""The application needs to be restarted. Do it now?"""),
-            QMessageBox.StandardButtons(\
-                QMessageBox.No | \
-                QMessageBox.Yes),
-            QMessageBox.Yes)
-        
-        if res == QMessageBox.Yes and self.__shutdown():
+            yesDefault = True)
+        
+        if res and self.__shutdown():
             e5App().closeAllWindows()
             program = sys.executable
             eric5 = os.path.join(getConfig("ericDir"), "eric5.py")
@@ -5523,27 +5520,21 @@
             if "-snapshot-" in Version:
                 # check snapshot version
                 if versions[2] > Version:
-                    res = E5MessageBox.question(self,
+                    res = E5MessageBox.yesNo(self,
                         self.trUtf8("Update available"),
                         self.trUtf8("""The update to <b>{0}</b> of eric5 is available"""
                                     """ at <b>{1}</b>. Would you like to get it?""")\
                             .format(versions[2], versions[3]),
-                        QMessageBox.StandardButtons(\
-                            QMessageBox.No | \
-                            QMessageBox.Yes),
-                        QMessageBox.Yes)
-                    url = res == QMessageBox.Yes and versions[3] or ''
+                        yesDefault = True)
+                    url = res and versions[3] or ''
                 elif versions[0] > Version:
-                    res = E5MessageBox.question(self,
+                    res = E5MessageBox.yesNo(self,
                         self.trUtf8("Update available"),
                         self.trUtf8("""The update to <b>{0}</b> of eric5 is available"""
                                     """ at <b>{1}</b>. Would you like to get it?""")\
                             .format(versions[0], versions[1]),
-                        QMessageBox.StandardButtons(\
-                            QMessageBox.No | \
-                            QMessageBox.Yes),
-                        QMessageBox.Yes)
-                    url = res == QMessageBox.Yes and versions[1] or ''
+                        yesDefault = True)
+                    url = res and versions[1] or ''
                 else:
                     if self.manualUpdatesCheck:
                         E5MessageBox.information(self,
@@ -5552,16 +5543,13 @@
             else:
                 # check release version
                 if versions[0] > Version:
-                    res = E5MessageBox.question(self,
+                    res = E5MessageBox.yesNo(self,
                         self.trUtf8("Update available"),
                         self.trUtf8("""The update to <b>{0}</b> of eric5 is available"""
                                     """ at <b>{1}</b>. Would you like to get it?""")\
                             .format(versions[0], versions[1]),
-                        QMessageBox.StandardButtons(\
-                            QMessageBox.No | \
-                            QMessageBox.Yes),
-                        QMessageBox.Yes)
-                    url = res == QMessageBox.Yes and versions[1] or ''
+                        yesDefault = True)
+                    url = res and versions[1] or ''
                 else:
                     if self.manualUpdatesCheck:
                         E5MessageBox.information(self,
@@ -5617,17 +5605,14 @@
         for err in sslErrors:
             errorStrings.append(err.errorString())
         errorString = '.<br />'.join(errorStrings)
-        ret = E5MessageBox.warning(self,
+        ret = E5MessageBox.yesNo(self,
             self.trUtf8("SSL Errors"),
             self.trUtf8("""<p>SSL Errors:</p>"""
                         """<p>{0}</p>"""
                         """<p>Do you want to ignore these errors?</p>""")\
                 .format(errorString),
-            QMessageBox.StandardButtons(\
-                QMessageBox.No | \
-                QMessageBox.Yes),
-            QMessageBox.No)
-        if ret == QMessageBox.Yes:
+            type_ = E5MessageBox.Warning)
+        if ret:
             reply.ignoreSslErrors()
         else:
             self.__downloadCancelled = True

eric ide

mercurial