eric7/Debugger/DebugUI.py

branch
eric7
changeset 8524
595547ab8d6f
parent 8366
2a9f5153c438
child 8529
569623270e29
--- a/eric7/Debugger/DebugUI.py	Fri Aug 20 14:19:55 2021 +0200
+++ b/eric7/Debugger/DebugUI.py	Fri Aug 20 18:02:46 2021 +0200
@@ -25,6 +25,8 @@
     HasDebugger, HasInterpreter, HasProfiler, HasCoverage
 )
 
+from Globals import recentNameBreakpointConditions
+
 import Preferences
 import Utilities
 import UI.PixmapCache
@@ -976,6 +978,8 @@
             'DebugInfo/MultiprocessNoDebugHistory',
             self.multiprocessNoDebugHistory)
         
+        self.debugViewer.breakpointViewer.clearHistories()
+        
     def shutdown(self):
         """
         Public method to perform shutdown actions.
@@ -1479,14 +1483,33 @@
         
         fn, line, cond, temp, enabled, count = bp[:6]
         
+        # get recently used breakpoint conditions
+        rs = Preferences.Prefs.rsettings.value(
+            recentNameBreakpointConditions)
+        condHistory = (
+            Preferences.toList(rs)[
+                :Preferences.getDebugger("RecentNumber")]
+            if rs is not None else
+            []
+        )
+        
         from .EditBreakpointDialog import EditBreakpointDialog
         dlg = EditBreakpointDialog(
             (fn, line), (cond, temp, enabled, count),
-            [], self.ui, modal=True)
+            condHistory, self.ui, modal=True)
         if dlg.exec() == QDialog.DialogCode.Accepted:
             cond, temp, enabled, count = dlg.getData()
             model.setBreakPointByIndex(index, fn, line,
                                        (cond, temp, enabled, count))
+            
+            if cond:
+                # save the recently used breakpoint condition
+                if cond in condHistory:
+                    condHistory.remove(cond)
+                condHistory.insert(0, cond)
+                Preferences.Prefs.rsettings.setValue(
+                    recentNameBreakpointConditions, condHistory)
+                Preferences.Prefs.rsettings.sync()
         
     def __clientWatchConditionError(self, cond, debuggerId):
         """

eric ide

mercurial