132 maxMenuFilePathLen = 75 |
132 maxMenuFilePathLen = 75 |
133 |
133 |
134 LeftSide = 1 |
134 LeftSide = 1 |
135 BottomSide = 2 |
135 BottomSide = 2 |
136 RightSide = 3 |
136 RightSide = 3 |
|
137 |
|
138 ErrorLogFileName = "eric5_error.log" |
137 |
139 |
138 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, |
140 def __init__(self, app, locale, splash, plugin, noOpenAtStartup, |
139 restartArguments): |
141 restartArguments): |
140 """ |
142 """ |
141 Constructor |
143 Constructor |
1616 )) |
1618 )) |
1617 self.showVersionsAct.triggered[()].connect( |
1619 self.showVersionsAct.triggered[()].connect( |
1618 self.showAvailableVersionsInfo) |
1620 self.showAvailableVersionsInfo) |
1619 self.actions.append(self.showVersionsAct) |
1621 self.actions.append(self.showVersionsAct) |
1620 |
1622 |
|
1623 self.showErrorLogAct = E5Action( |
|
1624 self.trUtf8('Show Error Log'), |
|
1625 self.trUtf8('Show Error &Log...'), |
|
1626 0, 0, self, 'show_error_log') |
|
1627 self.showErrorLogAct.setStatusTip(self.trUtf8('Show Error Log')) |
|
1628 self.showErrorLogAct.setWhatsThis(self.trUtf8( |
|
1629 """<b>Show Error Log...</b>""" |
|
1630 """<p>Opens a dialog showing the most recent error log.</p>""" |
|
1631 )) |
|
1632 self.showErrorLogAct.triggered[()].connect(self.__showErrorLog) |
|
1633 self.actions.append(self.showErrorLogAct) |
|
1634 |
1621 self.reportBugAct = E5Action( |
1635 self.reportBugAct = E5Action( |
1622 self.trUtf8('Report Bug'), |
1636 self.trUtf8('Report Bug'), |
1623 self.trUtf8('Report &Bug...'), |
1637 self.trUtf8('Report &Bug...'), |
1624 0, 0, self, 'report_bug') |
1638 0, 0, self, 'report_bug') |
1625 self.reportBugAct.setStatusTip(self.trUtf8('Report a bug')) |
1639 self.reportBugAct.setStatusTip(self.trUtf8('Report a bug')) |
2490 self.__menus["help"].addAction(self.versionAct) |
2504 self.__menus["help"].addAction(self.versionAct) |
2491 self.__menus["help"].addSeparator() |
2505 self.__menus["help"].addSeparator() |
2492 self.__menus["help"].addAction(self.checkUpdateAct) |
2506 self.__menus["help"].addAction(self.checkUpdateAct) |
2493 self.__menus["help"].addAction(self.showVersionsAct) |
2507 self.__menus["help"].addAction(self.showVersionsAct) |
2494 self.__menus["help"].addSeparator() |
2508 self.__menus["help"].addSeparator() |
|
2509 self.__menus["help"].addAction(self.showErrorLogAct) |
2495 self.__menus["help"].addAction(self.reportBugAct) |
2510 self.__menus["help"].addAction(self.reportBugAct) |
2496 self.__menus["help"].addAction(self.requestFeatureAct) |
2511 self.__menus["help"].addAction(self.requestFeatureAct) |
2497 self.__menus["help"].addSeparator() |
2512 self.__menus["help"].addSeparator() |
2498 self.__menus["help"].addAction(self.whatsThisAct) |
2513 self.__menus["help"].addAction(self.whatsThisAct) |
2499 self.__menus["help"].aboutToShow.connect(self.__showHelpMenu) |
2514 self.__menus["help"].aboutToShow.connect(self.__showHelpMenu) |
2833 """ |
2848 """ |
2834 Private slot to display the Help menu. |
2849 Private slot to display the Help menu. |
2835 """ |
2850 """ |
2836 self.checkUpdateAct.setEnabled(not self.__inVersionCheck) |
2851 self.checkUpdateAct.setEnabled(not self.__inVersionCheck) |
2837 self.showVersionsAct.setEnabled(not self.__inVersionCheck) |
2852 self.showVersionsAct.setEnabled(not self.__inVersionCheck) |
|
2853 self.showErrorLogAct.setEnabled(self.__hasErrorLog()) |
2838 |
2854 |
2839 self.showMenu.emit("Help", self.__menus["help"]) |
2855 self.showMenu.emit("Help", self.__menus["help"]) |
2840 |
2856 |
2841 def __showSettingsMenu(self): |
2857 def __showSettingsMenu(self): |
2842 """ |
2858 """ |
2998 """ |
3014 """ |
2999 Public method to check for the presence of an error log and ask the |
3015 Public method to check for the presence of an error log and ask the |
3000 user, what to do with it. |
3016 user, what to do with it. |
3001 """ |
3017 """ |
3002 if Preferences.getUI("CheckErrorLog"): |
3018 if Preferences.getUI("CheckErrorLog"): |
3003 logFile = os.path.join(Utilities.getConfigDir(), "eric5_error.log") |
3019 logFile = os.path.join(Utilities.getConfigDir(), |
|
3020 self.ErrorLogFileName) |
3004 if os.path.exists(logFile): |
3021 if os.path.exists(logFile): |
3005 from .ErrorLogDialog import ErrorLogDialog |
3022 from .ErrorLogDialog import ErrorLogDialog |
3006 dlg = ErrorLogDialog(logFile, self) |
3023 dlg = ErrorLogDialog(logFile, False, self) |
3007 dlg.exec_() |
3024 dlg.exec_() |
|
3025 |
|
3026 def __hasErrorLog(self): |
|
3027 """ |
|
3028 Private method to check, if an error log file exists. |
|
3029 """ |
|
3030 logFile = os.path.join(Utilities.getConfigDir(), |
|
3031 self.ErrorLogFileName) |
|
3032 return os.path.exists(logFile) |
|
3033 |
|
3034 def __showErrorLog(self): |
|
3035 """ |
|
3036 Private slot to show the most recent error log message. |
|
3037 """ |
|
3038 logFile = os.path.join(Utilities.getConfigDir(), |
|
3039 self.ErrorLogFileName) |
|
3040 if os.path.exists(logFile): |
|
3041 from .ErrorLogDialog import ErrorLogDialog |
|
3042 dlg = ErrorLogDialog(logFile, True, self) |
|
3043 dlg.show() |
3008 |
3044 |
3009 def __compareFiles(self): |
3045 def __compareFiles(self): |
3010 """ |
3046 """ |
3011 Private slot to handle the Compare Files dialog. |
3047 Private slot to handle the Compare Files dialog. |
3012 """ |
3048 """ |