src/eric7/UI/UserInterface.py

branch
eric7
changeset 10926
9ef616cd220d
parent 10922
36a90a94765c
child 10928
46651e194fbe
equal deleted inserted replaced
10925:22c3928a1ab5 10926:9ef616cd220d
4777 user, what to do with it. 4777 user, what to do with it.
4778 """ 4778 """
4779 from .ErrorLogDialog import ErrorLogDialog 4779 from .ErrorLogDialog import ErrorLogDialog
4780 4780
4781 if Preferences.getUI("CheckErrorLog"): 4781 if Preferences.getUI("CheckErrorLog"):
4782 logFile = os.path.join(Globals.getConfigDir(), self.ErrorLogFileName) 4782 logFile = os.path.join(EricUtilities.getConfigDir(), self.ErrorLogFileName)
4783 if os.path.exists(logFile): 4783 if os.path.exists(logFile):
4784 dlg = ErrorLogDialog(logFile, False, self) 4784 dlg = ErrorLogDialog(logFile, False, self)
4785 dlg.exec() 4785 dlg.exec()
4786 4786
4787 def __hasErrorLog(self): 4787 def __hasErrorLog(self):
4789 Private method to check, if an error log file exists. 4789 Private method to check, if an error log file exists.
4790 4790
4791 @return flag indicating the existence of an error log file 4791 @return flag indicating the existence of an error log file
4792 @rtype bool 4792 @rtype bool
4793 """ 4793 """
4794 logFile = os.path.join(Globals.getConfigDir(), self.ErrorLogFileName) 4794 logFile = os.path.join(EricUtilities.getConfigDir(), self.ErrorLogFileName)
4795 return os.path.exists(logFile) 4795 return os.path.exists(logFile)
4796 4796
4797 def __showErrorLog(self): 4797 def __showErrorLog(self):
4798 """ 4798 """
4799 Private slot to show the most recent error log message. 4799 Private slot to show the most recent error log message.
4800 """ 4800 """
4801 from .ErrorLogDialog import ErrorLogDialog 4801 from .ErrorLogDialog import ErrorLogDialog
4802 4802
4803 logFile = os.path.join(Globals.getConfigDir(), self.ErrorLogFileName) 4803 logFile = os.path.join(EricUtilities.getConfigDir(), self.ErrorLogFileName)
4804 if os.path.exists(logFile): 4804 if os.path.exists(logFile):
4805 dlg = ErrorLogDialog(logFile, True, self) 4805 dlg = ErrorLogDialog(logFile, True, self)
4806 dlg.show() 4806 dlg.show()
4807 4807
4808 def __showInstallInfo(self): 4808 def __showInstallInfo(self):
7748 7748
7749 def __writeTasks(self): 7749 def __writeTasks(self):
7750 """ 7750 """
7751 Private slot to write the tasks data to a JSON file (.etj). 7751 Private slot to write the tasks data to a JSON file (.etj).
7752 """ 7752 """
7753 fn = os.path.join(Globals.getConfigDir(), "eric7tasks.etj") 7753 fn = os.path.join(EricUtilities.getConfigDir(), "eric7tasks.etj")
7754 self.__tasksFile.writeFile(fn) 7754 self.__tasksFile.writeFile(fn)
7755 7755
7756 def __readTasks(self): 7756 def __readTasks(self):
7757 """ 7757 """
7758 Private slot to read in the tasks file (.etj). 7758 Private slot to read in the tasks file (.etj).
7759 """ 7759 """
7760 fn = os.path.join(Globals.getConfigDir(), "eric7tasks.etj") 7760 fn = os.path.join(EricUtilities.getConfigDir(), "eric7tasks.etj")
7761 if os.path.exists(fn): 7761 if os.path.exists(fn):
7762 self.__tasksFile.readFile(fn) 7762 self.__tasksFile.readFile(fn)
7763 7763
7764 @pyqtSlot() 7764 @pyqtSlot()
7765 def __showSessionsMenu(self): 7765 def __showSessionsMenu(self):
7790 @rtype bool 7790 @rtype bool
7791 """ 7791 """
7792 fn = ( 7792 fn = (
7793 filename 7793 filename
7794 if filename 7794 if filename
7795 else os.path.join(Globals.getConfigDir(), "eric7session.esj") 7795 else os.path.join(EricUtilities.getConfigDir(), "eric7session.esj")
7796 ) 7796 )
7797 7797
7798 return self.__sessionFile.writeFile(fn) 7798 return self.__sessionFile.writeFile(fn)
7799 7799
7800 def __readSession(self, filename=""): 7800 def __readSession(self, filename=""):
7807 @rtype bool 7807 @rtype bool
7808 """ 7808 """
7809 if filename: 7809 if filename:
7810 fn = filename 7810 fn = filename
7811 else: 7811 else:
7812 fn = os.path.join(Globals.getConfigDir(), "eric7session.esj") 7812 fn = os.path.join(EricUtilities.getConfigDir(), "eric7session.esj")
7813 if not os.path.exists(fn): 7813 if not os.path.exists(fn):
7814 EricMessageBox.critical( 7814 EricMessageBox.critical(
7815 self, 7815 self,
7816 self.tr("Read Session"), 7816 self.tr("Read Session"),
7817 self.tr( 7817 self.tr(
7879 @type bool (optional) 7879 @type bool (optional)
7880 @return crash session file path 7880 @return crash session file path
7881 @rtype str 7881 @rtype str
7882 """ 7882 """
7883 if globPattern: 7883 if globPattern:
7884 return os.path.join(Globals.getConfigDir(), "eric7_crash_session_*.esj") 7884 return os.path.join(
7885 EricUtilities.getConfigDir(), "eric7_crash_session_*.esj"
7886 )
7885 else: 7887 else:
7886 return os.path.join( 7888 return os.path.join(
7887 Globals.getConfigDir(), f"eric7_crash_session_{os.getpid()}.esj" 7889 EricUtilities.getConfigDir(), f"eric7_crash_session_{os.getpid()}.esj"
7888 ) 7890 )
7889 7891
7890 def __getCrashedSessions(self): 7892 def __getCrashedSessions(self):
7891 """ 7893 """
7892 Private method to get a list of crash session file paths of crashed sessions. 7894 Private method to get a list of crash session file paths of crashed sessions.

eric ide

mercurial