UI/UserInterface.py

changeset 553
5af61623ae3c
parent 545
1538031b5175
child 564
b3d966393ba9
equal deleted inserted replaced
551:e1074b63ff08 553:5af61623ae3c
2779 what to do with it. 2779 what to do with it.
2780 """ 2780 """
2781 if Preferences.getUI("CheckErrorLog"): 2781 if Preferences.getUI("CheckErrorLog"):
2782 logFile = os.path.join(Utilities.getConfigDir(), "eric5_error.log") 2782 logFile = os.path.join(Utilities.getConfigDir(), "eric5_error.log")
2783 if os.path.exists(logFile): 2783 if os.path.exists(logFile):
2784 dlg = QMessageBox(QMessageBox.Question, 2784 dlg = E5MessageBox.E5MessageBox(E5MessageBox.Question,
2785 self.trUtf8("Error log found"), 2785 self.trUtf8("Error log found"),
2786 self.trUtf8("An error log file was found. " 2786 self.trUtf8("An error log file was found. "
2787 "What should be done with it?")) 2787 "What should be done with it?"),
2788 dlg.setParent(self) 2788 modal = True, parent = self)
2789 dlg.setWindowModality(Qt.WindowModal)
2790 try: 2789 try:
2791 f = open(logFile, "r", encoding = "utf-8") 2790 f = open(logFile, "r", encoding = "utf-8")
2792 txt = f.read() 2791 txt = f.read()
2793 f.close() 2792 f.close()
2794 dlg.setDetailedText(txt) 2793 dlg.setDetailedText(txt)
2795 except IOError: 2794 except IOError:
2796 pass 2795 pass
2797 emailButton = \ 2796 emailButton = \
2798 dlg.addButton(self.trUtf8("Send Bug Email"), 2797 dlg.addButton(self.trUtf8("Send Bug Email"),
2799 QMessageBox.AcceptRole) 2798 E5MessageBox.AcceptRole)
2800 deleteButton = \ 2799 deleteButton = \
2801 dlg.addButton(self.trUtf8("Ignore and Delete"), 2800 dlg.addButton(self.trUtf8("Ignore and Delete"),
2802 QMessageBox.AcceptRole) 2801 E5MessageBox.AcceptRole)
2803 keepButton = \ 2802 keepButton = \
2804 dlg.addButton(self.trUtf8("Ignore but Keep"), 2803 dlg.addButton(self.trUtf8("Ignore but Keep"),
2805 QMessageBox.AcceptRole) 2804 E5MessageBox.AcceptRole)
2806 dlg.setDefaultButton(emailButton) 2805 dlg.setDefaultButton(emailButton)
2807 dlg.setEscapeButton(keepButton) 2806 dlg.setEscapeButton(keepButton)
2808 dlg.exec_() 2807 dlg.exec_()
2809 btn = dlg.clickedButton() 2808 btn = dlg.clickedButton()
2810 if btn == emailButton: 2809 if btn == emailButton:
5609 self.trUtf8("SSL Errors"), 5608 self.trUtf8("SSL Errors"),
5610 self.trUtf8("""<p>SSL Errors:</p>""" 5609 self.trUtf8("""<p>SSL Errors:</p>"""
5611 """<p>{0}</p>""" 5610 """<p>{0}</p>"""
5612 """<p>Do you want to ignore these errors?</p>""")\ 5611 """<p>Do you want to ignore these errors?</p>""")\
5613 .format(errorString), 5612 .format(errorString),
5614 type_ = E5MessageBox.Warning) 5613 icon = E5MessageBox.Warning)
5615 if ret: 5614 if ret:
5616 reply.ignoreSslErrors() 5615 reply.ignoreSslErrors()
5617 else: 5616 else:
5618 self.__downloadCancelled = True 5617 self.__downloadCancelled = True
5619 reply.abort() 5618 reply.abort()

eric ide

mercurial