UI/UserInterface.py

changeset 5379
0f14e170a803
parent 5371
01c4c059142b
child 5389
9b1c800daff3
diff -r 9e972ace410a -r 0f14e170a803 UI/UserInterface.py
--- a/UI/UserInterface.py	Wed Dec 14 19:17:33 2016 +0100
+++ b/UI/UserInterface.py	Wed Dec 14 19:27:10 2016 +0100
@@ -163,7 +163,7 @@
     ErrorLogFileName = "eric6_error.log"
     
     def __init__(self, app, locale, splash, plugin, noOpenAtStartup,
-                 noCrashOpenAtStartup, restartArguments):
+                 noCrashOpenAtStartup, disableCrashSession, restartArguments):
         """
         Constructor
         
@@ -177,6 +177,8 @@
             should not be executed (boolean)
         @param noCrashOpenAtStartup flag indicating to ignore any crash session
             file found at statup (boolean)
+        @param disableCrashSession flag indicating to disable the crash session
+            support (boolean)
         @param restartArguments list of command line parameters to be used for
             a restart (list of strings)
         """
@@ -191,6 +193,7 @@
         self.locale = locale
         self.__noOpenAtStartup = noOpenAtStartup
         self.__noCrashOpenAtStartup = noCrashOpenAtStartup
+        self.__disableCrashSession = disableCrashSession
         
         self.layoutType, self.embeddedShell, self.embeddedFileBrowser = \
             Preferences.getUILayout()
@@ -5534,6 +5537,12 @@
         else:
             QApplication.setKeyboardInputInterval(-1)
         
+        if not self.__disableCrashSession:
+            if Preferences.getUI("CrashSessionEnabled"):
+                self.__writeCrashSession()
+            else:
+                self.__deleteCrashSession()
+        
         self.preferencesChanged.emit()
     
     def __masterPasswordChanged(self, oldPassword, newPassword):
@@ -5967,7 +5976,9 @@
         """
         Private slot to write a crash session file.
         """
-        if not self.__readingSession:
+        if not self.__readingSession and \
+            not self.__disableCrashSession and \
+                Preferences.getUI("CrashSessionEnabled"):
             self.__writeSession(crashSession=True)
     
     def __readCrashSession(self):
@@ -5978,7 +5989,8 @@
         @rtype bool
         """
         res = False
-        if not self.__noCrashOpenAtStartup and \
+        if not self.__disableCrashSession and \
+            not self.__noCrashOpenAtStartup and \
                 Preferences.getUI("OpenCrashSessionOnStartup"):
             fn = os.path.join(Utilities.getConfigDir(),
                               "eric6_crash_session.e5s")
@@ -6230,7 +6242,7 @@
         if not self.viewmanager.closeViewManager():
             return False
         
-        if sessionCreated:
+        if sessionCreated and not self.__disableCrashSession:
             self.__deleteCrashSession()
         
         self.__previewer.shutdown()

eric ide

mercurial