@@ -109,6 +109,8 @@ def load_config():
109
109
conf_dict .setdefault ("wrap_variables" , True )
110
110
conf_dict .setdefault ("default_variables_access_level" , "public" )
111
111
112
+ conf_dict .setdefault ("persist_watches" , False )
113
+
112
114
conf_dict .setdefault ("display" , "auto" )
113
115
114
116
conf_dict .setdefault ("prompt_on_quit" , True )
@@ -124,6 +126,7 @@ def normalize_bool_inplace(name):
124
126
125
127
normalize_bool_inplace ("line_numbers" )
126
128
normalize_bool_inplace ("wrap_variables" )
129
+ normalize_bool_inplace ("persist_watches" )
127
130
normalize_bool_inplace ("prompt_on_quit" )
128
131
129
132
return conf_dict
@@ -179,6 +182,9 @@ def _update_default_variables_access_level():
179
182
def _update_wrap_variables ():
180
183
ui .update_var_view ()
181
184
185
+ def _update_persist_watches ():
186
+ pass
187
+
182
188
def _update_config (check_box , new_state , option_newvalue ):
183
189
option , newvalue = option_newvalue
184
190
new_conf_dict = {option : newvalue }
@@ -230,6 +236,11 @@ def _update_config(check_box, new_state, option_newvalue):
230
236
conf_dict .update (new_conf_dict )
231
237
_update_wrap_variables ()
232
238
239
+ elif option == "persist_watches" :
240
+ new_conf_dict ["persist_watches" ] = not check_box .get_state ()
241
+ conf_dict .update (new_conf_dict )
242
+ _update_persist_watches ()
243
+
233
244
heading = urwid .Text ("This is the preferences screen for PuDB. "
234
245
"Hit Ctrl-P at any time to get back to it.\n \n "
235
246
"Configuration settings are saved in "
@@ -384,6 +395,17 @@ def _update_config(check_box, new_state, option_newvalue):
384
395
385
396
# }}}
386
397
398
+ # {{{ persist watches
399
+
400
+ cb_persist_watches = urwid .CheckBox ("Persist watches" ,
401
+ bool (conf_dict ["persist_watches" ]), on_state_change = _update_config ,
402
+ user_data = ("persist_watches" , None ))
403
+
404
+ persist_watches_info = urwid .Text ("\n Keep watched expressions between "
405
+ "debugging sessions." )
406
+
407
+ # }}}
408
+
387
409
# {{{ display
388
410
389
411
display_info = urwid .Text ("What driver is used to talk to your terminal. "
@@ -438,6 +460,10 @@ def _update_config(check_box, new_state, option_newvalue):
438
460
+ [cb_wrap_variables ]
439
461
+ [wrap_variables_info ]
440
462
463
+ + [urwid .AttrMap (urwid .Text ("\n Persist Watches:\n " ), "group head" )]
464
+ + [cb_persist_watches ]
465
+ + [persist_watches_info ]
466
+
441
467
+ [urwid .AttrMap (urwid .Text ("\n Display driver:\n " ), "group head" )]
442
468
+ [display_info ]
443
469
+ display_rbs
0 commit comments