codekingpro/portable-devtools
115k
1import win32ui2from pywin.mfc import dialog3 4from . import dbgcon5 6 7class DebuggerOptionsPropPage(dialog.PropertyPage):8 def __init__(self):9 dialog.PropertyPage.__init__(self, win32ui.IDD_PP_DEBUGGER)10 11 def OnInitDialog(self):12 options = self.options = dbgcon.LoadDebuggerOptions()13 self.AddDDX(win32ui.IDC_CHECK1, dbgcon.OPT_HIDE)14 self[dbgcon.OPT_STOP_EXCEPTIONS] = options[dbgcon.OPT_STOP_EXCEPTIONS]15 self.AddDDX(win32ui.IDC_CHECK2, dbgcon.OPT_STOP_EXCEPTIONS)16 self[dbgcon.OPT_HIDE] = options[dbgcon.OPT_HIDE]17 return dialog.PropertyPage.OnInitDialog(self)18 19 def OnOK(self):20 self.UpdateData()21 dirty = 022 for key, val in list(self.items()):23 if key in self.options:24 if self.options[key] != val:25 self.options[key] = val26 dirty = 127 if dirty:28 dbgcon.SaveDebuggerOptions(self.options)29 # If there is a debugger open, then set its options.30 import pywin.debugger31 32 if pywin.debugger.currentDebugger is not None:33 pywin.debugger.currentDebugger.options = self.options34 return 135 