(self,parent,id,title,logcheck="/dev/null",logtype=None)
| 31 | |
| 32 | class MainWindow(wx.Frame): |
| 33 | def __init__(self,parent,id,title,logcheck="/dev/null",logtype=None): |
| 34 | self.logtype = 1 |
| 35 | self.logfile = None |
| 36 | self.logname = "" |
| 37 | self.need_redisplay = False |
| 38 | |
| 39 | wx.Frame.__init__(self, parent, -1, title, size = (810, 600+Variables.windows_add_size), style = wx.CLOSE_BOX | wx.CAPTION | wx.MINIMIZE_BOX) |
| 40 | self.SetIcon(wx.Icon(Variables.playonlinux_env+"/etc/playonlinux.png", wx.BITMAP_TYPE_ANY)) |
| 41 | self.SetTitle(_('{0} debugger').format(os.environ["APPLICATION_TITLE"])) |
| 42 | #self.panelFenp = wx.Panel(self, -1) |
| 43 | |
| 44 | self.prefixes_item = {} |
| 45 | self.logs_item = {} |
| 46 | |
| 47 | self.splitter = wx.SplitterWindow(self, -1, style=wx.SP_NOBORDER) |
| 48 | self.panelEmpty = wx.Panel(self.splitter, -1) |
| 49 | self.panelNotEmpty = wx.Panel(self.splitter, -1) |
| 50 | |
| 51 | |
| 52 | self.noselect = wx.StaticText(self.panelEmpty, -1, _('Please select a debug file'),pos=(0,150),style=wx.ALIGN_RIGHT) |
| 53 | self.noselect.SetPosition(((570-self.noselect.GetSize()[0])/2,250)) |
| 54 | self.noselect.Wrap(500) |
| 55 | |
| 56 | |
| 57 | self.images = wx.ImageList(16, 16) |
| 58 | |
| 59 | self.list_game = wx.TreeCtrl(self.splitter, 900, size = wx.DefaultSize, style=wx.TR_HIDE_ROOT) |
| 60 | self.Bind(wx.EVT_TREE_SEL_CHANGED, self.analyseLog, id=900) |
| 61 | |
| 62 | |
| 63 | self.list_game.SetSpacing(0); |
| 64 | self.list_game.SetImageList(self.images) |
| 65 | |
| 66 | |
| 67 | self.list_software() |
| 68 | |
| 69 | self.throttling = False |
| 70 | self.line_buffer = "" |
| 71 | self.timer = wx.Timer(self, 1) |
| 72 | self.Bind(wx.EVT_TIMER, self.AutoReload, self.timer) |
| 73 | self.AutoReload(self) |
| 74 | self.timer.Start(10) |
| 75 | self.logfile = "" |
| 76 | |
| 77 | # Debug control |
| 78 | self.panelText = wx.Panel(self.panelNotEmpty, -1, size=(590,500), pos=(2,2)) # Hack, wxpython bug |
| 79 | self.log_reader = wx.TextCtrl(self.panelText, 100, "", size=wx.Size(590,500), pos=(2,2), style=Variables.widget_borders|wx.TE_RICH2|wx.TE_READONLY|wx.TE_MULTILINE) |
| 80 | self.log_reader.Bind(wx.EVT_SET_FOCUS, self.OnFocus) |
| 81 | self.openTextEdit = wx.Button(self.panelNotEmpty, 101, _("Locate this logfile"), size=(400,30), pos=(70,512)) |
| 82 | self.reportProblem = wx.Button(self.panelNotEmpty, 102, "", size=(400,30), pos=(70,552)) |
| 83 | |
| 84 | if(logcheck == "/dev/null"): |
| 85 | self.HideLogFile() |
| 86 | else: |
| 87 | self.analyseReal(logtype,logcheck) |
| 88 | self.Bind(wx.EVT_BUTTON,self.locate,id=101) |
| 89 | self.Bind(wx.EVT_BUTTON,self.bugReport,id=102) |
| 90 | self.Bind(wx.EVT_CLOSE,self.app_Close) |
nothing calls this directly
no test coverage detected